Add fdiv test
[riscv-tests.git] / isa / rv64uf / fdiv.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # fdiv.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test f{div|sqrt}.{s|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_S( 2, fdiv.s, 1, 1.1557273520668288, 3.14159265, 2.71828182 );
21 TEST_FP_OP2_S( 3, fdiv.s, 1,-0.9991093838555584, -1234, 1235.1 );
22 TEST_FP_OP2_S( 4, fdiv.s, 0, 3.14159265, 3.14159265, 1.0 );
23
24 TEST_FP_OP2_D( 5, fdiv.d, 1, 1.1557273520668288, 3.14159265, 2.71828182 );
25 TEST_FP_OP2_D( 6, fdiv.d, 1,-0.9991093838555584, -1234, 1235.1 );
26 TEST_FP_OP2_D( 7, fdiv.d, 0, 3.14159265, 3.14159265, 1.0 );
27
28 TEST_FP_OP1_S(11, fsqrt.s, 1, 1.7724538498928541, 3.14159265 );
29 TEST_FP_OP1_S(12, fsqrt.s, 0, 100, 10000 );
30
31 TEST_FP_OP1_D(13, fsqrt.d, 1, 1.7724538498928541, 3.14159265 );
32 TEST_FP_OP1_D(14, fsqrt.d, 0, 100, 10000 );
33
34 TEST_PASSFAIL
35
36 RVTEST_CODE_END
37
38 .data
39 RVTEST_DATA_BEGIN
40
41 TEST_DATA
42
43 RVTEST_DATA_END