aboutsummaryrefslogtreecommitdiff
path: root/isa/rv32ui/divu.S
diff options
context:
space:
mode:
authorEric Love <ericlove@s144.Millennium.Berkeley.EDU>2014-01-23 15:23:08 -0800
committerEric Love <ericlove@s144.Millennium.Berkeley.EDU>2014-01-23 15:23:08 -0800
commit197479964e99ee9a0b196c9cc1a3249812477bd3 (patch)
treebeac75e0b6d8e41f15c0b0aec02c2882c2921e09 /isa/rv32ui/divu.S
parenta481561500f43c8a022cfc0ba1695914e1df4d57 (diff)
downloadriscv-tests-197479964e99ee9a0b196c9cc1a3249812477bd3.zip
riscv-tests-197479964e99ee9a0b196c9cc1a3249812477bd3.tar.gz
riscv-tests-197479964e99ee9a0b196c9cc1a3249812477bd3.tar.bz2
First round of rv32ui asm tests
Diffstat (limited to 'isa/rv32ui/divu.S')
-rw-r--r--isa/rv32ui/divu.S39
1 files changed, 39 insertions, 0 deletions
diff --git a/isa/rv32ui/divu.S b/isa/rv32ui/divu.S
new file mode 100644
index 0000000..c060101
--- /dev/null
+++ b/isa/rv32ui/divu.S
@@ -0,0 +1,39 @@
+#*****************************************************************************
+# divu.S
+#-----------------------------------------------------------------------------
+#
+# Test divu instruction.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+RVTEST_RV32U
+RVTEST_CODE_BEGIN
+
+ #-------------------------------------------------------------
+ # Arithmetic tests
+ #-------------------------------------------------------------
+
+ TEST_RR_OP( 2, divu, 3, 20, 6 );
+ TEST_RR_OP( 3, divu, 715827879, -20, 6 );
+ TEST_RR_OP( 4, divu, 0, 20, -6 );
+ TEST_RR_OP( 5, divu, 0, -20, -6 );
+
+ TEST_RR_OP( 6, divu, -1<<31, -1<<31, 1 );
+ TEST_RR_OP( 7, divu, 0, -1<<31, -1 );
+
+ TEST_RR_OP( 8, divu, -1, -1<<31, 0 );
+ TEST_RR_OP( 9, divu, -1, 1, 0 );
+ TEST_RR_OP(10, divu, -1, 0, 0 );
+
+ TEST_PASSFAIL
+
+RVTEST_CODE_END
+
+ .data
+RVTEST_DATA_BEGIN
+
+ TEST_DATA
+
+RVTEST_DATA_END