Make JALR test sensible in RISC-V, rather than SMIPS
[riscv-tests.git] / isa / rv64uf / fcvt.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # fcvt.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test fcvt.{s|d}.{wu|w|lu|l}, fcvt.s.d, and fcvt.d.s instructions.
8 #
9
10 #include "riscv_test.h"
11 #include "test_macros.h"
12
13 RVTEST_RV64UF
14 RVTEST_CODE_BEGIN
15
16 #-------------------------------------------------------------
17 # Arithmetic tests
18 #-------------------------------------------------------------
19
20 TEST_INT_FP_OP_S( 2, fcvt.s.w, 2.0, 2);
21 TEST_INT_FP_OP_S( 3, fcvt.s.w, -2.0, -2);
22
23 TEST_INT_FP_OP_S( 4, fcvt.s.wu, 2.0, 2);
24 TEST_INT_FP_OP_S( 5, fcvt.s.wu, 4.2949673e9, -2);
25
26 TEST_INT_FP_OP_S( 6, fcvt.s.l, 2.0, 2);
27 TEST_INT_FP_OP_S( 7, fcvt.s.l, -2.0, -2);
28
29 TEST_INT_FP_OP_S( 8, fcvt.s.lu, 2.0, 2);
30 TEST_INT_FP_OP_S( 9, fcvt.s.lu, 1.8446744e19, -2);
31
32 TEST_INT_FP_OP_D(12, fcvt.d.w, 2.0, 2);
33 TEST_INT_FP_OP_D(13, fcvt.d.w, -2.0, -2);
34
35 TEST_INT_FP_OP_D(14, fcvt.d.wu, 2.0, 2);
36 TEST_INT_FP_OP_D(15, fcvt.d.wu, 4294967294, -2);
37
38 TEST_INT_FP_OP_D(16, fcvt.d.l, 2.0, 2);
39 TEST_INT_FP_OP_D(17, fcvt.d.l, -2.0, -2);
40
41 TEST_INT_FP_OP_D(18, fcvt.d.lu, 2.0, 2);
42 TEST_INT_FP_OP_D(19, fcvt.d.lu, 1.8446744073709552e19, -2);
43
44 TEST_FCVT_S_D(20, -1.5, -1.5)
45 TEST_FCVT_D_S(21, -1.5, -1.5)
46
47 TEST_CASE(22, a0, 0x7ff8000000000000,
48 la a1, test_data_22;
49 ld a2, 0(a1);
50 fmv.d.x f2, a2;
51 fcvt.s.d f2, f2;
52 fcvt.d.s f2, f2;
53 fmv.x.d a0, f2;
54 )
55
56 TEST_PASSFAIL
57
58 RVTEST_CODE_END
59
60 .data
61 RVTEST_DATA_BEGIN
62
63 TEST_DATA
64
65 test_data_22:
66 .dword 0x7ffcffffffff8004
67
68 RVTEST_DATA_END