]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix test fb_test_amd64.
authorIvo Raisr <ivosh@ivosh.net>
Wed, 17 May 2017 11:06:53 +0000 (11:06 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Wed, 17 May 2017 11:06:53 +0000 (11:06 +0000)
Follow up to r16372.

The test is now built if the compiler understands AVX
instructions. The test is executed if the host speaks AVX
is well. Finally bogus printf format flags were fixed as
they caused the output to be inconsistent on Linux and Solaris.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16393

none/tests/amd64/Makefile.am
none/tests/amd64/fb_test_amd64.c
none/tests/amd64/fb_test_amd64.vgtest

index a4139dd83f725644ec07d4107fbe88ed65c61e00..cca385e43eb4e875633cc8b9182681ec8d0d9e07 100644 (file)
@@ -98,7 +98,6 @@ check_PROGRAMS = \
        bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \
        clc \
        cmpxchg \
-       fb_test_amd64 \
        getseg \
        $(INSN_TESTS) \
        nan80and64 \
@@ -113,6 +112,7 @@ if BUILD_ADDR32_TESTS
  check_PROGRAMS += asorep
 endif
 if BUILD_AVX_TESTS
+  check_PROGRAMS += fb_test_amd64
 if BUILD_VPCLMULQDQ_TESTS
   check_PROGRAMS += avx-1
 endif
index 5f77d6be3ca874c2beecc3df0c46dbc6a56bbad6..f4b06e68d4813403d79429a7441d9ed4c2a437f4 100644 (file)
@@ -362,6 +362,7 @@ void xxprintf_done(void)
    printf("\n");
 }
 
+__attribute__((format(__printf__, 1, 2)))
 void xxprintf (const char *format, ...)
 {
    char buf[128];
@@ -947,9 +948,9 @@ void test_fcvt(double a)
     la = a;
     xxprintf("(float)%f = %f\n", a, fa);
     xxprintf("(long double)%f = %Lf\n", a, la);
-    xxprintf("a=%016Lx\n", *(long long *)&a);
-    xxprintf("la=%016Lx %04x\n", *(long long *)&la, 
-           *(unsigned short *)((char *)(&la) + 8));
+    xxprintf("a=%016llx\n", *(unsigned long long int *) &a);
+    xxprintf("la=%016llx %04x\n", *(unsigned long long int *) &la,
+             *(unsigned short *) ((char *)(&la) + 8));
 
     /* test all roundings */
     asm volatile ("fstcw %0" : "=m" (fpuc));
@@ -963,7 +964,7 @@ void test_fcvt(double a)
         asm volatile ("fldcw %0" : : "m" (fpuc));
         xxprintf("(short)a = %d\n", wa);
         xxprintf("(int)a = %d\n", ia);
-        xxprintf("(int64_t)a = %Ld\n", lla);
+        xxprintf("(int64_t)a = %lld\n", lla);
         xxprintf("rint(a) = %f\n", ra);
     }
 }
index 009190678f605c78a1b0fa828b9a356b0b6df64b..43286d615f7232ee21929759f35e30d640b61f37 100644 (file)
@@ -1 +1,2 @@
 prog: fb_test_amd64
+prereq: test -x fb_test_amd64 && ../../../tests/x86_amd64_features amd64-avx