From: Luke Kenneth Casson Leighton Date: Sun, 7 Oct 2018 05:51:29 +0000 (+0100) Subject: add predicated version of c.lwsp sv unit test X-Git-Url: https://git.libre-soc.org/?p=riscv-tests.git;a=commitdiff_plain;h=3a6d289d27fd9c60af1f0aa206fc80d756a1c986 add predicated version of c.lwsp sv unit test --- diff --git a/isa/rv64uc/Makefrag.sv b/isa/rv64uc/Makefrag.sv index a50ab21..52571ae 100644 --- a/isa/rv64uc/Makefrag.sv +++ b/isa/rv64uc/Makefrag.sv @@ -6,6 +6,7 @@ rv64uc_sv_tests = \ sv_c_mv \ sv_c_mv_predication \ sv_c_lwsp \ + sv_c_lwsp_predication \ sv_c_swsp \ rv64uc_p_tests = $(addprefix rv64uc-p-, $(rv64uc_sv_tests)) diff --git a/isa/rv64uc/sv_c_lwsp_predication.S b/isa/rv64uc/sv_c_lwsp_predication.S new file mode 100644 index 0000000..69afdc5 --- /dev/null +++ b/isa/rv64uc/sv_c_lwsp_predication.S @@ -0,0 +1,74 @@ +# See LICENSE for license details. + +#***************************************************************************** +# rvc.S +#----------------------------------------------------------------------------- +# +# Test RVC corner cases. +# + +#include "riscv_test.h" +#include "sv_test_macros.h" + +RVTEST_RV64U +RVTEST_CODE_BEGIN + + .align 2 + .option push + .option norvc + + li a2, 0 + li a3, 0 + li a4, 0 + li a0, 0x6; // targetted by use of sp: means skip, copy, copy + li a1, 0x5; // targetted by use of a2: meanss a2, x, a4 + + + mv a6, sp + la sp, data; + + SET_SV_MVL(3) + SET_SV_2CSRS( SV_REG_CSR(1, 12, 0, 12, 1, 0), + SV_REG_CSR(1, 2, 0, 2, 1, 0) ) + SET_SV_2PREDCSRS( + SV_PRED_CSR(1, 2, 0, 0, 10, 1), + SV_PRED_CSR(1, 12, 0, 0, 11, 1) ); + + + SET_SV_VL(3) + + .option push; + .option rvc; + .align 2; + c.lwsp a2, 0(sp); # actually lw a2, 4(sp); lw a4 8(sp) due to twin-predication + #lw a2, 0(sp); + .option pop + + + SET_SV_VL(0) + CLR_SV_CSRS() + SET_SV_MVL(0) + + mv sp, a6 + + TEST_SV_IMM(a2, 1002) + TEST_SV_IMM(a3, 0) + TEST_SV_IMM(a4, 1005) + + .option pop + + RVTEST_PASS # Signal success. +fail: + RVTEST_FAIL + +RVTEST_CODE_END # End of test code. + + .data +data: + .word 1001; + .word 1002; + .word 1005; + +RVTEST_DATA_BEGIN + +RVTEST_DATA_END