Skip to content

Commit 0645a51

Browse files
RVY encodings matching latest 0.9.8.3 draft
Matching the latest version of https://riscv.github.io/riscv-cheri/ Co-authored-by: Tariq Kurd <tariq.kurd@codasip.com>
1 parent ec5d992 commit 0645a51

14 files changed

Lines changed: 119 additions & 3 deletions

File tree

arg_lut.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"rd_n2", 11, 7
9393
"rd_n0", 11, 7
9494
"rs1_n0", 11, 7
95+
"rs2_n0", 24, 20
9596
"c_rs2_n0", 6, 2
9697
"c_rs1_n0", 11, 7
9798
"c_rs2", 6, 2
@@ -113,3 +114,4 @@
113114
"p_rd_p", 11, 8
114115
"p_rs1_p", 19, 16
115116
"p_rs2_p", 24, 21
117+
"ybndswimm9", 28, 20

csrs.csv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@
9393
0x257, "vsireg6"
9494
0x25C, "vstopei"
9595
0x280, "vsatp"
96+
0x480, "utidc"
97+
0x580, "stidc"
98+
0x780, "mtidc"
99+
0xA80, "vstidc"
96100
0x600, "hstatus"
97101
0x602, "hedeleg"
98102
0x603, "hideleg"
@@ -246,6 +250,7 @@
246250
0x3ed, "pmpaddr61"
247251
0x3ee, "pmpaddr62"
248252
0x3ef, "pmpaddr63"
253+
0x416, "ddc"
249254
0x747, "mseccfg"
250255
0x7a0, "tselect"
251256
0x7a1, "tdata1"
@@ -259,6 +264,9 @@
259264
0x7b1, "dpc"
260265
0x7b2, "dscratch0"
261266
0x7b3, "dscratch1"
267+
0x7ba, "drootcsel"
268+
0x7bc, "dddc"
269+
0x7bd, "drootc"
262270
0xB00, "mcycle"
263271
0xB02, "minstret"
264272
0xB03, "mhpmcounter3"

extensions/unratified/rv32_y

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 32-bit YHIR pseudo-op
2+
$pseudo_op rv_y::srliy yhir rd rs1 31..27=0 26..20=32 14..12=5 6..2=0x1E 1..0=3

extensions/unratified/rv32_y_c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# When the base ISA is RV32Y, the Zcf instructions are remapped loads/stores of capabilities:
2+
# c.ly: repurposes c.flw
3+
# c.sy: repurposes c.fsw
4+
# c.lysp: repurposes c.flwsp
5+
# c.sysp: repurposes c.fswsp
6+
7+
c.ly_rv32 rd_p rs1_p c_uimm8lo c_uimm8hi 1..0=0 15..13=3
8+
c.sy_rv32 rs1_p rs2_p c_uimm8hi c_uimm8lo 1..0=0 15..13=7
9+
c.lysp_rv32 rd_n0 c_uimm9sphi c_uimm9splo 1..0=2 15..13=3
10+
c.sysp_rv32 c_rs2 c_uimm9sp_s 1..0=2 15..13=7

extensions/unratified/rv64_y

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 64-bit YHIR pseudo-op
2+
$pseudo_op rv_y::srliy yhir rd rs1 31..27=0 26..20=64 14..12=5 6..2=0x1E 1..0=3

extensions/unratified/rv64_y_c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# When the base ISA is RV64Y, the Zcd instructions are remapped loads/stores of capabilities:
2+
# c.ly: repurposes c.fld
3+
# c.sy: repurposes c.fsd
4+
# c.lysp: repurposes c.fldsp
5+
# c.sysp: repurposes c.fsdsp
6+
7+
c.ly_rv64 rd_p rs1_p c_uimm9lo c_uimm9hi 1..0=0 15..13=1
8+
c.sy_rv64 rs1_p rs2_p c_uimm9hi c_uimm9lo 1..0=0 15..13=5
9+
c.lysp_rv64 rd_n0 c_uimm10sphi c_uimm10splo 1..0=2 15..13=1
10+
c.sysp_rv64 c_rs2 c_uimm10sp_s 1..0=2 15..13=5

extensions/unratified/rv64_y_zba

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Operand Types: rd YLEN, rs1 XLEN, rs2 YLEN (0b101)
2+
ysh4add rd rs1 rs2 31..25=0b0011_101 14..12=0 6..2=0x1E 1..0=3
3+
ysh1add.uw rd rs1 rs2 31..25=0b0100_101 14..12=0 6..2=0x1E 1..0=3
4+
ysh2add.uw rd rs1 rs2 31..25=0b0101_101 14..12=0 6..2=0x1E 1..0=3
5+
ysh3add.uw rd rs1 rs2 31..25=0b0110_101 14..12=0 6..2=0x1E 1..0=3
6+
ysh4add.uw rd rs1 rs2 31..25=0b0111_101 14..12=0 6..2=0x1E 1..0=3

