fmadd.S revision 12771
1# See LICENSE for license details.
2
3#*****************************************************************************
4# fmadd.S
5#-----------------------------------------------------------------------------
6#
7# Test f[n]m{add|sub}.s and f[n]m{add|sub}.d instructions.
8#
9
10#include "riscv_test.h"
11#include "test_macros.h"
12
13RVTEST_RV64UF
14RVTEST_CODE_BEGIN
15
16  #-------------------------------------------------------------
17  # Arithmetic tests
18  #-------------------------------------------------------------
19
20  TEST_FP_OP3_S( 2,  fmadd.s, 0,                 3.5,  1.0,        2.5,        1.0 );
21  TEST_FP_OP3_S( 3,  fmadd.s, 1,              1236.2, -1.0,    -1235.1,        1.1 );
22  TEST_FP_OP3_S( 4,  fmadd.s, 0,               -12.0,  2.0,       -5.0,       -2.0 );
23
24  TEST_FP_OP3_S( 5, fnmadd.s, 0,                -3.5,  1.0,        2.5,        1.0 );
25  TEST_FP_OP3_S( 6, fnmadd.s, 1,             -1236.2, -1.0,    -1235.1,        1.1 );
26  TEST_FP_OP3_S( 7, fnmadd.s, 0,                12.0,  2.0,       -5.0,       -2.0 );
27
28  TEST_FP_OP3_S( 8,  fmsub.s, 0,                 1.5,  1.0,        2.5,        1.0 );
29  TEST_FP_OP3_S( 9,  fmsub.s, 1,                1234, -1.0,    -1235.1,        1.1 );
30  TEST_FP_OP3_S(10,  fmsub.s, 0,                -8.0,  2.0,       -5.0,       -2.0 );
31
32  TEST_FP_OP3_S(11, fnmsub.s, 0,                -1.5,  1.0,        2.5,        1.0 );
33  TEST_FP_OP3_S(12, fnmsub.s, 1,               -1234, -1.0,    -1235.1,        1.1 );
34  TEST_FP_OP3_S(13, fnmsub.s, 0,                 8.0,  2.0,       -5.0,       -2.0 );
35
36  TEST_PASSFAIL
37
38RVTEST_CODE_END
39
40  .data
41RVTEST_DATA_BEGIN
42
43  TEST_DATA
44
45RVTEST_DATA_END
46