From: Palmer Dabbelt Date: Sat, 30 Jan 2016 00:54:18 +0000 (-0800) Subject: Test that fcvt canonicalizes NaNs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41be3777b6f484f241248bc50d762c9da98ad0e9;p=riscv-tests.git 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. --- 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