diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2023-04-09 14:41:36 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-09 08:41:36 +0200 |
| commit | 24f2720df43c4570ab9d344a688e0a36d0a8fa88 (patch) | |
| tree | 04e3028d83969421887e29468106f46b416b9144 /tests | |
| parent | d9c30c8942888d609d89df5b8ea29071d2663b46 (diff) | |
| download | box64-24f2720df43c4570ab9d344a688e0a36d0a8fa88.tar.gz box64-24f2720df43c4570ab9d344a688e0a36d0a8fa88.zip | |
[TESTS] Disable compiler optimizations for test17 and some related fixes (#677)
* [TESTS] Disable compiler optimizations for test17 * [INTERP] Fixed MAXSD/MINSD when both sources are 0 * [RV64_DYNAREC] Fixed F2 0F 5D MINSD opcode
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref17.txt | 8 | ||||
| -rwxr-xr-x | tests/test17 | bin | 254544 -> 137224 bytes | |||
| -rw-r--r-- | tests/test17.c | 37 |
3 files changed, 23 insertions, 22 deletions
diff --git a/tests/ref17.txt b/tests/ref17.txt index 2f5688f2..865dabc2 100644 --- a/tests/ref17.txt +++ b/tests/ref17.txt @@ -489,8 +489,8 @@ mulsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 subsd(1 2 , 1 2 ) = 0 2 subsd(1 2 , 0 -2 ) = 1 2 subsd(1 2 , inf -inf ) = -inf 2 -subsd(1 2 , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 2 -subsd(0 -2 , 0x7ff8000000000000 -0 ) = 0xfff8000000000000 -2 +subsd(1 2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 2 +subsd(0 -2 , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -2 subsd(inf -inf , 0x7ff8000000000000 -0 ) = 0x7ff8000000000000 -inf subsd(1 2 , 2 1 ) = -1 2 subsd(1 2 , -2 0 ) = 3 2 @@ -532,8 +532,8 @@ maxsd(1 2 , 2 1 ) = 2 2 maxsd(1 2 , -2 0 ) = 1 2 maxsd(1 2 , -inf inf ) = 1 2 maxsd(1 2 , -0 0x7ff8000000000000 ) = 1 2 -maxsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 -maxsd(0 -2 , -0 0x7ff8000000000000 ) = 0 -2 +maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 +maxsd(0 -2 , -0 0x7ff8000000000000 ) = -0 -2 cvtps2pd(1 2 3 -4 ) = 0x1 0x2 0x3 0xfffffffc cvtps2pd(0 -2 -10 0.5 ) = 0x0 0xfffffffe 0xfffffff6 0x0 cvtps2pd(inf -inf -inf 1 ) = 0x80000000 0x80000000 0x80000000 0x1 diff --git a/tests/test17 b/tests/test17 index 4a28a47f..ebb01718 100755 --- a/tests/test17 +++ b/tests/test17 Binary files differdiff --git a/tests/test17.c b/tests/test17.c index 2c0e549d..632d13ce 100644 --- a/tests/test17.c +++ b/tests/test17.c @@ -1,5 +1,6 @@ -// build with gcc -O2 -g -msse -msse2 -mssse3 -msse4.1 test17.c -o test17 +// build with gcc -O0 -g -msse -msse2 -mssse3 -msse4.1 test17.c -o test17 // and -m32 for 32bits version +#include <inttypes.h> #include <string.h> #include <stdio.h> #include <stddef.h> @@ -141,7 +142,7 @@ void print_32(v128 v) { } void print_64(v128 v) { for(int i=0; i<2; ++i) - printf("0x%llx ", v.u64[i]); + printf("0x%"PRIx64" ", v.u64[i]); } #define print_128 print_64 void print_ps(v128 v) { @@ -154,7 +155,7 @@ void print_ps(v128 v) { void print_pd(v128 v) { for(int i=0; i<2; ++i) if(isnan(v.d64[i])) - printf("0x%llx ", v.u64[i]); + printf("0x%"PRIx64" ", v.u64[i]); else printf("%g ", v.d64[i]); } @@ -163,7 +164,7 @@ void print_pd(v128 v) { int main(int argc, const char** argv) { float a, b; - uint64_t flags; + uint32_t flags; uint32_t maxf = 0x7f7fffff; uint32_t minf = 0xff7fffff; uint32_t r; @@ -171,40 +172,40 @@ int main(int argc, const char** argv) #define GO1(A, N) \ a = 1.0f; b = 2.0f; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ flags = A(b, a); \ -printf(N " %f, %f => 0x%lx\n", b, a, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \ b = INFINITY; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ flags = A(b, a); \ -printf(N " %f, %f => 0x%lx\n", b, a, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \ b = -INFINITY; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ flags = A(b, a); \ -printf(N " %f, %f => 0x%lx\n", b, a, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \ b = NAN; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ flags = A(b, a); \ -printf(N " %f, %f => 0x%lx\n", b, a, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \ b = a; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ flags = A(b, a); \ -printf(N " %f, %f => 0x%lx\n", b, a, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \ a = b = INFINITY; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ a = -INFINITY; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); \ flags = A(b, a); \ -printf(N " %f, %f => 0x%lx\n", b, a, flags); \ +printf(N " %f, %f => 0x%"PRIx32"\n", b, a, flags); \ a = b = NAN; \ flags = A(a, b); \ -printf(N " %f, %f => 0x%lx\n", a, b, flags); +printf(N " %f, %f => 0x%"PRIx32"\n", a, b, flags); #define GO2(A, N) \ a = 1.0f; b = 2.0f; \ |