-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate Zk*-extension opcodes (major)
- significant restructuring of opcodes into files as per new file naming policy
- Loading branch information
Showing
21 changed files
with
241 additions
and
61 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#import zbkb | ||
$pseudo_op rv64_zbp::shfli zip rd rs1 31..25=4 24..20=15 14..12=1 6..2=4 1..0=3 | ||
$pseudo_op rv64_zbp::unshfli unzip rd rs1 31..25=4 24..20=15 14..12=5 6..2=4 1..0=3 | ||
$pseudo_op rv64_zbb::rori rori rd rs1 31..25=0x30 shamtw 14..12=5 6..2=0x04 1..0=3 | ||
$pseudo_op rv64_zbp::grevi rev8 rd rs1 31..20=0x698 14..12=5 6..0=0x13 | ||
|
||
#import zkne | ||
$import rv32_zkne::aes32esmi | ||
$import rv32_zkne::aes32esi | ||
|
||
#import zknd | ||
# Scalar AES - RV32 | ||
$import rv32_zknd::aes32dsmi | ||
$import rv32_zknd::aes32dsi | ||
|
||
|
||
#import zknh | ||
# Scalar SHA512 - RV32 | ||
$import rv32_zknh::sha512sum0r | ||
$import rv32_zknh::sha512sum1r | ||
$import rv32_zknh::sha512sig0l | ||
$import rv32_zknh::sha512sig0h | ||
$import rv32_zknh::sha512sig1l | ||
$import rv32_zknh::sha512sig1h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#import zbkb | ||
$pseudo_op rv64_zbp::shfli zip rd rs1 31..25=4 24..20=15 14..12=1 6..2=4 1..0=3 | ||
$pseudo_op rv64_zbp::unshfli unzip rd rs1 31..25=4 24..20=15 14..12=5 6..2=4 1..0=3 | ||
$pseudo_op rv64_zbb::rori rori rd rs1 31..25=0x30 shamtw 14..12=5 6..2=0x04 1..0=3 | ||
$pseudo_op rv64_zbp::grevi rev8 rd rs1 31..20=0x698 14..12=5 6..0=0x13 | ||
|
||
#import zkne | ||
$import rv32_zkne::aes32esmi | ||
$import rv32_zkne::aes32esi | ||
|
||
#import zknd | ||
# Scalar AES - RV32 | ||
$import rv32_zknd::aes32dsmi | ||
$import rv32_zknd::aes32dsi | ||
|
||
|
||
#import zknh | ||
# Scalar SHA512 - RV32 | ||
$import rv32_zknh::sha512sum0r | ||
$import rv32_zknh::sha512sum1r | ||
$import rv32_zknh::sha512sig0l | ||
$import rv32_zknh::sha512sig0h | ||
$import rv32_zknh::sha512sig1l | ||
$import rv32_zknh::sha512sig1h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Scalar AES - RV32 | ||
aes32dsmi rd rs1 rs2 bs 29..25=0b10111 14..12=0 6..0=0x33 | ||
aes32dsi rd rs1 rs2 bs 29..25=0b10101 14..12=0 6..0=0x33 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Scalar AES - RV32 | ||
|
||
aes32esmi rd rs1 rs2 bs 29..25=0b10011 14..12=0 6..0=0x33 | ||
aes32esi rd rs1 rs2 bs 29..25=0b10001 14..12=0 6..0=0x33 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Scalar SHA512 - RV32 | ||
sha512sum0r rd rs1 rs2 31..30=1 29..25=0b01000 14..12=0 6..0=0x33 | ||
sha512sum1r rd rs1 rs2 31..30=1 29..25=0b01001 14..12=0 6..0=0x33 | ||
sha512sig0l rd rs1 rs2 31..30=1 29..25=0b01010 14..12=0 6..0=0x33 | ||
sha512sig0h rd rs1 rs2 31..30=1 29..25=0b01110 14..12=0 6..0=0x33 | ||
sha512sig1l rd rs1 rs2 31..30=1 29..25=0b01011 14..12=0 6..0=0x33 | ||
sha512sig1h rd rs1 rs2 31..30=1 29..25=0b01111 14..12=0 6..0=0x33 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import zbkb | ||
$pseudo_op rv64_zbp::shfli zip rd rs1 31..25=4 24..20=15 14..12=1 6..2=4 1..0=3 | ||
$pseudo_op rv64_zbp::unshfli unzip rd rs1 31..25=4 24..20=15 14..12=5 6..2=4 1..0=3 | ||
$pseudo_op rv64_zbb::rori rori rd rs1 31..25=0x30 shamtw 14..12=5 6..2=0x04 1..0=3 | ||
$pseudo_op rv64_zbp::grevi rev8 rd rs1 31..20=0x698 14..12=5 6..0=0x13 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#import zbkb | ||
$pseudo_op rv64_zbp::grevi rev8 rd rs1 31..20=0x6B8 14..12=5 6..0=0x13 | ||
$import rv64_zbb::rolw | ||
$import rv64_zbb::rorw | ||
$import rv64_zbb::roriw | ||
$import rv64_zbb::rori | ||
$import rv64_zbe::packw | ||
|
||
#import zkne | ||
# Scalar AES - RV64 | ||
$import rv64_zkne::aes64esm | ||
$import rv64_zkne::aes64es | ||
$import rv64_zknd::aes64ks1i | ||
$import rv64_zknd::aes64ks2 | ||
|
||
#import zknd | ||
# Scalar AES - RV64 | ||
$import rv64_zknd::aes64dsm | ||
$import rv64_zknd::aes64ds | ||
$import rv64_zknd::aes64im | ||
|
||
#import zknh | ||
# Scalar SHA512 - RV64 | ||
$import rv64_zknh::sha512sum0 | ||
$import rv64_zknh::sha512sum1 | ||
$import rv64_zknh::sha512sig0 | ||
$import rv64_zknh::sha512sig1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#import zbkb | ||
$pseudo_op rv64_zbp::grevi rev8 rd rs1 31..20=0x6B8 14..12=5 6..0=0x13 | ||
$import rv64_zbb::rolw | ||
$import rv64_zbb::rorw | ||
$import rv64_zbb::roriw | ||
$import rv64_zbb::rori | ||
$import rv64_zbe::packw | ||
|
||
#import zkne | ||
# Scalar AES - RV64 | ||
$import rv64_zkne::aes64esm | ||
$import rv64_zkne::aes64es | ||
$import rv64_zknd::aes64ks1i | ||
$import rv64_zknd::aes64ks2 | ||
|
||
#import zknd | ||
# Scalar AES - RV64 | ||
$import rv64_zknd::aes64dsm | ||
$import rv64_zknd::aes64ds | ||
$import rv64_zknd::aes64im | ||
|
||
#import zknh | ||
# Scalar SHA512 - RV64 | ||
$import rv64_zknh::sha512sum0 | ||
$import rv64_zknh::sha512sum1 | ||
$import rv64_zknh::sha512sig0 | ||
$import rv64_zknh::sha512sig1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Scalar AES - RV64 | ||
aes64dsm rd rs1 rs2 31..30=0 29..25=0b11111 14..12=0b000 6..0=0x33 | ||
aes64ds rd rs1 rs2 31..30=0 29..25=0b11101 14..12=0b000 6..0=0x33 | ||
aes64ks1i rd rs1 rnum 31..30=0 29..25=0b11000 24=1 14..12=0b001 6..0=0x13 | ||
aes64im rd rs1 31..30=0 29..25=0b11000 24..20=0b0000 14..12=0b001 6..0=0x13 | ||
aes64ks2 rd rs1 rs2 31..30=1 29..25=0b11111 14..12=0b000 6..0=0x33 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Scalar AES - RV64 | ||
aes64esm rd rs1 rs2 31..30=0 29..25=0b11011 14..12=0b000 6..0=0x33 | ||
aes64es rd rs1 rs2 31..30=0 29..25=0b11001 14..12=0b000 6..0=0x33 | ||
$import rv64_zknd::aes64ks1i | ||
$import rv64_zknd::aes64ks2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Scalar SHA512 - RV64 | ||
sha512sum0 rd rs1 31..30=0 29..25=0b01000 24..20=0b00100 14..12=1 6..0=0x13 | ||
sha512sum1 rd rs1 31..30=0 29..25=0b01000 24..20=0b00101 14..12=1 6..0=0x13 | ||
sha512sig0 rd rs1 31..30=0 29..25=0b01000 24..20=0b00110 14..12=1 6..0=0x13 | ||
sha512sig1 rd rs1 31..30=0 29..25=0b01000 24..20=0b00111 14..12=1 6..0=0x13 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#import zbkb | ||
$pseudo_op rv64_zbp::grevi rev8 rd rs1 31..20=0x6B8 14..12=5 6..0=0x13 | ||
$import rv64_zbb::rolw | ||
$import rv64_zbb::rorw | ||
$import rv64_zbb::roriw | ||
$import rv64_zbb::rori | ||
$import rv64_zbe::packw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# import zbkb | ||
$import rv_zbb::rol | ||
$import rv_zbb::ror | ||
$import rv_zbb::andn | ||
$import rv_zbb::orn | ||
$import rv_zbb::xnor | ||
$import rv_zbe::pack | ||
$import rv_zbe::packh | ||
$pseudo_op rv64_zbp::grevi brev8 rd rs1 31..20=0x687 14..12=5 6..2=0x4 1..0=0x3 | ||
|
||
#import zbkc | ||
$import rv_zbc::clmul | ||
$import rv_zbc::clmulh | ||
|
||
#import zbkx | ||
$import rv_zbkx::xperm4 | ||
$import rv_zbkx::xperm8 | ||
|
||
#import zknh | ||
# Scalar SHA256 - RV32/RV64 | ||
$import rv_zknh::sha256sum0 | ||
$import rv_zknh::sha256sum1 | ||
$import rv_zknh::sha256sig0 | ||
$import rv_zknh::sha256sig1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# import zbkb | ||
$import rv_zbb::rol | ||
$import rv_zbb::ror | ||
$import rv_zbb::andn | ||
$import rv_zbb::orn | ||
$import rv_zbb::xnor | ||
$import rv_zbe::pack | ||
$import rv_zbe::packh | ||
$pseudo_op rv64_zbp::grevi brev8 rd rs1 31..20=0x687 14..12=5 6..2=0x4 1..0=0x3 | ||
|
||
#import zbkc | ||
$import rv_zbc::clmul | ||
$import rv_zbc::clmulh | ||
|
||
#import zbkx | ||
$import rv_zbkx::xperm4 | ||
$import rv_zbkx::xperm8 | ||
|
||
#import zknh | ||
# Scalar SHA256 - RV32/RV64 | ||
$import rv_zknh::sha256sum0 | ||
$import rv_zknh::sha256sum1 | ||
$import rv_zknh::sha256sig0 | ||
$import rv_zknh::sha256sig1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# import zbkb | ||
$import rv_zbb::rol | ||
$import rv_zbb::ror | ||
$import rv_zbb::andn | ||
$import rv_zbb::orn | ||
$import rv_zbb::xnor | ||
$import rv_zbe::pack | ||
$import rv_zbe::packh | ||
$pseudo_op rv64_zbp::grevi brev8 rd rs1 31..20=0x687 14..12=5 6..2=0x4 1..0=0x3 | ||
|
||
#import zbkc | ||
$import rv_zbc::clmul | ||
$import rv_zbc::clmulh | ||
|
||
#import zbkx | ||
$import rv_zbkx::xperm4 | ||
$import rv_zbkx::xperm8 | ||
|
||
# Scalar SM4 - RV32, RV64 | ||
$import rv_zksed::sm4ed | ||
$import rv_zksed::sm4ks | ||
|
||
# Scalar SM3 - RV32, RV64 | ||
$import rv_zksh::sm3p0 | ||
$import rv_zksh::sm3p1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Scalar SM4 - RV32, RV64 | ||
sm4ed rd rs1 rs2 bs 29..25=0b11000 14..12=0 6..0=0x33 | ||
sm4ks rd rs1 rs2 bs 29..25=0b11010 14..12=0 6..0=0x33 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 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 | ||
|