initial commit
[riscv-tests.git] / isa / rv64uf / fcvt.S
1 #*****************************************************************************
2 # fcvt.S
3 #-----------------------------------------------------------------------------
4 #
5 # Test fcvt.{s|d}.{wu|w|lu|l}, fcvt.s.d, and fcvt.d.s instructions.
6 #
7
8 #include "riscv_test.h"
9 #include "test_macros.h"
10
11 RVTEST_RV64U
12 RVTEST_CODE_BEGIN
13
14 #-------------------------------------------------------------
15 # Arithmetic tests
16 #-------------------------------------------------------------
17
18 TEST_INT_FP_OP_S( 2, fcvt.s.w, 2.0, 2);
19 TEST_INT_FP_OP_S( 3, fcvt.s.w, -2.0, -2);
20
21 TEST_INT_FP_OP_S( 4, fcvt.s.wu, 2.0, 2);
22 TEST_INT_FP_OP_S( 5, fcvt.s.wu, 4.2949673e9, -2);
23
24 TEST_INT_FP_OP_S( 6, fcvt.s.l, 2.0, 2);
25 TEST_INT_FP_OP_S( 7, fcvt.s.l, -2.0, -2);
26
27 TEST_INT_FP_OP_S( 8, fcvt.s.lu, 2.0, 2);
28 TEST_INT_FP_OP_S( 9, fcvt.s.lu, 1.8446744e19, -2);
29
30 TEST_INT_FP_OP_D(12, fcvt.d.w, 2.0, 2);
31 TEST_INT_FP_OP_D(13, fcvt.d.w, -2.0, -2);
32
33 TEST_INT_FP_OP_D(14, fcvt.d.wu, 2.0, 2);
34 TEST_INT_FP_OP_D(15, fcvt.d.wu, 4294967294, -2);
35
36 TEST_INT_FP_OP_D(16, fcvt.d.l, 2.0, 2);
37 TEST_INT_FP_OP_D(17, fcvt.d.l, -2.0, -2);
38
39 TEST_INT_FP_OP_D(18, fcvt.d.lu, 2.0, 2);
40 TEST_INT_FP_OP_D(19, fcvt.d.lu, 1.8446744073709552e19, -2);
41
42 TEST_FCVT_S_D(20, -1.5, -1.5)
43 TEST_FCVT_D_S(21, -1.5, -1.5)
44
45 TEST_PASSFAIL
46
47 RVTEST_CODE_END
48
49 .data
50 RVTEST_DATA_BEGIN
51
52 TEST_DATA
53
54 RVTEST_DATA_END