From 9007da4c2be61608429360c1906a0cf6442b0d68 Mon Sep 17 00:00:00 2001 From: Christopher Celio Date: Sun, 22 Feb 2015 19:36:40 -0800 Subject: [PATCH] Added -NaN test for fcvt.{w/h}.s --- isa/rv64uf/fcvt_w.S | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- 2.30.2