diff options
author | Yunsup Lee <yunsup@cs.berkeley.edu> | 2013-04-22 14:56:59 -0700 |
---|---|---|
committer | Yunsup Lee <yunsup@cs.berkeley.edu> | 2013-04-22 14:56:59 -0700 |
commit | 81ad66f25ce4c15180e558696961bd8eaf967fea (patch) | |
tree | d70676fb1d11a4a66a268f7860d3ef7d469987fe /isa/rv64uf/fmadd.S | |
download | riscv-tests-81ad66f25ce4c15180e558696961bd8eaf967fea.zip riscv-tests-81ad66f25ce4c15180e558696961bd8eaf967fea.tar.gz riscv-tests-81ad66f25ce4c15180e558696961bd8eaf967fea.tar.bz2 |
initial commit
Diffstat (limited to 'isa/rv64uf/fmadd.S')
-rw-r--r-- | isa/rv64uf/fmadd.S | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/isa/rv64uf/fmadd.S b/isa/rv64uf/fmadd.S new file mode 100644 index 0000000..76e5e9f --- /dev/null +++ b/isa/rv64uf/fmadd.S @@ -0,0 +1,59 @@ +#***************************************************************************** +# fmadd.S +#----------------------------------------------------------------------------- +# +# Test f[n]m{add|sub}.s and f[n]m{add|sub}.d instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64U +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP3_S( 2, fmadd.s, 3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S( 3, fmadd.s, 1236.2, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S( 4, fmadd.s, -12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D( 5, fmadd.d, 3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D( 6, fmadd.d, 1236.1999999999999, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D( 7, fmadd.d, -12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_S( 8, fnmadd.s, -3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S( 9, fnmadd.s, -1236.2, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S(10, fnmadd.s, 12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D(11, fnmadd.d, -3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D(12, fnmadd.d, -1236.1999999999999, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D(13, fnmadd.d, 12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_S(14, fmsub.s, 1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S(15, fmsub.s, 1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S(16, fmsub.s, -8.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D(17, fmsub.d, 1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D(18, fmsub.d, 1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D(19, fmsub.d, -8.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_S(20, fnmsub.s, -1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_S(21, fnmsub.s, -1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_S(22, fnmsub.s, 8.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_D(23, fnmsub.d, -1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_D(24, fnmsub.d, -1234, -1.0, -1235.1, 1.1 ); + TEST_FP_OP3_D(25, fnmsub.d, 8.0, 2.0, -5.0, -2.0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END |