alter unit tests to match change in CSR table format
[riscv-tests.git] / isa / rv64uc / sv_c_swsp.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # rvc.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test RVC corner cases.
8 #
9
10 #include "riscv_test.h"
11 #include "sv_test_macros.h"
12
13 RVTEST_RV64U
14 RVTEST_CODE_BEGIN
15
16 .align 2
17 .option push
18 .option norvc
19
20 li a2, 1000;
21 li a3, 1001;
22 li a4, 1004;
23
24 SET_SV_MVL(3)
25 SET_SV_2CSRS( SV_REG_CSR(1, 12, 0, 12, 1),
26 SV_REG_CSR(1, 2, 0, 2, 1) )
27 SET_SV_VL(3)
28
29 mv a1, sp
30 la sp, data;
31
32 .option push;
33 .option rvc;
34 .align 2;
35 c.swsp a2, 0(sp);
36 #lw a2, 0(sp);
37 .option pop
38
39
40 SET_SV_VL(0)
41 CLR_SV_CSRS()
42 SET_SV_MVL(0)
43
44 mv sp, a1
45
46 la a2, data;
47 lw a4, 0(a2);
48 lw a5, 4(a2);
49 lw a6, 8(a2);
50
51 TEST_SV_IMM(a4, 1000)
52 TEST_SV_IMM(a5, 1001)
53 TEST_SV_IMM(a6, 1004)
54
55 .option pop
56
57 RVTEST_PASS # Signal success.
58 fail:
59 RVTEST_FAIL
60
61 RVTEST_CODE_END # End of test code.
62
63 .data
64 data:
65 .word 0;
66 .word 0;
67 .word 0;
68
69 RVTEST_DATA_BEGIN
70
71 RVTEST_DATA_END