aboutsummaryrefslogtreecommitdiff
path: root/isa/rv32uzbkb/zip.S
diff options
context:
space:
mode:
authorAndrew Waterman <aswaterman@gmail.com>2026-01-22 14:10:08 -0800
committerGitHub <noreply@github.com>2026-01-22 14:10:08 -0800
commitf443f4486085132552c9b43527fb0be5efa3cc0c (patch)
treeddc8bedb8ab11cc6aa54f6abdc5fa6506fa402db /isa/rv32uzbkb/zip.S
parent7af6beb08a418ad49df4322bc1975a54ff56f34e (diff)
downloadriscv-tests-master.zip
riscv-tests-master.tar.gz
riscv-tests-master.tar.bz2
Add scalar crypto bitmanip tests (#646)HEADmaster
* Add first version of tests for Krypto B Extension (Zbkb, Zbkc, Zbkx) * Fix build of Zbkb/Zbkx tests * Remove duplicate tests * Fix bugs in packh, packw tests --------- Co-authored-by: Furkan Aktas <f_rkan_aktas@proton.me>
Diffstat (limited to 'isa/rv32uzbkb/zip.S')
-rw-r--r--isa/rv32uzbkb/zip.S61
1 files changed, 61 insertions, 0 deletions
diff --git a/isa/rv32uzbkb/zip.S b/isa/rv32uzbkb/zip.S
new file mode 100644
index 0000000..98bfe84
--- /dev/null
+++ b/isa/rv32uzbkb/zip.S
@@ -0,0 +1,61 @@
+# See LICENSE for license details.
+
+#*****************************************************************************
+# zip.S
+#-----------------------------------------------------------------------------
+#
+# Test zip instruction.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+RVTEST_RV32U
+RVTEST_CODE_BEGIN
+
+ #-------------------------------------------------------------
+ # Arithmetic tests
+ #-------------------------------------------------------------
+
+ TEST_R_OP( 2, zip, 0x55555555, 0x0000FFFF );
+ TEST_R_OP( 3, zip, 0xAAAAAAAA, 0xFFFF0000 );
+ TEST_R_OP( 4, zip, 0x00000000, 0x00000000 );
+ TEST_R_OP( 5, zip, 0xFFFFFFFF, 0xFFFFFFFF );
+ TEST_R_OP( 6, zip, 0x99999999, 0xAAAA5555 );
+ TEST_R_OP( 7, zip, 0x00FF00FF, 0x0F0F0F0F );
+ TEST_R_OP( 8, zip, 0xDEADBEEF, 0xBEFFE36B );
+
+ #-------------------------------------------------------------
+ # Source/Destination tests
+ #-------------------------------------------------------------
+
+ TEST_R_SRC1_EQ_DEST( 11, zip, 0x55555555, 0x0000FFFF );
+ TEST_R_SRC1_EQ_DEST( 12, zip, 0xAAAAAAAA, 0xFFFF0000 );
+
+ #-------------------------------------------------------------
+ # Bypassing tests
+ #-------------------------------------------------------------
+
+ TEST_R_DEST_BYPASS( 13, 0, zip, 0x55555555, 0x0000FFFF );
+ TEST_R_DEST_BYPASS( 14, 1, zip, 0x55555555, 0x0000FFFF );
+ TEST_R_DEST_BYPASS( 15, 2, zip, 0x55555555, 0x0000FFFF );
+ TEST_R_DEST_BYPASS( 16, 3, zip, 0x55555555, 0x0000FFFF );
+
+ TEST_R_DEST_BYPASS( 17, 0, zip, 0xAAAAAAAA, 0xFFFF0000 );
+ TEST_R_DEST_BYPASS( 18, 1, zip, 0xAAAAAAAA, 0xFFFF0000 );
+ TEST_R_DEST_BYPASS( 19, 2, zip, 0xAAAAAAAA, 0xFFFF0000 );
+ TEST_R_DEST_BYPASS( 20, 3, zip, 0xAAAAAAAA, 0xFFFF0000 );
+
+ TEST_R_DEST_BYPASS( 21, 0, zip, 0x99999999, 0xAAAA5555 );
+ TEST_R_DEST_BYPASS( 22, 1, zip, 0x99999999, 0xAAAA5555 );
+ TEST_R_DEST_BYPASS( 23, 2, zip, 0x99999999, 0xAAAA5555 );
+ TEST_R_DEST_BYPASS( 24, 3, zip, 0x99999999, 0xAAAA5555 );
+
+ TEST_PASSFAIL
+
+RVTEST_CODE_END
+
+ .data
+RVTEST_DATA_BEGIN
+ TEST_DATA
+RVTEST_DATA_END \ No newline at end of file