[x264-devel] [PATCH 1/9] aarch64: initial build support

Janne Grunau janne-x264 at jannau.net
Sat Jul 19 20:57:47 CEST 2014


---
 Makefile  |  9 +++++++++
 configure | 24 +++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 773deed..8bc7f9a 100644
--- a/Makefile
+++ b/Makefile
@@ -123,6 +123,15 @@ OBJASM  = $(ASMSRC:%.S=%.o)
 endif
 endif
 
+# AArch64 NEON optims
+ifeq ($(ARCH),AARCH64)
+ifneq ($(AS),)
+ASMSRC +=
+SRCS   +=
+OBJASM  = $(ASMSRC:%.S=%.o)
+endif
+endif
+
 ifneq ($(HAVE_GETOPT_LONG),1)
 SRCCLI += extras/getopt.c
 endif
diff --git a/configure b/configure
index 0a4cb94..2d61a86 100755
--- a/configure
+++ b/configure
@@ -677,6 +677,15 @@ case $host_cpu in
             AS="${AS-${cross_prefix}gcc}"
         fi
         ;;
+    aarch64)
+        ARCH="AARCH64"
+        if [ "$SYS" = MACOSX ] ; then
+            AS="${AS-extras/gas-preprocessor.pl $CC}"
+            ASFLAGS="$ASFLAGS -DPREFIX"
+        else
+            AS="${AS-${CC}}"
+        fi
+        ;;
     s390|s390x)
         ARCH="S390"
         ;;
@@ -760,6 +769,19 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
     fi
 fi
 
+if [ $asm = auto -a $ARCH = AARCH64 ] ; then
+    # set flags so neon is built by default
+    echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' || CFLAGS="$CFLAGS -arch arm64 -mfpu=neon"
+
+    if  cc_check '' '' '__asm__("cmeq v0.8h, v0.8h, #0");' ; then define HAVE_NEON
+        ASFLAGS="$ASFLAGS $CFLAGS -c"
+    else
+        echo "no NEON support, try adding -mfpu=neon to CFLAGS"
+        echo "If you really want to run on such a CPU, configure with --disable-asm."
+        exit 1
+    fi
+fi
+
 [ $asm = no ] && AS=""
 [ "x$AS" = x ] && asm="no" || asm="yes"
 
@@ -1306,7 +1328,7 @@ cat conftest.log
 rm conftest.log
 
 [ "$SRCPATH" != "." ] && ln -sf ${SRCPATH}/Makefile ./Makefile
-mkdir -p common/{arm,ppc,x86} encoder extras filters/video input output tools
+mkdir -p common/{aarch64,arm,ppc,x86} encoder extras filters/video input output tools
 
 echo
 echo "You can run 'make' or 'make fprofiled' now."
-- 
2.0.0



More information about the x264-devel mailing list