diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-03-20 22:16:44 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-03-20 22:16:44 -0700 |
commit | 74bc584aa5be5d52ded54e44dbf465f63b03a629 (patch) | |
tree | dddd4c3242c6e1f70c5ebebcf1f27cee7f207dec /isa/rv64uf/fdiv.S | |
parent | 211e4fcdc93654fc810cff0b6864fdc7097919dc (diff) | |
download | riscv-tests-74bc584aa5be5d52ded54e44dbf465f63b03a629.zip riscv-tests-74bc584aa5be5d52ded54e44dbf465f63b03a629.tar.gz riscv-tests-74bc584aa5be5d52ded54e44dbf465f63b03a629.tar.bz2 |
Add fdiv test
Diffstat (limited to 'isa/rv64uf/fdiv.S')
-rw-r--r-- | isa/rv64uf/fdiv.S | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/isa/rv64uf/fdiv.S b/isa/rv64uf/fdiv.S new file mode 100644 index 0000000..b445663 --- /dev/null +++ b/isa/rv64uf/fdiv.S @@ -0,0 +1,43 @@ +# See LICENSE for license details. + +#***************************************************************************** +# fdiv.S +#----------------------------------------------------------------------------- +# +# Test f{div|sqrt}.{s|d} instructions. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + + #------------------------------------------------------------- + # Arithmetic tests + #------------------------------------------------------------- + + TEST_FP_OP2_S( 2, fdiv.s, 1, 1.1557273520668288, 3.14159265, 2.71828182 ); + TEST_FP_OP2_S( 3, fdiv.s, 1,-0.9991093838555584, -1234, 1235.1 ); + TEST_FP_OP2_S( 4, fdiv.s, 0, 3.14159265, 3.14159265, 1.0 ); + + TEST_FP_OP2_D( 5, fdiv.d, 1, 1.1557273520668288, 3.14159265, 2.71828182 ); + TEST_FP_OP2_D( 6, fdiv.d, 1,-0.9991093838555584, -1234, 1235.1 ); + TEST_FP_OP2_D( 7, fdiv.d, 0, 3.14159265, 3.14159265, 1.0 ); + + TEST_FP_OP1_S(11, fsqrt.s, 1, 1.7724538498928541, 3.14159265 ); + TEST_FP_OP1_S(12, fsqrt.s, 0, 100, 10000 ); + + TEST_FP_OP1_D(13, fsqrt.d, 1, 1.7724538498928541, 3.14159265 ); + TEST_FP_OP1_D(14, fsqrt.d, 0, 100, 10000 ); + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END |