aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2015-04-13 14:43:18 -0700
committerAndrew Waterman <waterman@eecs.berkeley.edu>2015-04-13 14:43:18 -0700
commit4496a12c2f0bca74d47c633cc5f970d214a3433a (patch)
treec0b4a73fcb523e0336313435d3686325a4cef636
parent74fa7fbd09701e8a63b616cd9a8f78c23a43cbb3 (diff)
parent075745d1ee9c0437dcc2400630faf10168aecd10 (diff)
downloadriscv-tests-4496a12c2f0bca74d47c633cc5f970d214a3433a.zip
riscv-tests-4496a12c2f0bca74d47c633cc5f970d214a3433a.tar.gz
riscv-tests-4496a12c2f0bca74d47c633cc5f970d214a3433a.tar.bz2
Merge pull request #3 from joerchan/master
Better coverage of mul high instructions
-rw-r--r--isa/rv32ui/mul.S6
-rw-r--r--isa/rv32ui/mulh.S9
-rw-r--r--isa/rv32ui/mulhsu.S9
-rw-r--r--isa/rv32ui/mulhu.S6
4 files changed, 30 insertions, 0 deletions
diff --git a/isa/rv32ui/mul.S b/isa/rv32ui/mul.S
index b3ec446..0368629 100644
--- a/isa/rv32ui/mul.S
+++ b/isa/rv32ui/mul.S
@@ -31,6 +31,12 @@ RVTEST_CODE_BEGIN
TEST_RR_OP(30, mul, 0x0000ff7f, 0xaaaaaaab, 0x0002fe7d );
TEST_RR_OP(31, mul, 0x0000ff7f, 0x0002fe7d, 0xaaaaaaab );
+ TEST_RR_OP(34, mul, 0x00000000, 0xff000000, 0xff000000 );
+
+ TEST_RR_OP(35, mul, 0x00000001, 0xffffffff, 0xffffffff );
+ TEST_RR_OP(36, mul, 0xffffffff, 0xffffffff, 0x00000001 );
+ TEST_RR_OP(37, mul, 0xffffffff, 0x00000001, 0xffffffff );
+
#-------------------------------------------------------------
# Source/Destination tests
#-------------------------------------------------------------
diff --git a/isa/rv32ui/mulh.S b/isa/rv32ui/mulh.S
index 3f96931..e583f5f 100644
--- a/isa/rv32ui/mulh.S
+++ b/isa/rv32ui/mulh.S
@@ -25,6 +25,15 @@ RVTEST_CODE_BEGIN
TEST_RR_OP( 6, mulh, 0x00000000, 0x80000000, 0x00000000 );
TEST_RR_OP( 7, mulh, 0x00000000, 0x80000000, 0x00000000 );
+ TEST_RR_OP(30, mulh, 0xffff0081, 0xaaaaaaab, 0x0002fe7d );
+ TEST_RR_OP(31, mulh, 0xffff0081, 0x0002fe7d, 0xaaaaaaab );
+
+ TEST_RR_OP(32, mulh, 0x00010000, 0xff000000, 0xff000000 );
+
+ TEST_RR_OP(33, mulh, 0x00000000, 0xffffffff, 0xffffffff );
+ TEST_RR_OP(34, mulh, 0xffffffff, 0xffffffff, 0x00000001 );
+ TEST_RR_OP(35, mulh, 0xffffffff, 0x00000001, 0xffffffff );
+
#-------------------------------------------------------------
# Source/Destination tests
#-------------------------------------------------------------
diff --git a/isa/rv32ui/mulhsu.S b/isa/rv32ui/mulhsu.S
index 1d3dd3e..28b3690 100644
--- a/isa/rv32ui/mulhsu.S
+++ b/isa/rv32ui/mulhsu.S
@@ -25,6 +25,15 @@ RVTEST_CODE_BEGIN
TEST_RR_OP( 6, mulhsu, 0x00000000, 0x80000000, 0x00000000 );
TEST_RR_OP( 7, mulhsu, 0x80004000, 0x80000000, 0xffff8000 );
+ TEST_RR_OP(30, mulhsu, 0xffff0081, 0xaaaaaaab, 0x0002fe7d );
+ TEST_RR_OP(31, mulhsu, 0x0001fefe, 0x0002fe7d, 0xaaaaaaab );
+
+ TEST_RR_OP(32, mulhsu, 0xff010000, 0xff000000, 0xff000000 );
+
+ TEST_RR_OP(33, mulhsu, 0xffffffff, 0xffffffff, 0xffffffff );
+ TEST_RR_OP(34, mulhsu, 0xffffffff, 0xffffffff, 0x00000001 );
+ TEST_RR_OP(35, mulhsu, 0x00000000, 0x00000001, 0xffffffff );
+
#-------------------------------------------------------------
# Source/Destination tests
#-------------------------------------------------------------
diff --git a/isa/rv32ui/mulhu.S b/isa/rv32ui/mulhu.S
index 70301d2..601dcff 100644
--- a/isa/rv32ui/mulhu.S
+++ b/isa/rv32ui/mulhu.S
@@ -28,6 +28,12 @@ RVTEST_CODE_BEGIN
TEST_RR_OP(30, mulhu, 0x0001fefe, 0xaaaaaaab, 0x0002fe7d );
TEST_RR_OP(31, mulhu, 0x0001fefe, 0x0002fe7d, 0xaaaaaaab );
+ TEST_RR_OP(32, mulhu, 0xfe010000, 0xff000000, 0xff000000 );
+
+ TEST_RR_OP(33, mulhu, 0xfffffffe, 0xffffffff, 0xffffffff );
+ TEST_RR_OP(34, mulhu, 0x00000000, 0xffffffff, 0x00000001 );
+ TEST_RR_OP(35, mulhu, 0x00000000, 0x00000001, 0xffffffff );
+
#-------------------------------------------------------------
# Source/Destination tests
#-------------------------------------------------------------