[x264-devel] [PATCH 1/2] vsx: Prepare to have different files for VSX and old Altivec

Alexandra Hájková alexandra.khirnova at gmail.com
Mon Oct 31 09:58:00 CET 2016


From: Luca Barbato <lu_zero at gentoo.org>

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
---
 Makefile  |  6 ++++++
 configure | 15 ++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index d0b1633..3f41bc5 100644
--- a/Makefile
+++ b/Makefile
@@ -108,9 +108,15 @@ endif
 # AltiVec optims
 ifeq ($(SYS_ARCH),PPC)
 ifneq ($(AS),)
+ifeq ($(HAVE_VSX),yes)
 SRCS += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c \
         common/ppc/quant.c common/ppc/deblock.c \
         common/ppc/predict.c
+else
+SRCS += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c \
+        common/ppc/quant.c common/ppc/deblock.c \
+        common/ppc/predict.c
+endif
 endif
 endif
 
diff --git a/configure b/configure
index 346a580..01bd746 100755
--- a/configure
+++ b/configure
@@ -357,6 +357,7 @@ chroma_format="all"
 compiler="GNU"
 compiler_style="GNU"
 opencl="yes"
+vsx="auto"
 
 CFLAGS="$CFLAGS -Wall -I. -I\$(SRCPATH)"
 LDFLAGS="$LDFLAGS"
@@ -474,6 +475,9 @@ for opt do
         --host=*)
             host="$optarg"
             ;;
+        --disable-vsx)
+            vsx="no"
+            ;;
         --disable-opencl)
             opencl="no"
             ;;
@@ -737,9 +741,13 @@ case $host_cpu in
                 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
                 define HAVE_ALTIVEC_H
             fi
-            if cc_check "" "-mvsx" ; then
-                CFLAGS="$CFLAGS -mvsx"
-                define HAVE_VSX
+            if [ "$vsx" != "no" ] || [ "$host_cpu" = "powerpc64le" -a "$vsx" != "no" ] ; then
+                vsx=no
+                if cc_check "" "-mvsx" ; then
+                    CFLAGS="$CFLAGS -mvsx"
+                    define HAVE_VSX
+                    vsx=yes
+                fi
             fi
         fi
         ;;
@@ -1396,6 +1404,7 @@ PROF_GEN_LD=$PROF_GEN_LD
 PROF_USE_CC=$PROF_USE_CC
 PROF_USE_LD=$PROF_USE_LD
 HAVE_OPENCL=$opencl
+HAVE_VSX=$vsx
 EOF
 
 if [ $compiler_style = MS ]; then
-- 
2.7.4



More information about the x264-devel mailing list