update sv test comments
[riscv-tests.git] / isa / rv64ui / sv_addi_scalar_src.S
1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
3
4 RVTEST_RV64U # Define TVM used by program.
5
6
7 # SV test: scalar-to-vector add
8 #
9 # sets up x6 data as a scalar, sets VL to 2, and carries out
10 # an "add 1 to x6 and store in x3".
11 # which actually means:
12 # "add add 1 to x6 and store in x3" *AND*
13 # "add add 1 to x6 and store in x4"
14
15 # Test code region.
16 RVTEST_CODE_BEGIN # Start of test code.
17
18 SV_LD_DATA( x2, testdata , 0)
19 SV_LD_DATA( x5, testdata+24, 0)
20
21 li x6, 41
22
23 SET_SV_MVL(2)
24 SET_SV_CSR(1, 3, 0, 3, 1, 0)
25 SET_SV_VL(2)
26
27 addi x3, x6, 1
28
29 CLR_SV_CSRS()
30 SET_SV_VL(0)
31 SET_SV_MVL(0)
32
33 TEST_SV_IMM(x2, 1001) # should not be modified
34 TEST_SV_IMM(x3, 42)
35 TEST_SV_IMM(x4, 42)
36 TEST_SV_IMM(x5, 1002) # should not be modified
37
38 RVTEST_PASS # Signal success.
39 fail:
40 RVTEST_FAIL
41 RVTEST_CODE_END # End of test code.
42
43 # Input data section.
44 # This section is optional, and this data is NOT saved in the output.
45 .data
46 .align 3
47 testdata:
48 .dword 1001
49 .dword 49
50 .dword 49
51 .dword 1002
52
53 # Output data section.
54 RVTEST_DATA_BEGIN # Start of test output data region.
55 .align 3
56 result:
57 .dword -1
58 .dword -1
59 .dword -1
60 RVTEST_DATA_END # End of test output data region.
61