|
From: <sv...@va...> - 2017-05-17 11:07:02
|
Author: iraisr
Date: Wed May 17 12:06:53 2017
New Revision: 16393
Log:
Fix test fb_test_amd64.
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.
Modified:
trunk/none/tests/amd64/Makefile.am
trunk/none/tests/amd64/fb_test_amd64.c
trunk/none/tests/amd64/fb_test_amd64.vgtest
Modified: trunk/none/tests/amd64/Makefile.am
==============================================================================
--- trunk/none/tests/amd64/Makefile.am (original)
+++ trunk/none/tests/amd64/Makefile.am Wed May 17 12:06:53 2017
@@ -98,7 +98,6 @@
bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \
clc \
cmpxchg \
- fb_test_amd64 \
getseg \
$(INSN_TESTS) \
nan80and64 \
@@ -113,6 +112,7 @@
check_PROGRAMS += asorep
endif
if BUILD_AVX_TESTS
+ check_PROGRAMS += fb_test_amd64
if BUILD_VPCLMULQDQ_TESTS
check_PROGRAMS += avx-1
endif
Modified: trunk/none/tests/amd64/fb_test_amd64.c
==============================================================================
--- trunk/none/tests/amd64/fb_test_amd64.c (original)
+++ trunk/none/tests/amd64/fb_test_amd64.c Wed May 17 12:06:53 2017
@@ -362,6 +362,7 @@
printf("\n");
}
+__attribute__((format(__printf__, 1, 2)))
void xxprintf (const char *format, ...)
{
char buf[128];
@@ -947,9 +948,9 @@
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 @@
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);
}
}
Modified: trunk/none/tests/amd64/fb_test_amd64.vgtest
==============================================================================
--- trunk/none/tests/amd64/fb_test_amd64.vgtest (original)
+++ trunk/none/tests/amd64/fb_test_amd64.vgtest Wed May 17 12:06:53 2017
@@ -1 +1,2 @@
prog: fb_test_amd64
+prereq: test -x fb_test_amd64 && ../../../tests/x86_amd64_features amd64-avx
|