1 #*****************************************************************************
3 #-----------------------------------------------------------------------------
5 # Test fcvt{wu|w|lu|l}.{s|d} instructions.
8 #include "riscv_test.h"
9 #include "test_macros.h"
14 #-------------------------------------------------------------
16 #-------------------------------------------------------------
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);
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);
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);
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);
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);
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);
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);
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);