aboutsummaryrefslogtreecommitdiff
path: root/libvpx/build/make/rtcd.pl
diff options
context:
space:
mode:
Diffstat (limited to 'libvpx/build/make/rtcd.pl')
-rwxr-xr-xlibvpx/build/make/rtcd.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/libvpx/build/make/rtcd.pl b/libvpx/build/make/rtcd.pl
index acb9f6e46..9c9726842 100755
--- a/libvpx/build/make/rtcd.pl
+++ b/libvpx/build/make/rtcd.pl
@@ -387,6 +387,37 @@ EOF
common_bottom;
}
+sub loongarch() {
+ determine_indirection("c", @ALL_ARCHS);
+
+ # Assign the helper variable for each enabled extension
+ foreach my $opt (@ALL_ARCHS) {
+ my $opt_uc = uc $opt;
+ eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
+ }
+
+ common_top;
+ print <<EOF;
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+#include "vpx_ports/loongarch.h"
+static void setup_rtcd_internal(void)
+{
+ int flags = loongarch_cpu_caps();
+
+ (void)flags;
+EOF
+
+ set_function_pointers("c", @ALL_ARCHS);
+
+ print <<EOF;
+}
+#endif
+EOF
+ common_bottom;
+}
+
sub unoptimized() {
determine_indirection "c";
common_top;
@@ -462,6 +493,9 @@ if ($opts{arch} eq 'x86') {
} elsif ($opts{arch} =~ /^ppc/ ) {
@ALL_ARCHS = filter(qw/vsx/);
ppc;
+} elsif ($opts{arch} =~ /loongarch/ ) {
+ @ALL_ARCHS = filter(qw/lsx lasx/);
+ loongarch;
} else {
unoptimized;
}