extensions/unratified/rv_a_y

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lr.y rd rs1 aq rl 31..27=0b00010 24..20=0 14..12=3 6..2=0x1E 1..0=3
2+
sc.y rd rs1 rs2 aq rl 31..27=0b00011 14..12=3 6..2=0x1E 1..0=3
3+
amoswap.y rd rs1 rs2 aq rl 31..27=0b00001 14..12=3 6..2=0x1E 1..0=3

extensions/unratified/rv_y

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# R-Type Instructions
2+
#
3+
# The lower 3 bits of funct7 [27:25] are a bitmask indicating YLEN (capability) operands:
4+
# bit 25: rd (0 = XLEN, 1 = YLEN)
5+
# bit 26: rs1 (0 = XLEN, 1 = YLEN)
6+
# bit 27: rs2 (0 = XLEN, 1 = YLEN)
7+
8+
# Operand Types: rd YLEN, rs1 XLEN, rs2 XLEN (0b001)
9+
packy rd rs1 rs2 31..25=0b0000_001 14..12=0 6..2=0x1E 1..0=3
10+
$pseudo_op rv_y::packy yhiw rd rs1 rs2 31..25=0b0000_001 14..12=0 6..2=0x1E 1..0=3
11+
12+
# Operand Types: rd YLEN, rs1 YLEN, rs2 XLEN (0b011)
13+
yadd rd rs1 rs2_n0 31..25=0b0000_011 14..12=0 6..2=0x1E 1..0=3
14+
ymv rd rs1 31..25=0b0000_011 24..20=0 14..12=0 6..2=0x1E 1..0=3
15+
yaddrw rd rs1 rs2 31..25=0b0001_011 14..12=0 6..2=0x1E 1..0=3
16+
ypermc rd rs1 rs2 31..25=0b0010_011 14..12=0 6..2=0x1E 1..0=3
17+
ybndsw rd rs1 rs2 31..25=0b0011_011 14..12=0 6..2=0x1E 1..0=3
18+
ybndsrw rd rs1 rs2 31..25=0b0100_011 14..12=0 6..2=0x1E 1..0=3
19+
20+
# Operand Types: rd XLEN, rs1 YLEN, rs2 YLEN (0b110)
21+
yeq rd rs1 rs2 31..25=0b0000_110 14..12=0 6..2=0x1E 1..0=3
22+
yss rd rs1 rs2 31..25=0b0001_110 14..12=0 6..2=0x1E 1..0=3
23+
24+
# Operand Types: rd YLEN, rs1 YLEN, rs2 YLEN (0b111)
25+
ysunseal rd rs1 rs2 31..25=0b0000_111 14..12=0 6..2=0x1E 1..0=3
26+
ybld rd rs1 rs2 31..25=0b0001_111 14..12=0 6..2=0x1E 1..0=3
27+
#rs2 is in the format, but must be zero for now (non-zero will be yseal)
28+
ysentry rd rs1 24..20=0 31..25=0b0010_111 14..12=0 6..2=0x1E 1..0=3
29+
30+
# 2-OP Instructions (encoded as R-type with using 1111 in the upper bits of funct7 and rs2=funct5)
31+
# Operand Types: rd XLEN, rs1 XLEN, rs2 N/A (0b000)
32+
yamask rd rs1 31..25=0b1111_000 24..20=0 14..12=0 6..2=0x1E 1..0=3
33+
# Operand Types: rd XLEN, rs1 YLEN, rs2 N/A (0b010)
34+
ybaser rd rs1 31..25=0b1111_010 24..20=0 14..12=0 6..2=0x1E 1..0=3
35+
ypermr rd rs1 31..25=0b1111_010 24..20=1 14..12=0 6..2=0x1E 1..0=3
36+
ytopr rd rs1 31..25=0b1111_010 24..20=2 14..12=0 6..2=0x1E 1..0=3
37+
ylenr rd rs1 31..25=0b1111_010 24..20=3 14..12=0 6..2=0x1E 1..0=3
38+
ytagr rd rs1 31..25=0b1111_010 24..20=4 14..12=0 6..2=0x1E 1..0=3
39+
ytyper rd rs1 31..25=0b1111_010 24..20=5 14..12=0 6..2=0x1E 1..0=3
40+
41+
# I-Type / S-Type Instructions
42+
yaddi rd rs1 imm12 14..12=4 6..2=0x1E 1..0=3
43+
ly rd rs1 imm12 14..12=1 6..2=0x1E 1..0=3
44+
sy imm12hi rs1 rs2 imm12lo 14..12=2 6..2=0x1E 1..0=3
45+
46+
# MISC Instructions
47+
ybndswi rd rs1 ybndswimm9 31..29=0b111 14..12=5 6..2=0x1E 1..0=3
48+
srliy rd rs1 shamtq 31..27=0b00000 14..12=5 6..2=0x1E 1..0=3

extensions/unratified/rv_y_c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# When the base ISA is RVY, c.mv is remapped to c.ymv to copy YLEN-wide values
2+
c.ymv rd_n0 c_rs2_n0 1..0=2 15..13=4 12=0

0 commit comments

Comments
 (0)