diff options
author | Palmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu> | 2016-01-29 16:54:18 -0800 |
---|---|---|
committer | Palmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu> | 2016-01-29 17:51:24 -0800 |
commit | 41be3777b6f484f241248bc50d762c9da98ad0e9 (patch) | |
tree | cd4ef0c6b5e127e3a0eb58307211220799a4c0f2 /isa | |
parent | 210c0e6e363026e0de03e7f7bc61612b9cd44533 (diff) | |
download | riscv-tests-41be3777b6f484f241248bc50d762c9da98ad0e9.zip riscv-tests-41be3777b6f484f241248bc50d762c9da98ad0e9.tar.gz riscv-tests-41be3777b6f484f241248bc50d762c9da98ad0e9.tar.bz2 |
Test that fcvt canonicalizes NaNs
I believe this is entirely within the RISC-V ISA spec:
* fmv is defined to move IEEE floats
* All otherwise-unspeficied floating-point operations canonicalize NaNs
This test fails on Spike, but passes on Rocket. I believe this is the source
of my current torture failures.
Diffstat (limited to 'isa')
-rw-r--r-- | isa/rv64uf/fcvt.S | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/isa/rv64uf/fcvt.S b/isa/rv64uf/fcvt.S index bc0f75c..cbaf6d3 100644 --- a/isa/rv64uf/fcvt.S +++ b/isa/rv64uf/fcvt.S @@ -44,6 +44,15 @@ RVTEST_CODE_BEGIN TEST_FCVT_S_D(20, -1.5, -1.5) TEST_FCVT_D_S(21, -1.5, -1.5) + TEST_CASE(22, a0, 0x7ff8000000000000, + la a1, test_data_22; + ld a2, 0(a1); + fmv.d.x f2, a2; + fcvt.s.d f2, f2; + fcvt.d.s f2, f2; + fmv.x.d a0, f2; + ) + TEST_PASSFAIL RVTEST_CODE_END @@ -53,4 +62,7 @@ RVTEST_DATA_BEGIN TEST_DATA +test_data_22: + .dword 0x7ffcffffffff8004 + RVTEST_DATA_END |