summaryrefslogtreecommitdiff
path: root/build/make
diff options
context:
space:
mode:
authorRafael de Lucena Valle <rafaeldelucena@gmail.com>2016-10-19 22:21:09 -0200
committerJohann Koenig <johannkoenig@google.com>2017-03-08 20:28:08 +0000
commit51289302ab02d81c17d3f15bbfb9a22eef4a36c1 (patch)
tree792f999e7bd550ec7b6027176b904e0dcaa701ce /build/make
parent2fa710aa6db08aabd00f139274780e9300e815f1 (diff)
downloadlibvpx-51289302ab02d81c17d3f15bbfb9a22eef4a36c1.tar
libvpx-51289302ab02d81c17d3f15bbfb9a22eef4a36c1.tar.gz
libvpx-51289302ab02d81c17d3f15bbfb9a22eef4a36c1.tar.bz2
libvpx-51289302ab02d81c17d3f15bbfb9a22eef4a36c1.zip
Add support for POWER8/VSX
Add ppc, ppc64 and ppc64le on all_platforms and ARCH_LIST Add VSX flags and check for -mvsx Define empty setup_rtcd_internal Add Altivec detection based on: http://freevec.org/function/altivec_runtime_detection_linux Detect VSX at runtime when enabled Change-Id: I304f4d8c5fee0ff19b6483cd2e9cc50d6ddec472 Signed-off-by: Rafael de Lucena Valle <rafaeldelucena@gmail.com>
Diffstat (limited to 'build/make')
-rw-r--r--build/make/Makefile5
-rw-r--r--build/make/configure.sh11
-rwxr-xr-xbuild/make/rtcd.pl33
3 files changed, 49 insertions, 0 deletions
diff --git a/build/make/Makefile b/build/make/Makefile
index cba605786..0d29609ff 100644
--- a/build/make/Makefile
+++ b/build/make/Makefile
@@ -124,6 +124,7 @@ ifeq ($(TOOLCHAIN), x86-os2-gcc)
CFLAGS += -mstackrealign
endif
+# x86[_64]
$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
@@ -139,6 +140,10 @@ $(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2
+# POWER
+$(BUILD_PFX)%_vsx.c.d: CFLAGS += -mvsx
+$(BUILD_PFX)%_vsx.c.o: CFLAGS += -mvsx
+
$(BUILD_PFX)%.c.d: %.c
$(if $(quiet),@echo " [DEP] $@")
$(qexec)mkdir -p $(dir $@)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index ac60f5082..dcfdfe1d2 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -697,6 +697,9 @@ process_common_toolchain() {
*sparc*)
tgt_isa=sparc
;;
+ power*)
+ tgt_isa=ppc
+ ;;
esac
# detect tgt_os
@@ -782,6 +785,9 @@ process_common_toolchain() {
mips*)
enable_feature mips
;;
+ ppc*)
+ enable_feature ppc
+ ;;
esac
# PIC is probably what we want when building shared libs
@@ -1159,6 +1165,11 @@ EOF
check_add_asflags -march=${tgt_isa}
check_add_asflags -KPIC
;;
+ ppc*)
+ link_with_cc=gcc
+ setup_gnu_toolchain
+ check_gcc_machine_option "vsx"
+ ;;
x86*)
case ${tgt_os} in
win*)
diff --git a/build/make/rtcd.pl b/build/make/rtcd.pl
index 9e746c46d..58700895f 100755
--- a/build/make/rtcd.pl
+++ b/build/make/rtcd.pl
@@ -335,6 +335,36 @@ 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 "vpx_config.h"
+
+#ifdef RTCD_C
+#include "vpx_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;
@@ -390,6 +420,9 @@ if ($opts{arch} eq 'x86') {
} 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;
}