[x264-devel] [Git][videolan/x264][master] checkasm: Print the actual SVE vector length

Martin Storsjö (@mstorsjo) gitlab at videolan.org
Tue Nov 14 12:39:03 UTC 2023



Martin Storsjö pushed to branch master at VideoLAN / x264


Commits:
611b87b7 by Martin Storsjö at 2023-11-14T12:38:47+02:00
checkasm: Print the actual SVE vector length

- - - - -


2 changed files:

- tools/checkasm-aarch64.S
- tools/checkasm.c


Changes:

=====================================
tools/checkasm-aarch64.S
=====================================
@@ -164,3 +164,13 @@ function checkasm_call, export=1
     ldp         x29, x30, [sp], #16
     ret
 endfunc
+
+#if HAVE_SVE
+.arch armv8-a+sve
+
+function checkasm_sve_length, export=1
+    cntb        x0
+    lsl         x0,  x0,  #3
+    ret
+endfunc
+#endif


=====================================
tools/checkasm.c
=====================================
@@ -262,6 +262,10 @@ intptr_t x264_checkasm_call( intptr_t (*func)(), int *ok, ... );
 
 #if HAVE_AARCH64
 intptr_t x264_checkasm_call( intptr_t (*func)(), int *ok, ... );
+
+#if HAVE_SVE
+int x264_checkasm_sve_length( void );
+#endif
 #endif
 
 #if HAVE_ARMV6
@@ -2888,6 +2892,9 @@ static int check_all_flags( void )
         simd_warmup_func = x264_checkasm_warmup_avx;
 #endif
     simd_warmup();
+#if ARCH_AARCH64 && HAVE_SVE
+    char buf[20];
+#endif
 
 #if ARCH_X86 || ARCH_X86_64
     if( cpu_detect & X264_CPU_MMX2 )
@@ -2981,10 +2988,16 @@ static int check_all_flags( void )
         ret |= add_flags( &cpu0, &cpu1, X264_CPU_ARMV8, "ARMv8" );
     if( cpu_detect & X264_CPU_NEON )
         ret |= add_flags( &cpu0, &cpu1, X264_CPU_NEON, "NEON" );
-    if( cpu_detect & X264_CPU_SVE )
-        ret |= add_flags( &cpu0, &cpu1, X264_CPU_SVE, "SVE" );
-    if( cpu_detect & X264_CPU_SVE2 )
-        ret |= add_flags( &cpu0, &cpu1, X264_CPU_SVE2, "SVE2" );
+#if HAVE_SVE
+    if( cpu_detect & X264_CPU_SVE ) {
+        snprintf( buf, sizeof( buf ), "SVE (%d bits)", x264_checkasm_sve_length() );
+        ret |= add_flags( &cpu0, &cpu1, X264_CPU_SVE, buf );
+    }
+    if( cpu_detect & X264_CPU_SVE2 ) {
+        snprintf( buf, sizeof( buf ), "SVE2 (%d bits)", x264_checkasm_sve_length() );
+        ret |= add_flags( &cpu0, &cpu1, X264_CPU_SVE2, buf );
+    }
+#endif
 #elif ARCH_MIPS
     if( cpu_detect & X264_CPU_MSA )
         ret |= add_flags( &cpu0, &cpu1, X264_CPU_MSA, "MSA" );



View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/611b87b7a2a5c94f307cacc949c54b8e92bf25fa

-- 
View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/611b87b7a2a5c94f307cacc949c54b8e92bf25fa
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the x264-devel mailing list