diff options
author | Christopher Celio <celio@eecs.berkeley.edu> | 2015-02-22 19:36:40 -0800 |
---|---|---|
committer | Christopher Celio <celio@eecs.berkeley.edu> | 2015-02-22 19:36:40 -0800 |
commit | 9007da4c2be61608429360c1906a0cf6442b0d68 (patch) | |
tree | f8a3a9cff20a5ceb030123be0033f07dc31b895f | |
parent | e0532426bcd8634041be23457ff78a90e78db466 (diff) | |
download | riscv-tests-9007da4c2be61608429360c1906a0cf6442b0d68.zip riscv-tests-9007da4c2be61608429360c1906a0cf6442b0d68.tar.gz riscv-tests-9007da4c2be61608429360c1906a0cf6442b0d68.tar.bz2 |
Added -NaN test for fcvt.{w/h}.s
-rw-r--r-- | isa/rv64uf/fcvt_w.S | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/isa/rv64uf/fcvt_w.S b/isa/rv64uf/fcvt_w.S index ffe344e..6d8b1ac 100644 --- a/isa/rv64uf/fcvt_w.S +++ b/isa/rv64uf/fcvt_w.S @@ -88,6 +88,18 @@ RVTEST_CODE_BEGIN TEST_FP_INT_OP_D(78, fcvt.lu.d, 0x10, -1, -3e9, rtz); TEST_FP_INT_OP_D(79, fcvt.lu.d, 0x00, 3000000000, 3e9, rtz); + # test negative NaN, negative infinity conversion + TEST_CASE(80, x1, 0xffffffff80000000, la x1, tdat; flw f1, 0(x1); fcvt.w.s x1, f1) + TEST_CASE(81, x1, 0x8000000000000000, la x1, tdat; flw f1, 0(x1); fcvt.l.s x1, f1) + TEST_CASE(82, x1, 0xffffffff80000000, la x1, tdat; flw f1, 8(x1); fcvt.w.s x1, f1) + TEST_CASE(83, x1, 0x8000000000000000, la x1, tdat; flw f1, 8(x1); fcvt.l.s x1, f1) + + # test positive NaN, positive infinity conversion + TEST_CASE(84, x1, 0x000000007fffffff, la x1, tdat; flw f1, 4(x1); fcvt.w.s x1, f1) + TEST_CASE(85, x1, 0x7fffffffffffffff, la x1, tdat; flw f1, 4(x1); fcvt.l.s x1, f1) + TEST_CASE(86, x1, 0x000000007fffffff, la x1, tdat; flw f1,12(x1); fcvt.w.s x1, f1) + TEST_CASE(87, x1, 0x7fffffffffffffff, la x1, tdat; flw f1,12(x1); fcvt.l.s x1, f1) + TEST_PASSFAIL RVTEST_CODE_END @@ -97,4 +109,11 @@ RVTEST_DATA_BEGIN TEST_DATA +# -NaN, NaN, -inf, +inf +tdat: +.word 0xffffffff +.word 0x7fffffff +.word 0xff800000 +.word 0x7f800000 + RVTEST_DATA_END |