Check FP corner cases and flags
[riscv-tests.git] / isa / rv64uf / fsgnj.S
1 #*****************************************************************************
2 # fsgnj.S
3 #-----------------------------------------------------------------------------
4 #
5 # Test fsgn{j|jn|x}.{s|d} instructions.
6 #
7
8 #include "riscv_test.h"
9 #include "test_macros.h"
10
11 RVTEST_RV64UF
12 RVTEST_CODE_BEGIN
13
14 #-------------------------------------------------------------
15 # Arithmetic tests
16 #-------------------------------------------------------------
17
18 TEST_FP_OP2_S( 2, fsgnj.s, 0, -6.3, 6.3, -1.0 );
19 TEST_FP_OP2_S( 3, fsgnj.s, 0, 7.3, 7.3, 2.0 );
20 TEST_FP_OP2_S( 4, fsgnj.s, 0, -8.3, -8.3, -3.0 );
21 TEST_FP_OP2_S( 5, fsgnj.s, 0, 9.3, -9.3, 4.0 );
22
23 TEST_FP_OP2_S(12, fsgnjn.s, 0, 6.3, 6.3, -1.0 );
24 TEST_FP_OP2_S(13, fsgnjn.s, 0, -7.3, 7.3, 2.0 );
25 TEST_FP_OP2_S(14, fsgnjn.s, 0, 8.3, -8.3, -3.0 );
26 TEST_FP_OP2_S(15, fsgnjn.s, 0, -9.3, -9.3, 4.0 );
27
28 TEST_FP_OP2_S(22, fsgnjx.s, 0, -6.3, 6.3, -1.0 );
29 TEST_FP_OP2_S(23, fsgnjx.s, 0, 7.3, 7.3, 2.0 );
30 TEST_FP_OP2_S(24, fsgnjx.s, 0, 8.3, -8.3, -3.0 );
31 TEST_FP_OP2_S(25, fsgnjx.s, 0, -9.3, -9.3, 4.0 );
32
33 TEST_FP_OP2_D(32, fsgnj.d, 0, -6.3, 6.3, -1.0 );
34 TEST_FP_OP2_D(33, fsgnj.d, 0, 7.3, 7.3, 2.0 );
35 TEST_FP_OP2_D(34, fsgnj.d, 0, -8.3, -8.3, -3.0 );
36 TEST_FP_OP2_D(35, fsgnj.d, 0, 9.3, -9.3, 4.0 );
37
38 TEST_FP_OP2_D(42, fsgnjn.d, 0, 6.3, 6.3, -1.0 );
39 TEST_FP_OP2_D(43, fsgnjn.d, 0, -7.3, 7.3, 2.0 );
40 TEST_FP_OP2_D(44, fsgnjn.d, 0, 8.3, -8.3, -3.0 );
41 TEST_FP_OP2_D(45, fsgnjn.d, 0, -9.3, -9.3, 4.0 );
42
43 TEST_FP_OP2_D(52, fsgnjx.d, 0, -6.3, 6.3, -1.0 );
44 TEST_FP_OP2_D(53, fsgnjx.d, 0, 7.3, 7.3, 2.0 );
45 TEST_FP_OP2_D(54, fsgnjx.d, 0, 8.3, -8.3, -3.0 );
46 TEST_FP_OP2_D(55, fsgnjx.d, 0, -9.3, -9.3, 4.0 );
47
48 TEST_PASSFAIL
49
50 RVTEST_CODE_END
51
52 .data
53 RVTEST_DATA_BEGIN
54
55 TEST_DATA
56
57 RVTEST_DATA_END