diff options
author | Chih-Min Chao <48193236+chihminchao@users.noreply.github.com> | 2020-11-11 17:09:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 01:09:15 -0800 |
commit | 5f8a4918c6482e65c67a2b7decd5c2af3e3fe0e5 (patch) | |
tree | 4a9483bc0b6fe2c770d8844534f89a88adbdce7d /isa/rv64uzfh/fmadd.S | |
parent | c4217d88bce9f805a81f42e86ff56ed363931d69 (diff) | |
download | riscv-tests-5f8a4918c6482e65c67a2b7decd5c2af3e3fe0e5.zip riscv-tests-5f8a4918c6482e65c67a2b7decd5c2af3e3fe0e5.tar.gz riscv-tests-5f8a4918c6482e65c67a2b7decd5c2af3e3fe0e5.tar.bz2 |
add zfh (float16) test case and related macros (#301)
* ext: add zfh extension test case and related macro
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
* build: add zfh to target
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'isa/rv64uzfh/fmadd.S')
-rw-r--r-- | isa/rv64uzfh/fmadd.S | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/isa/rv64uzfh/fmadd.S b/isa/rv64uzfh/fmadd.S new file mode 100644 index 0000000..2b49763 --- /dev/null +++ b/isa/rv64uzfh/fmadd.S @@ -0,0 +1,45 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fmadd.S +#----------------------------------------------------------------------------- +# +# Test f[n]m{add|sub}.h and f[n]m{add|sub}.h instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP3_H( 2, fmadd.h, 0, 3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_H( 3, fmadd.h, 1, 13.2, -1.0, -12.1, 1.1 ); + TEST_FP_OP3_H( 4, fmadd.h, 0, -12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_H( 5, fnmadd.h, 0, -3.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_H( 6, fnmadd.h, 1, -13.2, -1.0, -12.1, 1.1 ); + TEST_FP_OP3_H( 7, fnmadd.h, 0, 12.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_H( 8, fmsub.h, 0, 1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_H( 9, fmsub.h, 1, 11, -1.0, -12.1, 1.1 ); + TEST_FP_OP3_H(10, fmsub.h, 0, -8.0, 2.0, -5.0, -2.0 ); + + TEST_FP_OP3_H(11, fnmsub.h, 0, -1.5, 1.0, 2.5, 1.0 ); + TEST_FP_OP3_H(12, fnmsub.h, 1, -11, -1.0, -12.1, 1.1 ); + TEST_FP_OP3_H(13, fnmsub.h, 0, 8.0, 2.0, -5.0, -2.0 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END |