1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
4 RVTEST_RV64U # Define TVM used by program.
7 # SV test: scalar-to-vector add
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"
16 RVTEST_CODE_BEGIN # Start of test code.
18 SV_LD_DATA( x2, testdata , 0) # not expecting this to be modified
19 SV_LD_DATA( x5, testdata+24, 0) # not expecting this to be modified
21 li x6, 41 # going to be stored in x3 *and* x4 (plus one, on each)
24 SET_SV_CSR(1, 3, 0, 3, 1)
27 addi x3, x6, 1 # x3 = x6+1 *AND* x4 = x6+1
33 TEST_SV_IMM(x2, 1001) # should not be modified
36 TEST_SV_IMM(x5, 1002) # should not be modified
38 RVTEST_PASS # Signal success.
41 RVTEST_CODE_END # End of test code.
44 # This section is optional, and this data is NOT saved in the output.
53 # Output data section.
54 RVTEST_DATA_BEGIN # Start of test output data region.
60 RVTEST_DATA_END # End of test output data region.