diff options
Diffstat (limited to 'third_party/aom/build/make/rtcd.pl')
-rwxr-xr-x | third_party/aom/build/make/rtcd.pl | 71 |
1 files changed, 60 insertions, 11 deletions
diff --git a/third_party/aom/build/make/rtcd.pl b/third_party/aom/build/make/rtcd.pl index 7add5a036..8d8be25c0 100755 --- a/third_party/aom/build/make/rtcd.pl +++ b/third_party/aom/build/make/rtcd.pl @@ -1,5 +1,14 @@ #!/usr/bin/env perl - +## +## Copyright (c) 2017, Alliance for Open Media. All rights reserved +## +## This source code is subject to the terms of the BSD 2 Clause License and +## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License +## was not distributed with this source code in the LICENSE file, you can +## obtain it at www.aomedia.org/license/software. If the Alliance for Open +## Media Patent License 1.0 was not distributed with this source code in the +## PATENTS file, you can obtain it at www.aomedia.org/license/patent. +## no strict 'refs'; use warnings; use Getopt::Long; @@ -205,6 +214,7 @@ sub filter { sub common_top() { my $include_guard = uc($opts{sym})."_H_"; print <<EOF; +// This file is generated. Do not edit. #ifndef ${include_guard} #define ${include_guard} @@ -279,15 +289,12 @@ sub arm() { # Assign the helper variable for each enabled extension foreach my $opt (@ALL_ARCHS) { my $opt_uc = uc $opt; - # Enable neon assembly based on HAVE_NEON logic instead of adding new - # HAVE_NEON_ASM logic - if ($opt eq 'neon_asm') { $opt_uc = 'NEON' } eval "\$have_${opt}=\"flags & HAS_${opt_uc}\""; } common_top; print <<EOF; -#include "aom_config.h" +#include "config/aom_config.h" #ifdef RTCD_C #include "aom_ports/arm.h" @@ -310,10 +317,17 @@ EOF sub mips() { 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 "aom_config.h" +#include "config/aom_config.h" #ifdef RTCD_C static void setup_rtcd_internal(void) @@ -333,11 +347,44 @@ EOF common_bottom; } +sub ppc() { + 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 "config/aom_config.h" + +#ifdef RTCD_C +#include "aom_ports/ppc.h" +static void setup_rtcd_internal(void) +{ + int flags = ppc_simd_caps(); + + (void)flags; + +EOF + + set_function_pointers("c", @ALL_ARCHS); + + print <<EOF; +} +#endif +EOF + common_bottom; +} + sub unoptimized() { determine_indirection "c"; common_top; print <<EOF; -#include "aom_config.h" +#include "config/aom_config.h" #ifdef RTCD_C static void setup_rtcd_internal(void) @@ -359,10 +406,10 @@ EOF &require("c"); if ($opts{arch} eq 'x86') { - @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/); + @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2/); x86; } elsif ($opts{arch} eq 'x86_64') { - @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/); + @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2/); @REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/); &require(@REQUIRES); x86; @@ -383,12 +430,14 @@ if ($opts{arch} eq 'x86') { close CONFIG_FILE; mips; } elsif ($opts{arch} =~ /armv7\w?/) { - @ALL_ARCHS = filter(qw/neon_asm neon/); - &require(@REQUIRES); + @ALL_ARCHS = filter(qw/neon/); arm; } elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) { @ALL_ARCHS = filter(qw/neon/); arm; +} elsif ($opts{arch} eq 'ppc') { + @ALL_ARCHS = filter(qw/vsx/); + ppc; } else { unoptimized; } |