1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
4 RVTEST_RV64U # Define TVM used by program.
6 # SV test: vector-vector add
8 # sets up x3 and x4 with data, sets VL to 2, and carries out
9 # an "add 1 to x3". which actually means "add 1 to x3 *AND* add 1 to x4"
12 RVTEST_CODE_BEGIN # Start of test code.
14 SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0,
15 3, SV_W_DFLT, SV_W_DFLT, SV_W_DFLT, 1, 1, 1,
16 0x21, 0x82, 0x0000000000000000)
17 SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0,
18 3, SV_W_DFLT, SV_W_DFLT, SV_W_32BIT, 1, 1, 1,
19 0x0000008200000021, 0xa5a5a5a500000000, 0xa5a5a5a5a5a5a5a5)
20 SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0,
21 3, SV_W_8BIT, SV_W_8BIT, SV_W_DFLT, 1, 1, 1,
23 SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0,
24 3, SV_W_8BIT, SV_W_8BIT, SV_W_32BIT, 1, 1, 1,
25 0x0000001100000009, 0xa5a5a5a500000019, 0xa5a5a5a5a5a5a5a5)
26 SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0,
27 3, SV_W_8BIT, SV_W_8BIT, SV_W_16BIT, 1, 1, 1,
28 0xa5a5001900110009, 0xa5a5a5a5a5a5a5a5, 0xa5a5a5a5a5a5a5a5)
29 SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0,
30 3, SV_W_8BIT, SV_W_8BIT, SV_W_8BIT, 1, 1, 1,
31 0xa5a5a5a5a5191109, 0xa5a5a5a5a5a5a5a5, 0xa5a5a5a5a5a5a5a5)
33 RVTEST_PASS # Signal success.
36 RVTEST_CODE_END # End of test code.
39 # This section is optional, and this data is NOT saved in the output.
43 .dword 0x0000005949398979
44 .dword 0x0000005747372717
45 .dword 0x0000000000000000
46 .dword 0x0000005242322212
47 .dword 0x0000005141312111
48 .dword 0x0000000000000000
50 # Output data section.
51 RVTEST_DATA_BEGIN # Start of test output data region.
57 RVTEST_DATA_END # End of test output data region.