aboutsummaryrefslogtreecommitdiff
path: root/isa/rv32ui/or.S
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-08-30 13:02:59 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-08-30 13:13:52 -0700
commit8c633e9e80d0b3e3764ebc3651e9cc09ab9413c9 (patch)
treefc8b6f6c7a2231e52e095c7a1cb682fd18f79235 /isa/rv32ui/or.S
parent2a9cd2c6cc19863c781bcaa8b276de6e528fba8e (diff)
downloadriscv-tests-8c633e9e80d0b3e3764ebc3651e9cc09ab9413c9.zip
riscv-tests-8c633e9e80d0b3e3764ebc3651e9cc09ab9413c9.tar.gz
riscv-tests-8c633e9e80d0b3e3764ebc3651e9cc09ab9413c9.tar.bz2
Share code between rv32ui and rv64ui tests
They were almost identical, so I made them actually identical. This will reduce the burden of writing further tests that span base ISAs. Tests can still be specialized for XLEN with ifdefs on e.g. __riscv64.
Diffstat (limited to 'isa/rv32ui/or.S')
-rw-r--r--isa/rv32ui/or.S68
1 files changed, 3 insertions, 65 deletions
diff --git a/isa/rv32ui/or.S b/isa/rv32ui/or.S
index 110bcc4..1cf5674 100644
--- a/isa/rv32ui/or.S
+++ b/isa/rv32ui/or.S
@@ -1,69 +1,7 @@
# See LICENSE for license details.
-#*****************************************************************************
-# or.S
-#-----------------------------------------------------------------------------
-#
-# Test or instruction.
-#
-
#include "riscv_test.h"
-#include "test_macros.h"
-
-RVTEST_RV32U
-RVTEST_CODE_BEGIN
-
- #-------------------------------------------------------------
- # Logical tests
- #-------------------------------------------------------------
-
- TEST_RR_OP( 2, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_OP( 3, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 );
- TEST_RR_OP( 4, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f );
- TEST_RR_OP( 5, or, 0xf0fff0ff, 0xf00ff00f, 0xf0f0f0f0 );
-
- #-------------------------------------------------------------
- # Source/Destination tests
- #-------------------------------------------------------------
-
- TEST_RR_SRC1_EQ_DEST( 6, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_SRC2_EQ_DEST( 7, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_SRC12_EQ_DEST( 8, or, 0xff00ff00, 0xff00ff00 );
-
- #-------------------------------------------------------------
- # Bypassing tests
- #-------------------------------------------------------------
-
- TEST_RR_DEST_BYPASS( 9, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_DEST_BYPASS( 10, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 );
- TEST_RR_DEST_BYPASS( 11, 2, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f );
-
- TEST_RR_SRC12_BYPASS( 12, 0, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_SRC12_BYPASS( 13, 0, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 );
- TEST_RR_SRC12_BYPASS( 14, 0, 2, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f );
- TEST_RR_SRC12_BYPASS( 15, 1, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_SRC12_BYPASS( 16, 1, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 );
- TEST_RR_SRC12_BYPASS( 17, 2, 0, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f );
-
- TEST_RR_SRC21_BYPASS( 18, 0, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_SRC21_BYPASS( 19, 0, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 );
- TEST_RR_SRC21_BYPASS( 20, 0, 2, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f );
- TEST_RR_SRC21_BYPASS( 21, 1, 0, or, 0xff0fff0f, 0xff00ff00, 0x0f0f0f0f );
- TEST_RR_SRC21_BYPASS( 22, 1, 1, or, 0xfff0fff0, 0x0ff00ff0, 0xf0f0f0f0 );
- TEST_RR_SRC21_BYPASS( 23, 2, 0, or, 0x0fff0fff, 0x00ff00ff, 0x0f0f0f0f );
-
- TEST_RR_ZEROSRC1( 24, or, 0xff00ff00, 0xff00ff00 );
- TEST_RR_ZEROSRC2( 25, or, 0x00ff00ff, 0x00ff00ff );
- TEST_RR_ZEROSRC12( 26, or, 0 );
- TEST_RR_ZERODEST( 27, or, 0x11111111, 0x22222222 );
-
- TEST_PASSFAIL
-
-RVTEST_CODE_END
-
- .data
-RVTEST_DATA_BEGIN
-
- TEST_DATA
+#undef RVTEST_RV64U
+#define RVTEST_RV64U RVTEST_RV32U
-RVTEST_DATA_END
+#include "../rv64ui/or.S"