initial commit
[riscv-tests.git] / isa / rv64uf / fcvt_w.S
1 #*****************************************************************************
2 # fcvt_w.S
3 #-----------------------------------------------------------------------------
4 #
5 # Test fcvt{wu|w|lu|l}.{s|d} 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_FP_INT_OP_S( 2, fcvt.w.s, -1, -1.1, rtz);
19 TEST_FP_INT_OP_S( 3, fcvt.w.s, -1, -1.0, rtz);
20 TEST_FP_INT_OP_S( 4, fcvt.w.s, 0, -0.9, rtz);
21 TEST_FP_INT_OP_S( 5, fcvt.w.s, 0, 0.9, rtz);
22 TEST_FP_INT_OP_S( 6, fcvt.w.s, 1, 1.0, rtz);
23 TEST_FP_INT_OP_S( 7, fcvt.w.s, 1, 1.1, rtz);
24
25 TEST_FP_INT_OP_S(12, fcvt.wu.s, -1, -3.0, rtz); # invalid
26 TEST_FP_INT_OP_S(13, fcvt.wu.s, -1, -1.0, rtz); # invalid
27 TEST_FP_INT_OP_S(14, fcvt.wu.s, 0, -0.9, rtz);
28 TEST_FP_INT_OP_S(15, fcvt.wu.s, 0, 0.9, rtz);
29 TEST_FP_INT_OP_S(16, fcvt.wu.s, 1, 1.0, rtz);
30 TEST_FP_INT_OP_S(17, fcvt.wu.s, 1, 1.1, rtz);
31
32 TEST_FP_INT_OP_S(22, fcvt.l.s, -1, -1.1, rtz);
33 TEST_FP_INT_OP_S(23, fcvt.l.s, -1, -1.0, rtz);
34 TEST_FP_INT_OP_S(24, fcvt.l.s, 0, -0.9, rtz);
35 TEST_FP_INT_OP_S(25, fcvt.l.s, 0, 0.9, rtz);
36 TEST_FP_INT_OP_S(26, fcvt.l.s, 1, 1.0, rtz);
37 TEST_FP_INT_OP_S(27, fcvt.l.s, 1, 1.1, rtz);
38
39 TEST_FP_INT_OP_S(32, fcvt.lu.s, -1, -3.0, rtz); # invalid
40 TEST_FP_INT_OP_S(33, fcvt.lu.s, -1, -1.0, rtz); # invalid
41 TEST_FP_INT_OP_S(34, fcvt.lu.s, 0, -0.9, rtz);
42 TEST_FP_INT_OP_S(35, fcvt.lu.s, 0, 0.9, rtz);
43 TEST_FP_INT_OP_S(36, fcvt.lu.s, 1, 1.0, rtz);
44 TEST_FP_INT_OP_S(37, fcvt.lu.s, 1, 1.1, rtz);
45
46 TEST_FP_INT_OP_D(42, fcvt.w.d, -1, -1.1, rtz);
47 TEST_FP_INT_OP_D(43, fcvt.w.d, -1, -1.0, rtz);
48 TEST_FP_INT_OP_D(44, fcvt.w.d, 0, -0.9, rtz);
49 TEST_FP_INT_OP_D(45, fcvt.w.d, 0, 0.9, rtz);
50 TEST_FP_INT_OP_D(46, fcvt.w.d, 1, 1.0, rtz);
51 TEST_FP_INT_OP_D(47, fcvt.w.d, 1, 1.1, rtz);
52
53 TEST_FP_INT_OP_D(52, fcvt.wu.d, -1, -3.0, rtz); # invalid
54 TEST_FP_INT_OP_D(53, fcvt.wu.d, -1, -1.0, rtz); # invalid
55 TEST_FP_INT_OP_D(54, fcvt.wu.d, 0, -0.9, rtz);
56 TEST_FP_INT_OP_D(55, fcvt.wu.d, 0, 0.9, rtz);
57 TEST_FP_INT_OP_D(56, fcvt.wu.d, 1, 1.0, rtz);
58 TEST_FP_INT_OP_D(57, fcvt.wu.d, 1, 1.1, rtz);
59
60 TEST_FP_INT_OP_D(62, fcvt.l.d, -1, -1.1, rtz);
61 TEST_FP_INT_OP_D(63, fcvt.l.d, -1, -1.0, rtz);
62 TEST_FP_INT_OP_D(64, fcvt.l.d, 0, -0.9, rtz);
63 TEST_FP_INT_OP_D(65, fcvt.l.d, 0, 0.9, rtz);
64 TEST_FP_INT_OP_D(66, fcvt.l.d, 1, 1.0, rtz);
65 TEST_FP_INT_OP_D(67, fcvt.l.d, 1, 1.1, rtz);
66
67 TEST_FP_INT_OP_D(72, fcvt.lu.d, -1, -3.0, rtz); # invalid
68 TEST_FP_INT_OP_D(73, fcvt.lu.d, -1, -1.0, rtz); # invalid
69 TEST_FP_INT_OP_D(74, fcvt.lu.d, 0, -0.9, rtz);
70 TEST_FP_INT_OP_D(75, fcvt.lu.d, 0, 0.9, rtz);
71 TEST_FP_INT_OP_D(76, fcvt.lu.d, 1, 1.0, rtz);
72 TEST_FP_INT_OP_D(77, fcvt.lu.d, 1, 1.1, rtz);
73
74 TEST_PASSFAIL
75
76 RVTEST_CODE_END
77
78 .data
79 RVTEST_DATA_BEGIN
80
81 TEST_DATA
82
83 RVTEST_DATA_END