]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Regtest arm64: remove none filter_nan
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 23 May 2026 05:39:30 +0000 (07:39 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 23 May 2026 05:42:57 +0000 (07:42 +0200)
Handle printing "-nan" in simd.c rather than using a filter. Also use builtins
to generate inf and nan values as it is more reliable.

none/tests/arm64/Makefile.am
none/tests/arm64/filter_nan [deleted file]
none/tests/arm64/fp_and_simd.vgtest
none/tests/arm64/simd.c

index 8f58e72217989cb8cc391228c075b08e5a94a5fc..7acb43271272304eb2806ead2bc388dece06d1bc 100644 (file)
@@ -1,7 +1,7 @@
 
 include $(top_srcdir)/Makefile.tool-tests.am
 
-dist_noinst_SCRIPTS = filter_stderr filter_nan
+dist_noinst_SCRIPTS = filter_stderr
 
 EXTRA_DIST = \
        bug484426.stdout.exp bug484426.vgtest \
diff --git a/none/tests/arm64/filter_nan b/none/tests/arm64/filter_nan
deleted file mode 100755 (executable)
index 78663db..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-
-sed 's/special value 7 = nan/special value 7 = -nan/'
index 85a1900ed48fdd314fe2c7d832a28ecd16419a10..b835f3aae036a448dbc945848c3074af72a8e9f6 100644 (file)
@@ -1,3 +1,2 @@
 prog: fp_and_simd
 vgopts: -q
-stdout_filter: filter_nan
index c0a178fe8c8a4f4ea16bfdf37b44838444f255c7..9faee9fe6937dd01254f0b24f419ac45a0d6c610 100644 (file)
@@ -76,8 +76,6 @@ static Bool   special_values_initted = False;
 
 static __attribute__((noinline))
 Double negate ( Double d ) { return -d; }
-static __attribute__((noinline))
-Double divf64 ( Double x, Double y ) { return x/y; }
 
 static __attribute__((noinline))
 Double plusZero  ( void ) { return 0.0; }
@@ -90,12 +88,12 @@ static __attribute__((noinline))
 Double minusOne ( void ) { return negate(plusOne()); }
 
 static __attribute__((noinline))
-Double plusInf   ( void ) { return 1.0 / 0.0; }
+Double plusInf   ( void ) { return __builtin_inf(); }
 static __attribute__((noinline))
 Double minusInf  ( void ) { return negate(plusInf()); }
 
 static __attribute__((noinline))
-Double plusNaN  ( void ) { return divf64(plusInf(),plusInf()); }
+Double plusNaN  ( void ) { return __builtin_nan(""); }
 static __attribute__((noinline))
 Double minusNaN ( void ) { return negate(plusNaN()); }
 
@@ -122,7 +120,12 @@ static void ensure_special_values_initted ( void )
    int i;
    printf("\n");
    for (i = 0; i < 10; i++) {
-      printf("special value %d = %e\n", i, special_values[i]);
+      // Darwin and FreeBSD always output "nan" even if signbit is set
+      if (isnan(special_values[i]) && signbit(special_values[i])) {
+         printf("special value %d = -nan\n", i);
+      } else {
+         printf("special value %d = %e\n", i, special_values[i]);
+     }
    }
    printf("\n");
 }