[x264-devel] aarch64: add armv8 and neon cpu flags and test them

Janne Grunau git at videolan.org
Tue Aug 26 18:23:11 CEST 2014


x264 | branch: master | Janne Grunau <janne-x264 at jannau.net> | Wed Mar 19 13:45:17 2014 +0100| [efaf0b88f7c703533ee8857a6a5039cf64bce3a0] | committer: Fiona Glaser

aarch64: add armv8 and neon cpu flags and test them

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=efaf0b88f7c703533ee8857a6a5039cf64bce3a0
---

 common/cpu.c     |   10 ++++++++++
 tools/checkasm.c |    8 ++++++++
 x264.h           |    3 ++-
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/common/cpu.c b/common/cpu.c
index 837de89..4877a01 100644
--- a/common/cpu.c
+++ b/common/cpu.c
@@ -89,6 +89,9 @@ const x264_cpu_name_t x264_cpu_names[] =
     {"ARMv6",           X264_CPU_ARMV6},
     {"NEON",            X264_CPU_NEON},
     {"FastNeonMRC",     X264_CPU_FAST_NEON_MRC},
+#elif ARCH_AARCH64
+    {"ARMv8",           X264_CPU_ARMV8},
+    {"NEON",            X264_CPU_NEON},
 #endif
     {"", 0},
 };
@@ -409,6 +412,13 @@ uint32_t x264_cpu_detect( void )
     return flags;
 }
 
+#elif ARCH_AARCH64
+
+uint32_t x264_cpu_detect( void )
+{
+    return X264_CPU_ARMV8 | X264_CPU_NEON;
+}
+
 #else
 
 uint32_t x264_cpu_detect( void )
diff --git a/tools/checkasm.c b/tools/checkasm.c
index 1bc0722..8dd879a 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -184,6 +184,9 @@ static void print_bench(void)
 #elif ARCH_ARM
                     b->cpu&X264_CPU_NEON ? "neon" :
                     b->cpu&X264_CPU_ARMV6 ? "armv6" :
+#elif ARCH_AARCH64
+                    b->cpu&X264_CPU_NEON ? "neon" :
+                    b->cpu&X264_CPU_ARMV8 ? "armv8" :
 #endif
                     "c",
 #if HAVE_MMX
@@ -2731,6 +2734,11 @@ static int check_all_flags( void )
         ret |= add_flags( &cpu0, &cpu1, X264_CPU_NEON, "NEON" );
     if( x264_cpu_detect() & X264_CPU_FAST_NEON_MRC )
         ret |= add_flags( &cpu0, &cpu1, X264_CPU_FAST_NEON_MRC, "Fast NEON MRC" );
+#elif ARCH_AARCH64
+    if( x264_cpu_detect() & X264_CPU_ARMV8 )
+        ret |= add_flags( &cpu0, &cpu1, X264_CPU_ARMV8, "ARMv8" );
+    if( x264_cpu_detect() & X264_CPU_NEON )
+        ret |= add_flags( &cpu0, &cpu1, X264_CPU_NEON, "NEON" );
 #endif
     return ret;
 }
diff --git a/x264.h b/x264.h
index 50aefc5..b896f91 100644
--- a/x264.h
+++ b/x264.h
@@ -152,10 +152,11 @@ typedef struct
 /* PowerPC */
 #define X264_CPU_ALTIVEC         0x0000001
 
-/* ARM */
+/* ARM and AArch64 */
 #define X264_CPU_ARMV6           0x0000001
 #define X264_CPU_NEON            0x0000002  /* ARM NEON */
 #define X264_CPU_FAST_NEON_MRC   0x0000004  /* Transfer from NEON to ARM register is fast (Cortex-A9) */
+#define X264_CPU_ARMV8           0x0000008
 
 /* Analyse flags */
 #define X264_ANALYSE_I4x4       0x0001  /* Analyse i4x4 */



More information about the x264-devel mailing list