ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Nrspec
CV1.9 analog (color see notes)
C/Xc5bit-opcodetypeinstruction
2
1Ishsp/swsp/sdsp/sqspCXcsxsp/sysstore memsxsp5rs1*6imms[hwdq] rs1 (imm<<x)(sp)
3
2
4
3I64swspCXcswspstore memswsp5rs1*6immsw rs1 (imm<<2)(sp)Is this one worth it?
5
4reservedswspzero6imm
6
5
7
6Ilhsp/lwsp/ldsp/lqspCXclxspload memlxsp5rd*6imml[hwdq] rd (imm<<x)(sp)
8
7reservedlxspzero6imm
9
8
10
9I64lwspCXclwspload memlwsp5rd*6immlw rd (imm<<2)(sp)Is this one worth it
11
10reservedlwspzero6imm
12
11
13
12Ilh/lw/ld/lqCXclx load memlx3rd3rs15imml[hwdq] rd (imm<<x)(rs1)
14
13
15
14I64lwCXclw load memlw3rd3rs15immlw rd (imm<<2)(rs1)
16
15
17
16Ish/sw/sd/sqCXcsxstore memsx3rs13rs25imms[hwdq] rs1 (imm<<x)(rs2)
18
17
19
18I64sw CXcswstore memsw3rs13rs25immsw rs1 (imm<<2)(rs2)
20
19
21
20IXcloadload meml.b03rd3rs1lb rd 0(rs1)
22
21I32Xcloadload meml.h 13rd3rs1lh rd 0(rs1)
23
22IXcloadload meml.bu23rd3rs1lbu rd 0(rs1)
24
23I32Xcloadload meml.hu33rd3rs1lhu rd 0(rs1)
25
24I64Xcloadload meml.wu43rd3rs1lwu rd 0(rs1)
26
25reservedload5
27
26AXcloadamoamo.l.x.aqrl63rd3rs1amo.add rd rs1 zero
28
27A64Xcloadamoamo.l.w.aqrl73rd3rs1amo.addw rd rs1 zero
29
28Sflw/flspw (-)CXcloadfpl.fw083frd3rs1flw 3frd (0<<2)(3rs1)
30
29Sflw/flspw (-)CXcloadfpl.fw193frd3rs1flw 3frd (1<<2)(3rs1)
31
30Sflw/flspw (-)CXcloadfpl.fw2103frd3rs1flw 3frd (2<<2)(3rs1)
32
31Sflw/flspw (-)CXcloadfpl.fw3113frd3rs1flw 3frd (3<<2)(3rs1)
33
32Dfld/flspd (-)CXcloadfpl.fd0123frd3rs1fld 3frd (0<<3)(3rs1)
34
33Dfld/flspd (-)CXcloadfpl.fd1133frd3rs1fld 3frd (1<<3(3rs1)
35
34Dfld/flspd (-)CXcloadfpl.fd2143frd3rs1fld 3frd (2<<3)(3rs1)
36
35Dfld/flspd (-)CXcloadfpl.fd3153frd3rs1fld 3frd (3<<3)(3rs1)
37
36IXcloadaluseqz 163rd3rs1sltui rd rs1 1
also serves as boolnot. snez can be done in two instructions as li rd 0; sltu rd rd rs2 and snez sltu rd zero rs1 got the wrong ordering of rs1 and rs2 :-(
38
37IXcloadalusltz173rd3rs1slt rd rs1 zeroequivalent: srai rd rs1 -1
39
38IXcloadaluslez183rd3rs1slti rd rs1 1
alternatively have a sgtz: sltz rd zero rs1 but this has the wrong ordering of rs1 and rs2
40
39IXcloadalunot193rd3rs1xori rd rs1 -1
41
40IXcloadjumpjalr203rd3rs1jalr rd rs1 0x0
42
41reservedload21andi0xffffffff rd rs1 --> "andi rd rd 0xffffffff"?
43
42reservedload22
44
43reservedload23
45
44AXcloadamolr.x243rd3rs1lr.wdq rd 0(rs1)
46
45AXcloadamolr.x.aq253rd3rs1lr.wdq.aq rd 0(rs1)
47
46AXcloadamolr.x.rl263rd3rs1lr.wdq.rl rd 0(rs1)
48
47AXcloadamolr.x.aqrl273rd3rs1lr.wdq.aqrl rd 0(rs1)
49
48A64Xcloadamolr.w283rd3rs1lr.w rd 0(rs1)
50
49A64Xcloadamolr.w.aq293rd3rs1lr.w.aq rd 0(rs1)
51
50A64Xcloadamolr.w.rl303rd3rs1lr.w.rl rd 0(rs1)
52
51A64Xcloadamolr.w.aqrl313rd3rs1lr.w.aqrl rd 0(rs1)
53
52
54
53IXcstorestore mems.b03rs13rs2sb rs1 0(rs2)
55
54I32Xcstorestore mems.h13rs13rs2sh rs1 0(rs2)
56
55reservedstore43rs13rs2
57
56reservedstore53rs13rs2swap 3rsd1 5rsd2?
58
57reservedstore63rs13rs2
59
58reservedstore73rs13rs2
60
59AXcstoreamoamo.s.x.aqrl33rs13rs2amo.swap zero rs1 rs2
61
60A64Xcstoreamoamo.s.w.aqrl23rs13rs2amo.swapw zero rs1 rs2
Note order of address and value reversed from s.b and s.h
62
61Sfsw/fsspw (-)CXcstorefps.fw083frs13rs2fsw (0<<2)(rs2) frs1
63
62Sfsw/fsspw (-)CXcstorefps.fw193frs13rs2fsw (1<<2)(rs2) frs1
64
63Sfsw/fsspw (-)CXcstorefps.fw2103frs13rs2fsw (2<<2)(rs2) frs1
65
64Sfsw/fsspw (-)CXcstorefps.fw3113frs13rs2fsw (3<<2)(rs2) frs1
66
65Dfsd/fsspd (-)CXcstorefps.fd0123frs13rs2fsd (0<<3)(rs2) frs1
67
66Dfsd/fsspd (-)CXcstorefps.fd1133frs13rs2fsd (1<<3)(rs2) frs1
68
67Dfsd/fsspd (-)CXcstorefps.fd2143frs13rs2fsd (2<<3)(rs2) frs1
69
68Dfsd/fsspd (-)CXcstorefps.fd3153frs13rs2fsd (3<<3)(rs2) frs1
70
69AXcstoreamoamo.swap.x.aqrl163rsd3rs2amo.swapwdq rsd rsd (rs2)
Use amo's for memory mapped CSR's e.g. mapped at 0x0 assuming x =3: csrwr rd rd CSR --> lui a5 CSR[11: 9 ]; add6i a5 CSR[8:3]; addi[2:0]000 slli a5 x; amo.swap.x.aqrl rd a5
71
70AXcstoreamoamo.or.x.aqrl173rsd3rs2amo.or wdq rsd rsd (rs2)
72
71AXcstoreamoamo.and.x.aqrl183rsd3rs2amo.andwdq rsd rsd (rs2)
73
72AXcstoreamoamo.add.x.aqrl193rsd3rs3amo.addwdq rsd rsd (rs2)
74
73A64Xcstoreamoamo.swap.w.aqrl243rsd3rs2amo.swapw rsd rsd (rs2)
75
74A64Xcstoreamoamo.or.w.aqrl253rsd3rs2amo.orw rsd rsd (rs2)
76
75A64Xcstoreamoamo.and.w.aqrl263rsd3rs2amo.andw rsd rsd (rs2)
77
76A64Xcstoreamoamo.add.w.aqrl273rsd3rs3amo.addw rsd rsd (rs2)
78
77AXcstoreamosc.x203rsd3rs2sc.wdq rsd rsd (rs2)
79
78AXcstoreamosc.x.aq213rsd3rs2sc.wdq.aq rsd rsd (rs2)
80
79AXcstoreamosc.x.rl223rsd3rs2sc.wdq.rl rsd rsd (rs2)
81
80AXcstoreamosc.x.aqrl233rsd3rs2sc.wdq.aqrl rsd rsd (rs2)
82
81A64Xcstoreamosc.w283rsd3rs2sc.w rsd rsd (rs2)
83
82A64Xcstoreamosc.w.aq293rsd3rs2sc.w.aq rsd rsd (rs2)
84
83A64Xcstoreamosc.w.rl303rsd3rs2sc.w.rl rsd rsd (rs2)
85
84A64Xcstoreamosc.w.aqrl313rsd3rs2sc.w.aqrl rsd rsd (rs2)
86
85
87
86ImvCXcmv/addalumv5rd*5rs2*0add rd zero rs2
88
87IaddCXcmv/addaluadd5rsd*5rs2*1add rsd rsd rs2
89
88IjrCXcmv/addjumpjr5rs1*zero0
jalr zero rs1 0x0 and pop the return stack for odd registers(like ra) donot pop for even registers (or maybe change the immediate to 0x0 or 0x1 depending on the parity of the register)
90
89IjalrCXcmv/addjumpjalr_ra5rs1*zero1jalr ra rs1 0x0
An alternative maybe to have a jalr 5rsd zero --> jalr rsd rsd 0x0. This allows more flexibility than jalr ra 5rs1 and allows to kill jalr 3rd 3rs1
91
90reservedmv/addzero5rs2*0
92
91reservedmv/addzero5rs2*1
93
92reservedmv/addzerozero0
94
93reservedmv/addzerozero1
95
94
96
95IliCXcli lili5rd*6immli rd immthis inludes setting a register to zero
97
96reservedli zero6immlui_ra ???
98
97
99
98IXcauipc_raliauipc_ra11immauipc ra imm intended to be paired with jalr_ra
100
99