Test FMIN/FMAX NaN behavior
[riscv-tests.git] / isa / rv64ud / fadd.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # fadd.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test f{add|sub|mul}.d 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_FP_OP2_D( 2, fadd.d, 0, 3.5, 2.5, 1.0 );
21 TEST_FP_OP2_D( 3, fadd.d, 1, -1234, -1235.1, 1.1 );
22 TEST_FP_OP2_D( 4, fadd.d, 1, 3.14159266, 3.14159265, 0.00000001 );
23
24 TEST_FP_OP2_D( 5, fsub.d, 0, 1.5, 2.5, 1.0 );
25 TEST_FP_OP2_D( 6, fsub.d, 1, -1234, -1235.1, -1.1 );
26 TEST_FP_OP2_D( 7, fsub.d, 1, 3.1415926400000001, 3.14159265, 0.00000001 );
27
28 TEST_FP_OP2_D( 8, fmul.d, 0, 2.5, 2.5, 1.0 );
29 TEST_FP_OP2_D( 9, fmul.d, 1, 1358.61, -1235.1, -1.1 );
30 TEST_FP_OP2_D(10, fmul.d, 1, 3.14159265e-8, 3.14159265, 0.00000001 );
31
32 # Is the canonical NaN generated for Inf - Inf?
33 TEST_FP_OP2_D(11, fsub.d, 0x10, 0d:7ff8000000000000, Inf, Inf);
34
35 TEST_PASSFAIL
36
37 RVTEST_CODE_END
38
39 .data
40 RVTEST_DATA_BEGIN
41
42 TEST_DATA
43
44 RVTEST_DATA_END