aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2016-01-29 18:22:10 -0800
committerAndrew Waterman <waterman@eecs.berkeley.edu>2016-01-29 18:22:10 -0800
commitac467e16fd16fa3039cd89cb7a6d1f2032f4339f (patch)
treecd4ef0c6b5e127e3a0eb58307211220799a4c0f2
parentfc000796c11f84a5e1997c67fcfac751aa64a916 (diff)
parent41be3777b6f484f241248bc50d762c9da98ad0e9 (diff)
downloadriscv-tests-ac467e16fd16fa3039cd89cb7a6d1f2032f4339f.zip
riscv-tests-ac467e16fd16fa3039cd89cb7a6d1f2032f4339f.tar.gz
riscv-tests-ac467e16fd16fa3039cd89cb7a6d1f2032f4339f.tar.bz2
Merge pull request #7 from riscv/nan2
Two extra NaN test cases
-rw-r--r--isa/macros/scalar/test_macros.h8
-rw-r--r--isa/rv64uf/fcvt.S12
-rw-r--r--isa/rv64uf/fdiv.S3
3 files changed, 23 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)
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
diff --git a/isa/rv64uf/fdiv.S b/isa/rv64uf/fdiv.S
index b445663..4002e44 100644
--- a/isa/rv64uf/fdiv.S
+++ b/isa/rv64uf/fdiv.S
@@ -31,6 +31,9 @@ RVTEST_CODE_BEGIN
TEST_FP_OP1_D(13, fsqrt.d, 1, 1.7724538498928541, 3.14159265 );
TEST_FP_OP1_D(14, fsqrt.d, 0, 100, 10000 );
+ TEST_FP_OP1_S_DWORD_RESULT(15, fsqrt.s, 0x10, 0x7FC00000, -1.0 );
+ TEST_FP_OP1_D_DWORD_RESULT(16, fsqrt.d, 0x10, 0x7FF8000000000000, -1.0 );
+
TEST_PASSFAIL
RVTEST_CODE_END