-
Notifications
You must be signed in to change notification settings - Fork 0
/
encoding.txt
55 lines (52 loc) · 5.32 KB
/
encoding.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
+=====================+======================+==========+=====================+=========+=============+
| class | instruction | format | f7 | f3 | custom |
+=====================+======================+==========+=====================+=========+=============+
| | | | | | |
| GRAIN_RV32_TYPE2 | grain.extr | 2R+I->1R | 00 : imm5 | 7 = 111 | 0 = 0001011 |
| | | | | | |
+=====================+======================+==========+=====================+=========+=============+
.macro grain.extr rd, rs1, rs2, imm // grain.extr => 00ii iiir rrrr rrrr r111 rrrr r000 1011
.insn r CUSTOM_0, 7, \imm+( 0*32), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_EXTR 0x0000700B
.endm // => #define MASK_GRAIN_EXTR 0xC000707F
+=====================+======================+==========+=====================+=========+=============+
| class | instruction | format | f7 | f3 | custom |
+=====================+======================+==========+=====================+=========+=============+
| | | | | | |
| GRAIN_RV32_TYPE2 | grain.fln0 | 2R ->1R | 0000 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.fln2 | 2R ->1R | 0001 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.gnn0 | 2R ->1R | 0010 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.gnn1 | 2R ->1R | 0011 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.gnn2 | 2R ->1R | 0100 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.hnn0 | 2R ->1R | 0101 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.hnn1 | 2R ->1R | 0110 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.hnn2 | 2R ->1R | 0111 : 000 | 7 = 111 | 1 = 0101011 |
| GRAIN_RV32_TYPE2 | grain.hln0 | 2R ->1R | 1000 : 000 | 7 = 111 | 1 = 0101011 |
| | | | | | |
+=====================+======================+==========+=====================+=========+=============+
.macro grain.fln0 rd, rs1, rs2 // grain.fln0 => 0000 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 0* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_FLN0 0x0000702B
.endm // => #define MASK_GRAIN_FLN0 0xF000707F
.macro grain.fln2 rd, rs1, rs2 // grain.fln2 => 0001 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 1* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_FLN2 0x1000702B
.endm // => #define MASK_GRAIN_FLN2 0xF000707F
.macro grain.gnn0 rd, rs1, rs2 // grain.gnn0 => 0010 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 2* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_GNN0 0x2000702B
.endm // => #define MASK_GRAIN_GNN0 0xF000707F
.macro grain.gnn1 rd, rs1, rs2 // grain.gnn1 => 0011 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 3* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_GNN1 0x3000702B
.endm // => #define MASK_GRAIN_GNN1 0xF000707F
.macro grain.gnn2 rd, rs1, rs2 // grain.gnn2 => 0100 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 4* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_GNN2 0x4000702B
.endm // => #define MASK_GRAIN_GNN2 0xF000707F
.macro grain.hnn0 rd, rs1, rs2 // grain.hnn0 => 0101 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 5* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_HNN0 0x5000702B
.endm // => #define MASK_GRAIN_HNN0 0xF000707F
.macro grain.hnn1 rd, rs1, rs2 // grain.hnn1 => 0110 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 6* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_HNN1 0x6000702B
.endm // => #define MASK_GRAIN_HNN1 0xF000707F
.macro grain.hnn2 rd, rs1, rs2 // grain.hnn2 => 0111 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 7* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_HNN2 0x7000702B
.endm // => #define MASK_GRAIN_HNN2 0xF000707F
.macro grain.hln0 rd, rs1, rs2 // grain.hln0 => 1000 000r rrrr rrrr r111 rrrr r010 1011
.insn r CUSTOM_0, 7, ( 8* 8), \rd, \rs1, \rs2 // => #define MATCH_GRAIN_HLN0 0x8000702B
.endm // => #define MASK_GRAIN_HLN0 0xF000707F