From 41be3777b6f484f241248bc50d762c9da98ad0e9 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Fri, 29 Jan 2016 16:54:18 -0800 Subject: [PATCH] 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. --- isa/rv64uf/fcvt.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.30.2