aboutsummaryrefslogtreecommitdiff
path: root/opcodes-rvk
diff options
context:
space:
mode:
authorBen Marshall <ben.marshall@bristol.ac.uk>2021-02-19 10:02:53 +0000
committerBen Marshall <ben.marshall@bristol.ac.uk>2021-02-19 10:02:53 +0000
commit9b802ad797cab9584c1fbdeeb9866eae92fa07e3 (patch)
tree4bce097e817967d52b8e2962486ad151b3fb2ead /opcodes-rvk
parent03be826f17faedcaee7f60223f402850e254df0a (diff)
downloadriscv-opcodes-9b802ad797cab9584c1fbdeeb9866eae92fa07e3.zip
riscv-opcodes-9b802ad797cab9584c1fbdeeb9866eae92fa07e3.tar.gz
riscv-opcodes-9b802ad797cab9584c1fbdeeb9866eae92fa07e3.tar.bz2
scalar-crypto: Add opcodes for RV32K, RV64K
- Adds opcodes for RV32 and RV64 scalar crypto. - opcodes-rvk contains encodings which are for RV32 and RV64 base ISAs - opcodes-rv32/64k contains encodings which are for RV32 or RV64 - parse_opcodes has been modified: - Wnable instructions to be listed as either RV32 or RV64 only, allowing these opcodes to overlap. - The C backend has been modifed to emit the "DECLARE_RV32_ONLY" or "DECLARE_RV64_ONLY" macros as needed. - The other backends have not been modified, and may need to be in the future. On branch scalar-crypto Changes to be committed: modified: Makefile new file: opcodes-rv32k new file: opcodes-rv64k new file: opcodes-rvk modified: parse_opcodes
Diffstat (limited to 'opcodes-rvk')
-rw-r--r--opcodes-rvk24
1 files changed, 24 insertions, 0 deletions
diff --git a/opcodes-rvk b/opcodes-rvk
new file mode 100644
index 0000000..5773c22
--- /dev/null
+++ b/opcodes-rvk
@@ -0,0 +1,24 @@
+
+#
+# This file contains opcode specifications for the RISC-V
+# Scalar Cryptographic instruction set extension.
+# These instructions appear in _both_ RV32 and RV64.
+# ------------------------------------------------------------
+
+# Poll Entropy / Get Noise Pseudo Instructions
+@pollentropy rd 19..15=0 31..20=0xF15 14..12=0 6..0=0b1110011
+@getnoise rd 19..15=0 31..20=0x7A9 14..12=0 6..0=0b1110011
+
+# Scalar SM4 - RV32, RV64
+sm4ed rt rs2 bs 11..7=0 29..25=0b11000 14..12=0 6..0=0x33
+sm4ks rt rs2 bs 11..7=0 29..25=0b11010 14..12=0 6..0=0x33
+
+# Scalar SM3 - RV32, RV64
+sm3p0 rd rs1 31..30=0 29..25=0b01000 24..20=0b01000 14..12=1 6..0=0x13
+sm3p1 rd rs1 31..30=0 29..25=0b01000 24..20=0b01001 14..12=1 6..0=0x13
+
+# Scalar SHA256 - RV32/RV64
+sha256sum0 rd rs1 31..30=0 29..25=0b01000 24..20=0b00000 14..12=1 6..0=0x13
+sha256sum1 rd rs1 31..30=0 29..25=0b01000 24..20=0b00001 14..12=1 6..0=0x13
+sha256sig0 rd rs1 31..30=0 29..25=0b01000 24..20=0b00010 14..12=1 6..0=0x13
+sha256sig1 rd rs1 31..30=0 29..25=0b01000 24..20=0b00011 14..12=1 6..0=0x13