1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
6 #define SV_ELWIDTH_TEST( vl, wid1, wid2, wid3, tdata, ans ) \
8 SV_FLW_DATA( f4, ( tdata + 0) , 0) ; \
9 SV_FLW_DATA( f5, ( tdata + 4), 0) ; \
10 SV_FLW_DATA( f6, ( tdata + 8), 0) ; \
11 SV_FLW_DATA( f7, ( tdata + 12), 0) ; \
14 SET_SV_3CSRS( SV_REG_CSR(0, 2, wid1, 2, 1), \
15 SV_REG_CSR(0, 4, wid2, 4, 1), \
16 SV_REG_CSR(0, 6, wid3, 6, 1) ) ; \
25 TEST_SV_FW(0, f2, ans+0, 0) ; \
26 TEST_SV_FW(0, f3, ans+4, 0)
28 # SV test: vector-vector fadd
30 # sets up x3 and x4 with data, sets VL to 2, and carries out
31 # an "add 1 to x3". which actually means "add 1 to x3 *AND* add 1 to x4"
34 RVTEST_CODE_BEGIN # Start of test code.
36 SV_ELWIDTH_TEST( 2, 2, 0, 0, testdata, answer );
37 SV_ELWIDTH_TEST( 2, 2, 2, 0, testdata2, answer2 );
39 RVTEST_PASS # Signal success.
42 RVTEST_CODE_END # End of test code.
45 # This section is optional, and this data is NOT saved in the output.
54 .word 0x51805140 # 44 fp16 42 fp16, tested as-is, even if it goes to fp
55 .word 0x0 # before going to int for comparison (TEST_SV_FW)
59 .word 0x51405120 # 42 fp16 41 fp16
60 .word 0xffff5140 # 42 fp16
66 # Output data section.
67 RVTEST_DATA_BEGIN # Start of test output data region.
73 RVTEST_DATA_END # End of test output data region.