diff options
author | Howard Mao <zhehao.mao@gmail.com> | 2016-06-22 15:37:33 -0700 |
---|---|---|
committer | Howard Mao <zhehao.mao@gmail.com> | 2016-06-22 15:40:11 -0700 |
commit | b6b5e81217c1f2a70ecb6883b1756859cd7bb999 (patch) | |
tree | 41341774233c656d85b56b0089e4e316df804eb7 /isa/rv64ud/structural.S | |
parent | 26cfab585c781f06e977800000efe097dee4613d (diff) | |
download | riscv-tests-b6b5e81217c1f2a70ecb6883b1756859cd7bb999.zip riscv-tests-b6b5e81217c1f2a70ecb6883b1756859cd7bb999.tar.gz riscv-tests-b6b5e81217c1f2a70ecb6883b1756859cd7bb999.tar.bz2 |
split up rv64uf and rv64ud isa tests
Diffstat (limited to 'isa/rv64ud/structural.S')
-rw-r--r-- | isa/rv64ud/structural.S | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/isa/rv64ud/structural.S b/isa/rv64ud/structural.S new file mode 100644 index 0000000..76c6691 --- /dev/null +++ b/isa/rv64ud/structural.S @@ -0,0 +1,58 @@ +# See LICENSE for license details. + +#***************************************************************************** +# structural.S +#----------------------------------------------------------------------------- +# +# This test verifies that the FPU correctly obviates structural hazards on its +# writeback port (e.g. fadd followed by fsgnj) +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64UF +RVTEST_CODE_BEGIN + +li x25, 1 + +li x2, 0x3FF0000000000000 +li x1, 0x3F800000 + +#define TEST(nops, errcode) \ + fmv.d.x f4, x0 ;\ + fmv.s.x f3, x0 ;\ + fmv.d.x f2, x2 ;\ + fmv.s.x f1, x1 ;\ + j 1f ;\ + .align 5 ;\ +1:fmul.d f4, f2, f2 ;\ + nops ;\ + fsgnj.s f3, f1, f1 ;\ + fmv.x.d x4, f4 ;\ + fmv.x.s x3, f3 ;\ + beq x1, x3, 2f ;\ + RVTEST_FAIL ;\ +2:beq x2, x4, 2f ;\ + RVTEST_FAIL; \ +2:fmv.d.x f2, zero ;\ + fmv.s.x f1, zero ;\ + +TEST(;,2) +TEST(nop,4) +TEST(nop;nop,6) +TEST(nop;nop;nop,8) +TEST(nop;nop;nop;nop,10) +TEST(nop;nop;nop;nop;nop,12) +TEST(nop;nop;nop;nop;nop;nop,14) + +RVTEST_PASS + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END |