]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
arm64: change configure dotprod test to a run test
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 10 May 2026 13:10:58 +0000 (15:10 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 10 May 2026 13:10:58 +0000 (15:10 +0200)
We were testing for dotprod with AC_COMPILE_IFELSE. That's wrong, it just
checks that the compiler accepts -march=armv8.2-a+dotprod and that the
assembler handles dotprod opcodes. Changed it to AC_RUN_IFELSE which
additionally checks that the binary runs. Valgrind should be checking
for this in VG_(machine_get_hwcaps), storing it in VexArchInfo and
checking it in guest_arm64_toIR.c (it looks like we check it but don't
store 'dp' in vai.hwcaps and in general VEX doesnt check whether it
should try to decode these extensions).

configure.ac

index 6a8d7272abbc7e51d90eeca1a89890c0f2c707d0..82d8240c188c9f510cddadbb0279d3c1bbd31e22 100644 (file)
@@ -4074,15 +4074,15 @@ CFLAGS="$save_CFLAGS"
 AM_CONDITIONAL(BUILD_ARMV82_TESTS, test x$ac_have_armv82_feature = xyes)
 
 
-# Does the C compiler support the armv82-a+dotprod flag and assembler dotprod instructions
+# Does the compiler and CPU support the armv82-a+dotprod flag and assembler dotprod instructions
 # Note, this doesn't generate a C-level symbol.  It generates a
 # automake-level symbol (BUILD_ARMV82_DOTPROD_TESTS), used in test Makefile.am's
-AC_MSG_CHECKING([if gcc supports the armv82-a+dotprod feature flag and assembler supports dotprod instructions])
+AC_MSG_CHECKING([if armv82-a+dotprod is supported for tests])
 
 save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -march=armv8.2-a+dotprod -Werror"
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-int main()
+CFLAGS="$CFLAGS -march=armv8.2-a+dotprod"
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+int main(void)
 {
     __asm__ __volatile__("sdot v1.4s, v2.16b, v3.16b");
     return 0;