diff options
Diffstat (limited to 'isa/rv64uf')
-rw-r--r-- | isa/rv64uf/Makefrag | 2 | ||||
-rw-r--r-- | isa/rv64uf/fsgnj.S | 44 | ||||
-rw-r--r-- | isa/rv64uf/move.S | 45 |
3 files changed, 33 insertions, 58 deletions
diff --git a/isa/rv64uf/Makefrag b/isa/rv64uf/Makefrag index d3c3f23..33c11db 100644 --- a/isa/rv64uf/Makefrag +++ b/isa/rv64uf/Makefrag @@ -3,7 +3,7 @@ #----------------------------------------------------------------------- rv64uf_sc_tests = \ - fadd fdiv fclass fcmp fcvt fcvt_w fmadd fmin fsgnj \ + fadd fdiv fclass fcmp fcvt fcvt_w fmadd fmin \ ldst move recoding \ rv64uf_p_tests = $(addprefix rv64uf-p-, $(rv64uf_sc_tests)) diff --git a/isa/rv64uf/fsgnj.S b/isa/rv64uf/fsgnj.S deleted file mode 100644 index 6d4bdb4..0000000 --- a/isa/rv64uf/fsgnj.S +++ /dev/null @@ -1,44 +0,0 @@ -# See LICENSE for license details. - -#***************************************************************************** -# fsgnj.S -#----------------------------------------------------------------------------- -# -# Test fsgn{j|jn|x}.s instructions. -# - -#include "riscv_test.h" -#include "test_macros.h" - -RVTEST_RV64UF -RVTEST_CODE_BEGIN - - #------------------------------------------------------------- - # Arithmetic tests - #------------------------------------------------------------- - - TEST_FP_OP2_S( 2, fsgnj.s, 0, -6.3, 6.3, -1.0 ); - TEST_FP_OP2_S( 3, fsgnj.s, 0, 7.3, 7.3, 2.0 ); - TEST_FP_OP2_S( 4, fsgnj.s, 0, -8.3, -8.3, -3.0 ); - TEST_FP_OP2_S( 5, fsgnj.s, 0, 9.3, -9.3, 4.0 ); - - TEST_FP_OP2_S(12, fsgnjn.s, 0, 6.3, 6.3, -1.0 ); - TEST_FP_OP2_S(13, fsgnjn.s, 0, -7.3, 7.3, 2.0 ); - TEST_FP_OP2_S(14, fsgnjn.s, 0, 8.3, -8.3, -3.0 ); - TEST_FP_OP2_S(15, fsgnjn.s, 0, -9.3, -9.3, 4.0 ); - - TEST_FP_OP2_S(22, fsgnjx.s, 0, -6.3, 6.3, -1.0 ); - TEST_FP_OP2_S(23, fsgnjx.s, 0, 7.3, 7.3, 2.0 ); - TEST_FP_OP2_S(24, fsgnjx.s, 0, 8.3, -8.3, -3.0 ); - TEST_FP_OP2_S(25, fsgnjx.s, 0, -9.3, -9.3, 4.0 ); - - TEST_PASSFAIL - -RVTEST_CODE_END - - .data -RVTEST_DATA_BEGIN - - TEST_DATA - -RVTEST_DATA_END diff --git a/isa/rv64uf/move.S b/isa/rv64uf/move.S index a94af55..60f7cf3 100644 --- a/isa/rv64uf/move.S +++ b/isa/rv64uf/move.S @@ -4,8 +4,8 @@ # move.S #----------------------------------------------------------------------------- # -# This test verifies that mxtf.[s,d], mftx.[s,d], fssr, frsr, -# and fsgnj[x|n].s work properly. +# This test verifies that the fmv.s.x, fmv.x.s, and fsgnj[x|n].d instructions +# and the fcsr work properly. # #include "riscv_test.h" @@ -14,18 +14,37 @@ RVTEST_RV64UF RVTEST_CODE_BEGIN -li a0, 1 -fssr a0 - - TEST_CASE(2, a1, 1, li a0, 0x1234; fssr a1, a0) + TEST_CASE(2, a1, 1, csrwi fcsr, 1; li a0, 0x1234; fssr a1, a0) TEST_CASE(3, a0, 0x34, frsr a0) - TEST_CASE(4, a0, 0x34, frsr a0) - - TEST_CASE(5, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; fmv.s.x f0, a1; fmv.x.s a0, f0) - - TEST_CASE(6, a0, 0xFFFFFFFFBF812345, li a1, 0xFFFFFFFFBF812345; fmv.s.x f0, a1; fsgnj.s f1, f0, f0; fmv.x.s a0, f1) - TEST_CASE(7, a0, 0x000000004BA98765, li a1, 0xFFFFFFFFCBA98765; fmv.s.x f0, a1; fsgnjx.s f1, f0, f0; fmv.x.s a0, f1) - TEST_CASE(8, a0, 0x000000005EADBEEF, li a1, 0xFFFFFFFFDEADBEEF; fmv.s.x f0, a1; fsgnjn.s f1, f0, f0; fmv.x.s a0, f1) + TEST_CASE(4, a0, 0x14, frflags a0) + TEST_CASE(5, a0, 0x01, csrrwi a0, frm, 2) + TEST_CASE(6, a0, 0x54, frsr a0) + TEST_CASE(7, a0, 0x14, csrrci a0, fflags, 4) + TEST_CASE(8, a0, 0x50, frsr a0) + +#define TEST_FSGNJS(n, insn, new_sign, rs1_sign, rs2_sign) \ + TEST_CASE(n, a0, 0x12345678 | (-(new_sign) << 31), \ + li a1, ((rs1_sign) << 31) | 0x12345678; \ + li a2, -(rs2_sign); \ + fmv.s.x f1, a1; \ + fmv.s.x f2, a2; \ + insn f0, f1, f2; \ + fmv.x.s a0, f0) + + TEST_FSGNJS(10, fsgnj.s, 0, 0, 0) + TEST_FSGNJS(11, fsgnj.s, 1, 0, 1) + TEST_FSGNJS(12, fsgnj.s, 0, 1, 0) + TEST_FSGNJS(13, fsgnj.s, 1, 1, 1) + + TEST_FSGNJS(20, fsgnjn.s, 1, 0, 0) + TEST_FSGNJS(21, fsgnjn.s, 0, 0, 1) + TEST_FSGNJS(22, fsgnjn.s, 1, 1, 0) + TEST_FSGNJS(23, fsgnjn.s, 0, 1, 1) + + TEST_FSGNJS(30, fsgnjx.s, 0, 0, 0) + TEST_FSGNJS(31, fsgnjx.s, 1, 0, 1) + TEST_FSGNJS(32, fsgnjx.s, 1, 1, 0) + TEST_FSGNJS(33, fsgnjx.s, 0, 1, 1) TEST_PASSFAIL |