aboutsummaryrefslogtreecommitdiff
path: root/isa/macros
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2016-01-29 11:33:40 -0800
committerPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2016-01-29 11:33:40 -0800
commit210c0e6e363026e0de03e7f7bc61612b9cd44533 (patch)
tree99d56564c284d95a3a096967a371f9149e98006a /isa/macros
parentfc000796c11f84a5e1997c67fcfac751aa64a916 (diff)
downloadriscv-tests-210c0e6e363026e0de03e7f7bc61612b9cd44533.zip
riscv-tests-210c0e6e363026e0de03e7f7bc61612b9cd44533.tar.gz
riscv-tests-210c0e6e363026e0de03e7f7bc61612b9cd44533.tar.bz2
Check NAN values in fdiv tests
The new RISC-V ISA spec mandates NAN bit patterns. This test checks to make sure that those bit patterns come out of fsqrt(-1). These pass on both spike and Rocket. An additional _DWORD_RESULT version of the FP test macros is added to facilitate floating-point tests that compare against particular bit patterns.
Diffstat (limited to 'isa/macros')
-rw-r--r--isa/macros/scalar/test_macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/isa/macros/scalar/test_macros.h b/isa/macros/scalar/test_macros.h
index 05ed7c8..4b1e1f5 100644
--- a/isa/macros/scalar/test_macros.h
+++ b/isa/macros/scalar/test_macros.h
@@ -500,6 +500,14 @@ test_ ## testnum: \
TEST_FP_OP_D_INTERNAL( testnum, flags, double result, val1, 0.0, 0.0, \
inst f3, f0; fmv.x.d a0, f3)
+#define TEST_FP_OP1_S_DWORD_RESULT( testnum, inst, flags, result, val1 ) \
+ TEST_FP_OP_S_INTERNAL( testnum, flags, dword result, val1, 0.0, 0.0, \
+ inst f3, f0; fmv.x.s a0, f3)
+
+#define TEST_FP_OP1_D_DWORD_RESULT( testnum, inst, flags, result, val1 ) \
+ TEST_FP_OP_D_INTERNAL( testnum, flags, dword result, val1, 0.0, 0.0, \
+ inst f3, f0; fmv.x.d a0, f3)
+
#define TEST_FP_OP2_S( testnum, inst, flags, result, val1, val2 ) \
TEST_FP_OP_S_INTERNAL( testnum, flags, float result, val1, val2, 0.0, \
inst f3, f0, f1; fmv.x.s a0, f3)