augment sv_addi test using macros
[riscv-tests.git] / isa / rv64ui / sv_addi.S
1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
3
4 RVTEST_RV64U # Define TVM used by program.
5
6
7
8 # Test code region.
9 RVTEST_CODE_BEGIN # Start of test code.
10
11 SV_LD_DATA( x2, testdata , 0)
12 SV_LD_DATA( x3, testdata+8 , 0)
13 SV_LD_DATA( x4, testdata+16, 0)
14 SV_LD_DATA( x5, testdata+24, 0)
15
16 SET_SV_MVL(2)
17 SET_SV_CSR(1, 3, 0, 3, 1, 0)
18 SET_SV_VL(2)
19
20 addi x3, x3, 1
21
22 CLR_SV_CSRS()
23 SET_SV_VL(0)
24 SET_SV_MVL(0)
25
26 TEST_SV_IMM(x2, 1001) # should not be modified
27 TEST_SV_IMM(x3, 42)
28 TEST_SV_IMM(x4, 43)
29 TEST_SV_IMM(x5, 1002) # should not be modified
30
31 RVTEST_PASS # Signal success.
32 fail:
33 RVTEST_FAIL
34 RVTEST_CODE_END # End of test code.
35
36 # Input data section.
37 # This section is optional, and this data is NOT saved in the output.
38 .data
39 .align 3
40 testdata:
41 .dword 1001
42 .dword 41
43 .dword 42
44 .dword 1002
45
46 # Output data section.
47 RVTEST_DATA_BEGIN # Start of test output data region.
48 .align 3
49 result:
50 .dword -1
51 .dword -1
52 .dword -1
53 RVTEST_DATA_END # End of test output data region.
54