From: Andrew Waterman Date: Wed, 16 Sep 2015 20:45:07 +0000 (-0700) Subject: Add test for FP recoding corner cases X-Git-Url: https://git.libre-soc.org/?p=riscv-tests.git;a=commitdiff_plain;h=017320312f1bc1adf22390f8692a1c4d2d06268f Add test for FP recoding corner cases --- diff --git a/isa/rv64uf/Makefrag b/isa/rv64uf/Makefrag index c29d4f4..d604a85 100644 --- a/isa/rv64uf/Makefrag +++ b/isa/rv64uf/Makefrag @@ -4,7 +4,7 @@ rv64uf_sc_tests = \ fadd fdiv fclass fcmp fcvt fcvt_w fmadd fmin fsgnj \ - ldst move structural \ + ldst move structural recoding \ rv64uf_sc_vec_tests = \ fadd fcmp fcvt fcvt_w fmadd fmin fsgnj \ diff --git a/isa/rv64uf/recoding.S b/isa/rv64uf/recoding.S new file mode 100644 index 0000000..dee7f6d --- /dev/null +++ b/isa/rv64uf/recoding.S @@ -0,0 +1,36 @@ +# See LICENSE for license details. + +#***************************************************************************** +# recoding.S +#----------------------------------------------------------------------------- +# +# Test corner cases of John Hauser's microarchitectural recoding scheme. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + # Infinity has a redundant internal form in Rocket. + # Make sure two different internal infinities compare as equal. + li TESTNUM, 8 + flw f0, minf, a0 + flw f1, three, a0 + fmul.s f1, f1, f0 + TEST_CASE( 8, a0, 1, feq.s a0, f0, f1) + TEST_CASE( 9, a0, 1, fle.s a0, f0, f1) + TEST_CASE(10, a0, 0, flt.s a0, f0, f1) + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + +minf: .float -Inf +three: .float 3.0 + +RVTEST_DATA_END