1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
6 #define SV_ELWIDTH_TEST( vl, wid1, wid2, wid3, testdata, answer ) \
8 SV_FLW_DATA( f4, ( testdata + 0) , 0) ; \
9 SV_FLW_DATA( f5, ( testdata + 4), 0) ; \
10 SV_FLW_DATA( f6, ( testdata + 8), 0) ; \
11 SV_FLW_DATA( f7, ( testdata + 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, answer+0, 0) ; \
26 TEST_SV_FW(0, f3, answer+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 0xffff5140 # 42.0 fp16
55 .word 0xffff5180 # 44.0 fp16
59 .word 0xffff5120 # 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.