What is the square root of 171?
[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_FP_OP1_S_DWORD_RESULT(15, fsqrt.s, 0x10, 0x7FC00000, -1.0 );
35 TEST_FP_OP1_D_DWORD_RESULT(16, fsqrt.d, 0x10, 0x7FF8000000000000, -1.0 );
36
37 TEST_FP_OP1_S(17, fsqrt.s, 1, 13.076696, 171.0);
38 // TEST_FP_OP1_S(17,, fsqrt.s, 1, 13.025515, 171.0);
39 TEST_FP_OP1_D(18, fsqrt.d, 1, 13.076696830622021, 171.0);
40
41 TEST_PASSFAIL
42
43 RVTEST_CODE_END
44
45 .data
46 RVTEST_DATA_BEGIN
47
48 TEST_DATA
49
50 RVTEST_DATA_END