aboutsummaryrefslogtreecommitdiff
path: root/isa/rv64uzbs/bexti.S
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2024-02-18 20:09:30 -0800
committerGitHub <noreply@github.com>2024-02-18 20:09:30 -0800
commit3bd02c8ab45666cf1c0532294f115c4d2ce3e027 (patch)
tree1a5653d944c240bb81dbfa4c37e922186af35215 /isa/rv64uzbs/bexti.S
parentad33ed3cb50b4cc23a44657a541f76325e659af0 (diff)
parent9c06101326cdd451a051bc3e6469b3c76f24d101 (diff)
downloadriscv-tests-3bd02c8ab45666cf1c0532294f115c4d2ce3e027.zip
riscv-tests-3bd02c8ab45666cf1c0532294f115c4d2ce3e027.tar.gz
riscv-tests-3bd02c8ab45666cf1c0532294f115c4d2ce3e027.tar.bz2
Merge pull request #539 from rogerchang23424/bitmanip
Add bitmanip test cases
Diffstat (limited to 'isa/rv64uzbs/bexti.S')
-rw-r--r--isa/rv64uzbs/bexti.S74
1 files changed, 74 insertions, 0 deletions
diff --git a/isa/rv64uzbs/bexti.S b/isa/rv64uzbs/bexti.S
new file mode 100644
index 0000000..19c9ed5
--- /dev/null
+++ b/isa/rv64uzbs/bexti.S
@@ -0,0 +1,74 @@
+# See LICENSE for license details.
+
+#*****************************************************************************
+# bexti.S
+#-----------------------------------------------------------------------------
+#
+# Test bexti instruction.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+RVTEST_RV64U
+RVTEST_CODE_BEGIN
+
+ #-------------------------------------------------------------
+ # Arithmetic tests
+ #-------------------------------------------------------------
+
+ TEST_IMM_OP( 2, bexti, 0, 0xff00ff00, 0 );
+ TEST_IMM_OP( 3, bexti, 1, 0x00ff00ff, 1 );
+ TEST_IMM_OP( 4, bexti, 1, 0xff00ff00, 8 );
+ TEST_IMM_OP( 5, bexti, 0, 0x0ff00ff0, 14 );
+ TEST_IMM_OP( 6, bexti, 1, 0x0ff00ff0, 27 );
+
+ TEST_IMM_OP( 7, bexti, 1, 0xffffffffffffffff, 0 );
+ TEST_IMM_OP( 8, bexti, 1, 0xffffffffffffffff, 1 );
+ TEST_IMM_OP( 9, bexti, 1, 0xffffffffffffffff, 7 );
+ TEST_IMM_OP( 10, bexti, 1, 0xffffffffffffffff, 14 );
+ TEST_IMM_OP( 11, bexti, 1, 0xffffffffffffffff, 27 );
+
+ TEST_IMM_OP( 12, bexti, 1, 0x21212121, 0 );
+ TEST_IMM_OP( 13, bexti, 0, 0x21212121, 1 );
+ TEST_IMM_OP( 14, bexti, 0, 0x21212121, 7 );
+ TEST_IMM_OP( 15, bexti, 1, 0x21212121, 13 );
+ TEST_IMM_OP( 16, bexti, 1, 0x84848484, 31 );
+
+#if __riscv_xlen == 64
+ TEST_IMM_OP( 50, bexti, 0, 0x0000000000000001, 63 );
+ TEST_IMM_OP( 51, bexti, 1, 0xffffffffffffffff, 39 );
+ TEST_IMM_OP( 52, bexti, 1, 0xffffffff00000000, 43 );
+#endif
+
+ #-------------------------------------------------------------
+ # Source/Destination tests
+ #-------------------------------------------------------------
+
+ TEST_IMM_SRC1_EQ_DEST( 17, bexti, 0, 0x00000001, 7 );
+
+ #-------------------------------------------------------------
+ # Bypassing tests
+ #-------------------------------------------------------------
+
+ TEST_IMM_DEST_BYPASS( 18, 0, bexti, 1, 0xff00ff00, 8 );
+ TEST_IMM_DEST_BYPASS( 19, 1, bexti, 0, 0x0ff00ff0, 14 );
+ TEST_IMM_DEST_BYPASS( 20, 2, bexti, 1, 0x0ff00ff0, 27 );
+
+ TEST_IMM_SRC1_BYPASS( 21, 0, bexti, 1, 0xff00ff00, 8 );
+ TEST_IMM_SRC1_BYPASS( 22, 1, bexti, 0, 0x0ff00ff0, 14 );
+ TEST_IMM_SRC1_BYPASS( 23, 2, bexti, 1, 0x0ff00ff0, 27 );
+
+ TEST_IMM_ZEROSRC1( 24, bexti, 0, 31 );
+ TEST_IMM_ZERODEST( 25, bexti, 33, 20 );
+
+ TEST_PASSFAIL
+
+RVTEST_CODE_END
+
+ .data
+RVTEST_DATA_BEGIN
+
+ TEST_DATA
+
+RVTEST_DATA_END