5 #ifndef RISCV_ENCODING_H
6 #define RISCV_ENCODING_H
7 #define MATCH_SLLI_RV32 0x1013
8 #define MASK_SLLI_RV32 0xfe00707f
9 #define MATCH_SRLI_RV32 0x5013
10 #define MASK_SRLI_RV32 0xfe00707f
11 #define MATCH_SRAI_RV32 0x40005013
12 #define MASK_SRAI_RV32 0xfe00707f
13 #define MATCH_FRFLAGS 0x102073
14 #define MASK_FRFLAGS 0xfffff07f
15 #define MATCH_FSFLAGS 0x101073
16 #define MASK_FSFLAGS 0xfff0707f
17 #define MATCH_FSFLAGSI 0x105073
18 #define MASK_FSFLAGSI 0xfff0707f
19 #define MATCH_FRRM 0x202073
20 #define MASK_FRRM 0xfffff07f
21 #define MATCH_FSRM 0x201073
22 #define MASK_FSRM 0xfff0707f
23 #define MATCH_FSRMI 0x205073
24 #define MASK_FSRMI 0xfff0707f
25 #define MATCH_FSCSR 0x301073
26 #define MASK_FSCSR 0xfff0707f
27 #define MATCH_FRCSR 0x302073
28 #define MASK_FRCSR 0xfffff07f
29 #define MATCH_RDCYCLE 0xc0002073
30 #define MASK_RDCYCLE 0xfffff07f
31 #define MATCH_RDTIME 0xc0102073
32 #define MASK_RDTIME 0xfffff07f
33 #define MATCH_RDINSTRET 0xc0202073
34 #define MASK_RDINSTRET 0xfffff07f
35 #define MATCH_RDCYCLEH 0xc8002073
36 #define MASK_RDCYCLEH 0xfffff07f
37 #define MATCH_RDTIMEH 0xc8102073
38 #define MASK_RDTIMEH 0xfffff07f
39 #define MATCH_RDINSTRETH 0xc8202073
40 #define MASK_RDINSTRETH 0xfffff07f
41 #define MATCH_SCALL 0x73
42 #define MASK_SCALL 0xffffffff
43 #define MATCH_SBREAK 0x100073
44 #define MASK_SBREAK 0xffffffff
45 #define MATCH_BEQ 0x63
46 #define MASK_BEQ 0x707f
47 #define MATCH_BNE 0x1063
48 #define MASK_BNE 0x707f
49 #define MATCH_BLT 0x4063
50 #define MASK_BLT 0x707f
51 #define MATCH_BGE 0x5063
52 #define MASK_BGE 0x707f
53 #define MATCH_BLTU 0x6063
54 #define MASK_BLTU 0x707f
55 #define MATCH_BGEU 0x7063
56 #define MASK_BGEU 0x707f
57 #define MATCH_JALR 0x67
58 #define MASK_JALR 0x707f
59 #define MATCH_JAL 0x6f
61 #define MATCH_LUI 0x37
63 #define MATCH_AUIPC 0x17
64 #define MASK_AUIPC 0x7f
65 #define MATCH_ADDI 0x13
66 #define MASK_ADDI 0x707f
67 #define MATCH_SLLI 0x1013
68 #define MASK_SLLI 0xfc00707f
69 #define MATCH_SLTI 0x2013
70 #define MASK_SLTI 0x707f
71 #define MATCH_SLTIU 0x3013
72 #define MASK_SLTIU 0x707f
73 #define MATCH_XORI 0x4013
74 #define MASK_XORI 0x707f
75 #define MATCH_SRLI 0x5013
76 #define MASK_SRLI 0xfc00707f
77 #define MATCH_SRAI 0x40005013
78 #define MASK_SRAI 0xfc00707f
79 #define MATCH_ORI 0x6013
80 #define MASK_ORI 0x707f
81 #define MATCH_ANDI 0x7013
82 #define MASK_ANDI 0x707f
83 #define MATCH_ADD 0x33
84 #define MASK_ADD 0xfe00707f
85 #define MATCH_SUB 0x40000033
86 #define MASK_SUB 0xfe00707f
87 #define MATCH_SLL 0x1033
88 #define MASK_SLL 0xfe00707f
89 #define MATCH_SLT 0x2033
90 #define MASK_SLT 0xfe00707f
91 #define MATCH_SLTU 0x3033
92 #define MASK_SLTU 0xfe00707f
93 #define MATCH_XOR 0x4033
94 #define MASK_XOR 0xfe00707f
95 #define MATCH_SRL 0x5033
96 #define MASK_SRL 0xfe00707f
97 #define MATCH_SRA 0x40005033
98 #define MASK_SRA 0xfe00707f
99 #define MATCH_OR 0x6033
100 #define MASK_OR 0xfe00707f
101 #define MATCH_AND 0x7033
102 #define MASK_AND 0xfe00707f
103 #define MATCH_ADDIW 0x1b
104 #define MASK_ADDIW 0x707f
105 #define MATCH_SLLIW 0x101b
106 #define MASK_SLLIW 0xfe00707f
107 #define MATCH_SRLIW 0x501b
108 #define MASK_SRLIW 0xfe00707f
109 #define MATCH_SRAIW 0x4000501b
110 #define MASK_SRAIW 0xfe00707f
111 #define MATCH_ADDW 0x3b
112 #define MASK_ADDW 0xfe00707f
113 #define MATCH_SUBW 0x4000003b
114 #define MASK_SUBW 0xfe00707f
115 #define MATCH_SLLW 0x103b
116 #define MASK_SLLW 0xfe00707f
117 #define MATCH_SRLW 0x503b
118 #define MASK_SRLW 0xfe00707f
119 #define MATCH_SRAW 0x4000503b
120 #define MASK_SRAW 0xfe00707f
122 #define MASK_LB 0x707f
123 #define MATCH_LH 0x1003
124 #define MASK_LH 0x707f
125 #define MATCH_LW 0x2003
126 #define MASK_LW 0x707f
127 #define MATCH_LD 0x3003
128 #define MASK_LD 0x707f
129 #define MATCH_LBU 0x4003
130 #define MASK_LBU 0x707f
131 #define MATCH_LHU 0x5003
132 #define MASK_LHU 0x707f
133 #define MATCH_LWU 0x6003
134 #define MASK_LWU 0x707f
135 #define MATCH_SB 0x23
136 #define MASK_SB 0x707f
137 #define MATCH_SH 0x1023
138 #define MASK_SH 0x707f
139 #define MATCH_SW 0x2023
140 #define MASK_SW 0x707f
141 #define MATCH_SD 0x3023
142 #define MASK_SD 0x707f
143 #define MATCH_FENCE 0xf
144 #define MASK_FENCE 0x707f
145 #define MATCH_FENCE_I 0x100f
146 #define MASK_FENCE_I 0x707f
147 #define MATCH_MUL 0x2000033
148 #define MASK_MUL 0xfe00707f
149 #define MATCH_MULH 0x2001033
150 #define MASK_MULH 0xfe00707f
151 #define MATCH_MULHSU 0x2002033
152 #define MASK_MULHSU 0xfe00707f
153 #define MATCH_MULHU 0x2003033
154 #define MASK_MULHU 0xfe00707f
155 #define MATCH_DIV 0x2004033
156 #define MASK_DIV 0xfe00707f
157 #define MATCH_DIVU 0x2005033
158 #define MASK_DIVU 0xfe00707f
159 #define MATCH_REM 0x2006033
160 #define MASK_REM 0xfe00707f
161 #define MATCH_REMU 0x2007033
162 #define MASK_REMU 0xfe00707f
163 #define MATCH_MULW 0x200003b
164 #define MASK_MULW 0xfe00707f
165 #define MATCH_DIVW 0x200403b
166 #define MASK_DIVW 0xfe00707f
167 #define MATCH_DIVUW 0x200503b
168 #define MASK_DIVUW 0xfe00707f
169 #define MATCH_REMW 0x200603b
170 #define MASK_REMW 0xfe00707f
171 #define MATCH_REMUW 0x200703b
172 #define MASK_REMUW 0xfe00707f
173 #define MATCH_AMOADD_W 0x202f
174 #define MASK_AMOADD_W 0xf800707f
175 #define MATCH_AMOXOR_W 0x2000202f
176 #define MASK_AMOXOR_W 0xf800707f
177 #define MATCH_AMOOR_W 0x4000202f
178 #define MASK_AMOOR_W 0xf800707f
179 #define MATCH_AMOAND_W 0x6000202f
180 #define MASK_AMOAND_W 0xf800707f
181 #define MATCH_AMOMIN_W 0x8000202f
182 #define MASK_AMOMIN_W 0xf800707f
183 #define MATCH_AMOMAX_W 0xa000202f
184 #define MASK_AMOMAX_W 0xf800707f
185 #define MATCH_AMOMINU_W 0xc000202f
186 #define MASK_AMOMINU_W 0xf800707f
187 #define MATCH_AMOMAXU_W 0xe000202f
188 #define MASK_AMOMAXU_W 0xf800707f
189 #define MATCH_AMOSWAP_W 0x800202f
190 #define MASK_AMOSWAP_W 0xf800707f
191 #define MATCH_LR_W 0x1000202f
192 #define MASK_LR_W 0xf9f0707f
193 #define MATCH_SC_W 0x1800202f
194 #define MASK_SC_W 0xf800707f
195 #define MATCH_AMOADD_D 0x302f
196 #define MASK_AMOADD_D 0xf800707f
197 #define MATCH_AMOXOR_D 0x2000302f
198 #define MASK_AMOXOR_D 0xf800707f
199 #define MATCH_AMOOR_D 0x4000302f
200 #define MASK_AMOOR_D 0xf800707f
201 #define MATCH_AMOAND_D 0x6000302f
202 #define MASK_AMOAND_D 0xf800707f
203 #define MATCH_AMOMIN_D 0x8000302f
204 #define MASK_AMOMIN_D 0xf800707f
205 #define MATCH_AMOMAX_D 0xa000302f
206 #define MASK_AMOMAX_D 0xf800707f
207 #define MATCH_AMOMINU_D 0xc000302f
208 #define MASK_AMOMINU_D 0xf800707f
209 #define MATCH_AMOMAXU_D 0xe000302f
210 #define MASK_AMOMAXU_D 0xf800707f
211 #define MATCH_AMOSWAP_D 0x800302f
212 #define MASK_AMOSWAP_D 0xf800707f
213 #define MATCH_LR_D 0x1000302f
214 #define MASK_LR_D 0xf9f0707f
215 #define MATCH_SC_D 0x1800302f
216 #define MASK_SC_D 0xf800707f
217 #define MATCH_ECALL 0x73
218 #define MASK_ECALL 0xffffffff
219 #define MATCH_EBREAK 0x100073
220 #define MASK_EBREAK 0xffffffff
221 #define MATCH_URET 0x200073
222 #define MASK_URET 0xffffffff
223 #define MATCH_SRET 0x10200073
224 #define MASK_SRET 0xffffffff
225 #define MATCH_HRET 0x20200073
226 #define MASK_HRET 0xffffffff
227 #define MATCH_MRET 0x30200073
228 #define MASK_MRET 0xffffffff
229 #define MATCH_DRET 0x7b200073
230 #define MASK_DRET 0xffffffff
231 #define MATCH_SFENCE_VM 0x10400073
232 #define MASK_SFENCE_VM 0xfff07fff
233 #define MATCH_WFI 0x10500073
234 #define MASK_WFI 0xffffffff
235 #define MATCH_CSRRW 0x1073
236 #define MASK_CSRRW 0x707f
237 #define MATCH_CSRRS 0x2073
238 #define MASK_CSRRS 0x707f
239 #define MATCH_CSRRC 0x3073
240 #define MASK_CSRRC 0x707f
241 #define MATCH_CSRRWI 0x5073
242 #define MASK_CSRRWI 0x707f
243 #define MATCH_CSRRSI 0x6073
244 #define MASK_CSRRSI 0x707f
245 #define MATCH_CSRRCI 0x7073
246 #define MASK_CSRRCI 0x707f
247 #define MATCH_FADD_S 0x53
248 #define MASK_FADD_S 0xfe00007f
249 #define MATCH_FSUB_S 0x8000053
250 #define MASK_FSUB_S 0xfe00007f
251 #define MATCH_FMUL_S 0x10000053
252 #define MASK_FMUL_S 0xfe00007f
253 #define MATCH_FDIV_S 0x18000053
254 #define MASK_FDIV_S 0xfe00007f
255 #define MATCH_FSGNJ_S 0x20000053
256 #define MASK_FSGNJ_S 0xfe00707f
257 #define MATCH_FSGNJN_S 0x20001053
258 #define MASK_FSGNJN_S 0xfe00707f
259 #define MATCH_FSGNJX_S 0x20002053
260 #define MASK_FSGNJX_S 0xfe00707f
261 #define MATCH_FMIN_S 0x28000053
262 #define MASK_FMIN_S 0xfe00707f
263 #define MATCH_FMAX_S 0x28001053
264 #define MASK_FMAX_S 0xfe00707f
265 #define MATCH_FSQRT_S 0x58000053
266 #define MASK_FSQRT_S 0xfff0007f
267 #define MATCH_FADD_D 0x2000053
268 #define MASK_FADD_D 0xfe00007f
269 #define MATCH_FSUB_D 0xa000053
270 #define MASK_FSUB_D 0xfe00007f
271 #define MATCH_FMUL_D 0x12000053
272 #define MASK_FMUL_D 0xfe00007f
273 #define MATCH_FDIV_D 0x1a000053
274 #define MASK_FDIV_D 0xfe00007f
275 #define MATCH_FSGNJ_D 0x22000053
276 #define MASK_FSGNJ_D 0xfe00707f
277 #define MATCH_FSGNJN_D 0x22001053
278 #define MASK_FSGNJN_D 0xfe00707f
279 #define MATCH_FSGNJX_D 0x22002053
280 #define MASK_FSGNJX_D 0xfe00707f
281 #define MATCH_FMIN_D 0x2a000053
282 #define MASK_FMIN_D 0xfe00707f
283 #define MATCH_FMAX_D 0x2a001053
284 #define MASK_FMAX_D 0xfe00707f
285 #define MATCH_FCVT_S_D 0x40100053
286 #define MASK_FCVT_S_D 0xfff0007f
287 #define MATCH_FCVT_D_S 0x42000053
288 #define MASK_FCVT_D_S 0xfff0007f
289 #define MATCH_FSQRT_D 0x5a000053
290 #define MASK_FSQRT_D 0xfff0007f
291 #define MATCH_FADD_Q 0x6000053
292 #define MASK_FADD_Q 0xfe00007f
293 #define MATCH_FSUB_Q 0xe000053
294 #define MASK_FSUB_Q 0xfe00007f
295 #define MATCH_FMUL_Q 0x16000053
296 #define MASK_FMUL_Q 0xfe00007f
297 #define MATCH_FDIV_Q 0x1e000053
298 #define MASK_FDIV_Q 0xfe00007f
299 #define MATCH_FSGNJ_Q 0x26000053
300 #define MASK_FSGNJ_Q 0xfe00707f
301 #define MATCH_FSGNJN_Q 0x26001053
302 #define MASK_FSGNJN_Q 0xfe00707f
303 #define MATCH_FSGNJX_Q 0x26002053
304 #define MASK_FSGNJX_Q 0xfe00707f
305 #define MATCH_FMIN_Q 0x2e000053
306 #define MASK_FMIN_Q 0xfe00707f
307 #define MATCH_FMAX_Q 0x2e001053
308 #define MASK_FMAX_Q 0xfe00707f
309 #define MATCH_FCVT_S_Q 0x40300053
310 #define MASK_FCVT_S_Q 0xfff0007f
311 #define MATCH_FCVT_Q_S 0x46000053
312 #define MASK_FCVT_Q_S 0xfff0007f
313 #define MATCH_FCVT_D_Q 0x42300053
314 #define MASK_FCVT_D_Q 0xfff0007f
315 #define MATCH_FCVT_Q_D 0x46100053
316 #define MASK_FCVT_Q_D 0xfff0007f
317 #define MATCH_FSQRT_Q 0x5e000053
318 #define MASK_FSQRT_Q 0xfff0007f
319 #define MATCH_FLE_S 0xa0000053
320 #define MASK_FLE_S 0xfe00707f
321 #define MATCH_FLT_S 0xa0001053
322 #define MASK_FLT_S 0xfe00707f
323 #define MATCH_FEQ_S 0xa0002053
324 #define MASK_FEQ_S 0xfe00707f
325 #define MATCH_FLE_D 0xa2000053
326 #define MASK_FLE_D 0xfe00707f
327 #define MATCH_FLT_D 0xa2001053
328 #define MASK_FLT_D 0xfe00707f
329 #define MATCH_FEQ_D 0xa2002053
330 #define MASK_FEQ_D 0xfe00707f
331 #define MATCH_FLE_Q 0xa6000053
332 #define MASK_FLE_Q 0xfe00707f
333 #define MATCH_FLT_Q 0xa6001053
334 #define MASK_FLT_Q 0xfe00707f
335 #define MATCH_FEQ_Q 0xa6002053
336 #define MASK_FEQ_Q 0xfe00707f
337 #define MATCH_FCVT_W_S 0xc0000053
338 #define MASK_FCVT_W_S 0xfff0007f
339 #define MATCH_FCVT_WU_S 0xc0100053
340 #define MASK_FCVT_WU_S 0xfff0007f
341 #define MATCH_FCVT_L_S 0xc0200053
342 #define MASK_FCVT_L_S 0xfff0007f
343 #define MATCH_FCVT_LU_S 0xc0300053
344 #define MASK_FCVT_LU_S 0xfff0007f
345 #define MATCH_FMV_X_S 0xe0000053
346 #define MASK_FMV_X_S 0xfff0707f
347 #define MATCH_FCLASS_S 0xe0001053
348 #define MASK_FCLASS_S 0xfff0707f
349 #define MATCH_FCVT_W_D 0xc2000053
350 #define MASK_FCVT_W_D 0xfff0007f
351 #define MATCH_FCVT_WU_D 0xc2100053
352 #define MASK_FCVT_WU_D 0xfff0007f
353 #define MATCH_FCVT_L_D 0xc2200053
354 #define MASK_FCVT_L_D 0xfff0007f
355 #define MATCH_FCVT_LU_D 0xc2300053
356 #define MASK_FCVT_LU_D 0xfff0007f
357 #define MATCH_FMV_X_D 0xe2000053
358 #define MASK_FMV_X_D 0xfff0707f
359 #define MATCH_FCLASS_D 0xe2001053
360 #define MASK_FCLASS_D 0xfff0707f
361 #define MATCH_FCVT_W_Q 0xc6000053
362 #define MASK_FCVT_W_Q 0xfff0007f
363 #define MATCH_FCVT_WU_Q 0xc6100053
364 #define MASK_FCVT_WU_Q 0xfff0007f
365 #define MATCH_FCVT_L_Q 0xc6200053
366 #define MASK_FCVT_L_Q 0xfff0007f
367 #define MATCH_FCVT_LU_Q 0xc6300053
368 #define MASK_FCVT_LU_Q 0xfff0007f
369 #define MATCH_FMV_X_Q 0xe6000053
370 #define MASK_FMV_X_Q 0xfff0707f
371 #define MATCH_FCLASS_Q 0xe6001053
372 #define MASK_FCLASS_Q 0xfff0707f
373 #define MATCH_FCVT_S_W 0xd0000053
374 #define MASK_FCVT_S_W 0xfff0007f
375 #define MATCH_FCVT_S_WU 0xd0100053
376 #define MASK_FCVT_S_WU 0xfff0007f
377 #define MATCH_FCVT_S_L 0xd0200053
378 #define MASK_FCVT_S_L 0xfff0007f
379 #define MATCH_FCVT_S_LU 0xd0300053
380 #define MASK_FCVT_S_LU 0xfff0007f
381 #define MATCH_FMV_S_X 0xf0000053
382 #define MASK_FMV_S_X 0xfff0707f
383 #define MATCH_FCVT_D_W 0xd2000053
384 #define MASK_FCVT_D_W 0xfff0007f
385 #define MATCH_FCVT_D_WU 0xd2100053
386 #define MASK_FCVT_D_WU 0xfff0007f
387 #define MATCH_FCVT_D_L 0xd2200053
388 #define MASK_FCVT_D_L 0xfff0007f
389 #define MATCH_FCVT_D_LU 0xd2300053
390 #define MASK_FCVT_D_LU 0xfff0007f
391 #define MATCH_FMV_D_X 0xf2000053
392 #define MASK_FMV_D_X 0xfff0707f
393 #define MATCH_FCVT_Q_W 0xd6000053
394 #define MASK_FCVT_Q_W 0xfff0007f
395 #define MATCH_FCVT_Q_WU 0xd6100053
396 #define MASK_FCVT_Q_WU 0xfff0007f
397 #define MATCH_FCVT_Q_L 0xd6200053
398 #define MASK_FCVT_Q_L 0xfff0007f
399 #define MATCH_FCVT_Q_LU 0xd6300053
400 #define MASK_FCVT_Q_LU 0xfff0007f
401 #define MATCH_FMV_Q_X 0xf6000053
402 #define MASK_FMV_Q_X 0xfff0707f
403 #define MATCH_FLW 0x2007
404 #define MASK_FLW 0x707f
405 #define MATCH_FLD 0x3007
406 #define MASK_FLD 0x707f
407 #define MATCH_FLQ 0x4007
408 #define MASK_FLQ 0x707f
409 #define MATCH_FSW 0x2027
410 #define MASK_FSW 0x707f
411 #define MATCH_FSD 0x3027
412 #define MASK_FSD 0x707f
413 #define MATCH_FSQ 0x4027
414 #define MASK_FSQ 0x707f
415 #define MATCH_FMADD_S 0x43
416 #define MASK_FMADD_S 0x600007f
417 #define MATCH_FMSUB_S 0x47
418 #define MASK_FMSUB_S 0x600007f
419 #define MATCH_FNMSUB_S 0x4b
420 #define MASK_FNMSUB_S 0x600007f
421 #define MATCH_FNMADD_S 0x4f
422 #define MASK_FNMADD_S 0x600007f
423 #define MATCH_FMADD_D 0x2000043
424 #define MASK_FMADD_D 0x600007f
425 #define MATCH_FMSUB_D 0x2000047
426 #define MASK_FMSUB_D 0x600007f
427 #define MATCH_FNMSUB_D 0x200004b
428 #define MASK_FNMSUB_D 0x600007f
429 #define MATCH_FNMADD_D 0x200004f
430 #define MASK_FNMADD_D 0x600007f
431 #define MATCH_FMADD_Q 0x6000043
432 #define MASK_FMADD_Q 0x600007f
433 #define MATCH_FMSUB_Q 0x6000047
434 #define MASK_FMSUB_Q 0x600007f
435 #define MATCH_FNMSUB_Q 0x600004b
436 #define MASK_FNMSUB_Q 0x600007f
437 #define MATCH_FNMADD_Q 0x600004f
438 #define MASK_FNMADD_Q 0x600007f
439 #define MATCH_C_ADDI4SPN 0x0
440 #define MASK_C_ADDI4SPN 0xe003
441 #define MATCH_C_FLD 0x2000
442 #define MASK_C_FLD 0xe003
443 #define MATCH_C_LW 0x4000
444 #define MASK_C_LW 0xe003
445 #define MATCH_C_FLW 0x6000
446 #define MASK_C_FLW 0xe003
447 #define MATCH_C_FSD 0xa000
448 #define MASK_C_FSD 0xe003
449 #define MATCH_C_SW 0xc000
450 #define MASK_C_SW 0xe003
451 #define MATCH_C_FSW 0xe000
452 #define MASK_C_FSW 0xe003
453 #define MATCH_C_ADDI 0x1
454 #define MASK_C_ADDI 0xe003
455 #define MATCH_C_JAL 0x2001
456 #define MASK_C_JAL 0xe003
457 #define MATCH_C_LI 0x4001
458 #define MASK_C_LI 0xe003
459 #define MATCH_C_LUI 0x6001
460 #define MASK_C_LUI 0xe003
461 #define MATCH_C_SRLI 0x8001
462 #define MASK_C_SRLI 0xec03
463 #define MATCH_C_SRAI 0x8401
464 #define MASK_C_SRAI 0xec03
465 #define MATCH_C_ANDI 0x8801
466 #define MASK_C_ANDI 0xec03
467 #define MATCH_C_SUB 0x8c01
468 #define MASK_C_SUB 0xfc63
469 #define MATCH_C_XOR 0x8c21
470 #define MASK_C_XOR 0xfc63
471 #define MATCH_C_OR 0x8c41
472 #define MASK_C_OR 0xfc63
473 #define MATCH_C_AND 0x8c61
474 #define MASK_C_AND 0xfc63
475 #define MATCH_C_SUBW 0x9c01
476 #define MASK_C_SUBW 0xfc63
477 #define MATCH_C_ADDW 0x9c21
478 #define MASK_C_ADDW 0xfc63
479 #define MATCH_C_J 0xa001
480 #define MASK_C_J 0xe003
481 #define MATCH_C_BEQZ 0xc001
482 #define MASK_C_BEQZ 0xe003
483 #define MATCH_C_BNEZ 0xe001
484 #define MASK_C_BNEZ 0xe003
485 #define MATCH_C_SLLI 0x2
486 #define MASK_C_SLLI 0xe003
487 #define MATCH_C_FLDSP 0x2002
488 #define MASK_C_FLDSP 0xe003
489 #define MATCH_C_LWSP 0x4002
490 #define MASK_C_LWSP 0xe003
491 #define MATCH_C_FLWSP 0x6002
492 #define MASK_C_FLWSP 0xe003
493 #define MATCH_C_MV 0x8002
494 #define MASK_C_MV 0xf003
495 #define MATCH_C_ADD 0x9002
496 #define MASK_C_ADD 0xf003
497 #define MATCH_C_FSDSP 0xa002
498 #define MASK_C_FSDSP 0xe003
499 #define MATCH_C_SWSP 0xc002
500 #define MASK_C_SWSP 0xe003
501 #define MATCH_C_FSWSP 0xe002
502 #define MASK_C_FSWSP 0xe003
503 #define MATCH_C_NOP 0x1
504 #define MASK_C_NOP 0xffff
505 #define MATCH_C_ADDI16SP 0x6101
506 #define MASK_C_ADDI16SP 0xef83
507 #define MATCH_C_JR 0x8002
508 #define MASK_C_JR 0xf07f
509 #define MATCH_C_JALR 0x9002
510 #define MASK_C_JALR 0xf07f
511 #define MATCH_C_EBREAK 0x9002
512 #define MASK_C_EBREAK 0xffff
513 #define MATCH_C_LD 0x6000
514 #define MASK_C_LD 0xe003
515 #define MATCH_C_SD 0xe000
516 #define MASK_C_SD 0xe003
517 #define MATCH_C_ADDIW 0x2001
518 #define MASK_C_ADDIW 0xe003
519 #define MATCH_C_LDSP 0x6002
520 #define MASK_C_LDSP 0xe003
521 #define MATCH_C_SDSP 0xe002
522 #define MASK_C_SDSP 0xe003
523 #define MATCH_CUSTOM0 0xb
524 #define MASK_CUSTOM0 0x707f
525 #define MATCH_CUSTOM0_RS1 0x200b
526 #define MASK_CUSTOM0_RS1 0x707f
527 #define MATCH_CUSTOM0_RS1_RS2 0x300b
528 #define MASK_CUSTOM0_RS1_RS2 0x707f
529 #define MATCH_CUSTOM0_RD 0x400b
530 #define MASK_CUSTOM0_RD 0x707f
531 #define MATCH_CUSTOM0_RD_RS1 0x600b
532 #define MASK_CUSTOM0_RD_RS1 0x707f
533 #define MATCH_CUSTOM0_RD_RS1_RS2 0x700b
534 #define MASK_CUSTOM0_RD_RS1_RS2 0x707f
535 #define MATCH_CUSTOM1 0x2b
536 #define MASK_CUSTOM1 0x707f
537 #define MATCH_CUSTOM1_RS1 0x202b
538 #define MASK_CUSTOM1_RS1 0x707f
539 #define MATCH_CUSTOM1_RS1_RS2 0x302b
540 #define MASK_CUSTOM1_RS1_RS2 0x707f
541 #define MATCH_CUSTOM1_RD 0x402b
542 #define MASK_CUSTOM1_RD 0x707f
543 #define MATCH_CUSTOM1_RD_RS1 0x602b
544 #define MASK_CUSTOM1_RD_RS1 0x707f
545 #define MATCH_CUSTOM1_RD_RS1_RS2 0x702b
546 #define MASK_CUSTOM1_RD_RS1_RS2 0x707f
547 #define MATCH_CUSTOM2 0x5b
548 #define MASK_CUSTOM2 0x707f
549 #define MATCH_CUSTOM2_RS1 0x205b
550 #define MASK_CUSTOM2_RS1 0x707f
551 #define MATCH_CUSTOM2_RS1_RS2 0x305b
552 #define MASK_CUSTOM2_RS1_RS2 0x707f
553 #define MATCH_CUSTOM2_RD 0x405b
554 #define MASK_CUSTOM2_RD 0x707f
555 #define MATCH_CUSTOM2_RD_RS1 0x605b
556 #define MASK_CUSTOM2_RD_RS1 0x707f
557 #define MATCH_CUSTOM2_RD_RS1_RS2 0x705b
558 #define MASK_CUSTOM2_RD_RS1_RS2 0x707f
559 #define MATCH_CUSTOM3 0x7b
560 #define MASK_CUSTOM3 0x707f
561 #define MATCH_CUSTOM3_RS1 0x207b
562 #define MASK_CUSTOM3_RS1 0x707f
563 #define MATCH_CUSTOM3_RS1_RS2 0x307b
564 #define MASK_CUSTOM3_RS1_RS2 0x707f
565 #define MATCH_CUSTOM3_RD 0x407b
566 #define MASK_CUSTOM3_RD 0x707f
567 #define MATCH_CUSTOM3_RD_RS1 0x607b
568 #define MASK_CUSTOM3_RD_RS1 0x707f
569 #define MATCH_CUSTOM3_RD_RS1_RS2 0x707b
570 #define MASK_CUSTOM3_RD_RS1_RS2 0x707f
571 #define CSR_FFLAGS 0x1
574 #define CSR_CYCLE 0xc00
575 #define CSR_TIME 0xc01
576 #define CSR_INSTRET 0xc02
577 #define CSR_HPMCOUNTER3 0xc03
578 #define CSR_HPMCOUNTER4 0xc04
579 #define CSR_HPMCOUNTER5 0xc05
580 #define CSR_HPMCOUNTER6 0xc06
581 #define CSR_HPMCOUNTER7 0xc07
582 #define CSR_HPMCOUNTER8 0xc08
583 #define CSR_HPMCOUNTER9 0xc09
584 #define CSR_HPMCOUNTER10 0xc0a
585 #define CSR_HPMCOUNTER11 0xc0b
586 #define CSR_HPMCOUNTER12 0xc0c
587 #define CSR_HPMCOUNTER13 0xc0d
588 #define CSR_HPMCOUNTER14 0xc0e
589 #define CSR_HPMCOUNTER15 0xc0f
590 #define CSR_HPMCOUNTER16 0xc10
591 #define CSR_HPMCOUNTER17 0xc11
592 #define CSR_HPMCOUNTER18 0xc12
593 #define CSR_HPMCOUNTER19 0xc13
594 #define CSR_HPMCOUNTER20 0xc14
595 #define CSR_HPMCOUNTER21 0xc15
596 #define CSR_HPMCOUNTER22 0xc16
597 #define CSR_HPMCOUNTER23 0xc17
598 #define CSR_HPMCOUNTER24 0xc18
599 #define CSR_HPMCOUNTER25 0xc19
600 #define CSR_HPMCOUNTER26 0xc1a
601 #define CSR_HPMCOUNTER27 0xc1b
602 #define CSR_HPMCOUNTER28 0xc1c
603 #define CSR_HPMCOUNTER29 0xc1d
604 #define CSR_HPMCOUNTER30 0xc1e
605 #define CSR_HPMCOUNTER31 0xc1f
606 #define CSR_SSTATUS 0x100
607 #define CSR_SIE 0x104
608 #define CSR_STVEC 0x105
609 #define CSR_SSCRATCH 0x140
610 #define CSR_SEPC 0x141
611 #define CSR_SCAUSE 0x142
612 #define CSR_SBADADDR 0x143
613 #define CSR_SIP 0x144
614 #define CSR_SPTBR 0x180
615 #define CSR_MSTATUS 0x300
616 #define CSR_MISA 0x301
617 #define CSR_MEDELEG 0x302
618 #define CSR_MIDELEG 0x303
619 #define CSR_MIE 0x304
620 #define CSR_MTVEC 0x305
621 #define CSR_MSCRATCH 0x340
622 #define CSR_MEPC 0x341
623 #define CSR_MCAUSE 0x342
624 #define CSR_MBADADDR 0x343
625 #define CSR_MIP 0x344
626 #define CSR_TSELECT 0x7a0
627 #define CSR_TDATA1 0x7a1
628 #define CSR_TDATA2 0x7a2
629 #define CSR_TDATA3 0x7a3
630 #define CSR_DCSR 0x7b0
631 #define CSR_DPC 0x7b1
632 #define CSR_DSCRATCH 0x7b2
633 #define CSR_MCYCLE 0xb00
634 #define CSR_MINSTRET 0xb02
635 #define CSR_MHPMCOUNTER3 0xb03
636 #define CSR_MHPMCOUNTER4 0xb04
637 #define CSR_MHPMCOUNTER5 0xb05
638 #define CSR_MHPMCOUNTER6 0xb06
639 #define CSR_MHPMCOUNTER7 0xb07
640 #define CSR_MHPMCOUNTER8 0xb08
641 #define CSR_MHPMCOUNTER9 0xb09
642 #define CSR_MHPMCOUNTER10 0xb0a
643 #define CSR_MHPMCOUNTER11 0xb0b
644 #define CSR_MHPMCOUNTER12 0xb0c
645 #define CSR_MHPMCOUNTER13 0xb0d
646 #define CSR_MHPMCOUNTER14 0xb0e
647 #define CSR_MHPMCOUNTER15 0xb0f
648 #define CSR_MHPMCOUNTER16 0xb10
649 #define CSR_MHPMCOUNTER17 0xb11
650 #define CSR_MHPMCOUNTER18 0xb12
651 #define CSR_MHPMCOUNTER19 0xb13
652 #define CSR_MHPMCOUNTER20 0xb14
653 #define CSR_MHPMCOUNTER21 0xb15
654 #define CSR_MHPMCOUNTER22 0xb16
655 #define CSR_MHPMCOUNTER23 0xb17
656 #define CSR_MHPMCOUNTER24 0xb18
657 #define CSR_MHPMCOUNTER25 0xb19
658 #define CSR_MHPMCOUNTER26 0xb1a
659 #define CSR_MHPMCOUNTER27 0xb1b
660 #define CSR_MHPMCOUNTER28 0xb1c
661 #define CSR_MHPMCOUNTER29 0xb1d
662 #define CSR_MHPMCOUNTER30 0xb1e
663 #define CSR_MHPMCOUNTER31 0xb1f
664 #define CSR_MUCOUNTEREN 0x320
665 #define CSR_MSCOUNTEREN 0x321
666 #define CSR_MHPMEVENT3 0x323
667 #define CSR_MHPMEVENT4 0x324
668 #define CSR_MHPMEVENT5 0x325
669 #define CSR_MHPMEVENT6 0x326
670 #define CSR_MHPMEVENT7 0x327
671 #define CSR_MHPMEVENT8 0x328
672 #define CSR_MHPMEVENT9 0x329
673 #define CSR_MHPMEVENT10 0x32a
674 #define CSR_MHPMEVENT11 0x32b
675 #define CSR_MHPMEVENT12 0x32c
676 #define CSR_MHPMEVENT13 0x32d
677 #define CSR_MHPMEVENT14 0x32e
678 #define CSR_MHPMEVENT15 0x32f
679 #define CSR_MHPMEVENT16 0x330
680 #define CSR_MHPMEVENT17 0x331
681 #define CSR_MHPMEVENT18 0x332
682 #define CSR_MHPMEVENT19 0x333
683 #define CSR_MHPMEVENT20 0x334
684 #define CSR_MHPMEVENT21 0x335
685 #define CSR_MHPMEVENT22 0x336
686 #define CSR_MHPMEVENT23 0x337
687 #define CSR_MHPMEVENT24 0x338
688 #define CSR_MHPMEVENT25 0x339
689 #define CSR_MHPMEVENT26 0x33a
690 #define CSR_MHPMEVENT27 0x33b
691 #define CSR_MHPMEVENT28 0x33c
692 #define CSR_MHPMEVENT29 0x33d
693 #define CSR_MHPMEVENT30 0x33e
694 #define CSR_MHPMEVENT31 0x33f
695 #define CSR_MVENDORID 0xf11
696 #define CSR_MARCHID 0xf12
697 #define CSR_MIMPID 0xf13
698 #define CSR_MHARTID 0xf14
699 #define CSR_CYCLEH 0xc80
700 #define CSR_TIMEH 0xc81
701 #define CSR_INSTRETH 0xc82
702 #define CSR_HPMCOUNTER3H 0xc83
703 #define CSR_HPMCOUNTER4H 0xc84
704 #define CSR_HPMCOUNTER5H 0xc85
705 #define CSR_HPMCOUNTER6H 0xc86
706 #define CSR_HPMCOUNTER7H 0xc87
707 #define CSR_HPMCOUNTER8H 0xc88
708 #define CSR_HPMCOUNTER9H 0xc89
709 #define CSR_HPMCOUNTER10H 0xc8a
710 #define CSR_HPMCOUNTER11H 0xc8b
711 #define CSR_HPMCOUNTER12H 0xc8c
712 #define CSR_HPMCOUNTER13H 0xc8d
713 #define CSR_HPMCOUNTER14H 0xc8e
714 #define CSR_HPMCOUNTER15H 0xc8f
715 #define CSR_HPMCOUNTER16H 0xc90
716 #define CSR_HPMCOUNTER17H 0xc91
717 #define CSR_HPMCOUNTER18H 0xc92
718 #define CSR_HPMCOUNTER19H 0xc93
719 #define CSR_HPMCOUNTER20H 0xc94
720 #define CSR_HPMCOUNTER21H 0xc95
721 #define CSR_HPMCOUNTER22H 0xc96
722 #define CSR_HPMCOUNTER23H 0xc97
723 #define CSR_HPMCOUNTER24H 0xc98
724 #define CSR_HPMCOUNTER25H 0xc99
725 #define CSR_HPMCOUNTER26H 0xc9a
726 #define CSR_HPMCOUNTER27H 0xc9b
727 #define CSR_HPMCOUNTER28H 0xc9c
728 #define CSR_HPMCOUNTER29H 0xc9d
729 #define CSR_HPMCOUNTER30H 0xc9e
730 #define CSR_HPMCOUNTER31H 0xc9f
731 #define CSR_MCYCLEH 0xb80
732 #define CSR_MINSTRETH 0xb82
733 #define CSR_MHPMCOUNTER3H 0xb83
734 #define CSR_MHPMCOUNTER4H 0xb84
735 #define CSR_MHPMCOUNTER5H 0xb85
736 #define CSR_MHPMCOUNTER6H 0xb86
737 #define CSR_MHPMCOUNTER7H 0xb87
738 #define CSR_MHPMCOUNTER8H 0xb88
739 #define CSR_MHPMCOUNTER9H 0xb89
740 #define CSR_MHPMCOUNTER10H 0xb8a
741 #define CSR_MHPMCOUNTER11H 0xb8b
742 #define CSR_MHPMCOUNTER12H 0xb8c
743 #define CSR_MHPMCOUNTER13H 0xb8d
744 #define CSR_MHPMCOUNTER14H 0xb8e
745 #define CSR_MHPMCOUNTER15H 0xb8f
746 #define CSR_MHPMCOUNTER16H 0xb90
747 #define CSR_MHPMCOUNTER17H 0xb91
748 #define CSR_MHPMCOUNTER18H 0xb92
749 #define CSR_MHPMCOUNTER19H 0xb93
750 #define CSR_MHPMCOUNTER20H 0xb94
751 #define CSR_MHPMCOUNTER21H 0xb95
752 #define CSR_MHPMCOUNTER22H 0xb96
753 #define CSR_MHPMCOUNTER23H 0xb97
754 #define CSR_MHPMCOUNTER24H 0xb98
755 #define CSR_MHPMCOUNTER25H 0xb99
756 #define CSR_MHPMCOUNTER26H 0xb9a
757 #define CSR_MHPMCOUNTER27H 0xb9b
758 #define CSR_MHPMCOUNTER28H 0xb9c
759 #define CSR_MHPMCOUNTER29H 0xb9d
760 #define CSR_MHPMCOUNTER30H 0xb9e
761 #define CSR_MHPMCOUNTER31H 0xb9f
762 #define CAUSE_MISALIGNED_FETCH 0x0
763 #define CAUSE_FAULT_FETCH 0x1
764 #define CAUSE_ILLEGAL_INSTRUCTION 0x2
765 #define CAUSE_BREAKPOINT 0x3
766 #define CAUSE_MISALIGNED_LOAD 0x4
767 #define CAUSE_FAULT_LOAD 0x5
768 #define CAUSE_MISALIGNED_STORE 0x6
769 #define CAUSE_FAULT_STORE 0x7
770 #define CAUSE_USER_ECALL 0x8
771 #define CAUSE_SUPERVISOR_ECALL 0x9
772 #define CAUSE_HYPERVISOR_ECALL 0xa
773 #define CAUSE_MACHINE_ECALL 0xb
1252 #ifdef DECLARE_CAUSE
#define DECLARE_CSR(name, num)
static RzILOpEffect * mul(cs_insn *insn, bool is_thumb)
static static fork const void static count static fd const char const char static newpath char char char static envp time
#define MATCH_CUSTOM1_RS1_RS2
#define CSR_MHPMCOUNTER17H
#define MATCH_CUSTOM0_RS1_RS2
#define CAUSE_ILLEGAL_INSTRUCTION
#define CSR_MHPMCOUNTER16
#define CSR_HPMCOUNTER25H
#define CAUSE_MISALIGNED_LOAD
#define CSR_MHPMCOUNTER7H
#define CSR_MHPMCOUNTER27H
#define MATCH_CUSTOM1_RD_RS1_RS2
#define CSR_MHPMCOUNTER25
#define CSR_MHPMCOUNTER20
#define CSR_MHPMCOUNTER28
#define CAUSE_MACHINE_ECALL
#define CSR_MHPMCOUNTER31
#define CSR_HPMCOUNTER22H
#define CSR_MHPMCOUNTER18H
#define MASK_CUSTOM3_RD_RS1
#define CSR_MHPMCOUNTER21H
#define MATCH_CUSTOM1_RD_RS1
#define CSR_HPMCOUNTER15H
#define MASK_CUSTOM2_RD_RS1
#define MASK_CUSTOM1_RD_RS1
#define CSR_HPMCOUNTER12H
#define CSR_HPMCOUNTER19H
#define CSR_MHPMCOUNTER28H
#define CSR_MHPMCOUNTER21
#define CSR_MHPMCOUNTER9H
#define CSR_MHPMCOUNTER29H
#define CSR_MHPMCOUNTER26
#define CSR_MHPMCOUNTER14
#define MATCH_CUSTOM3_RD_RS1_RS2
#define CSR_MHPMCOUNTER10H
#define MATCH_CUSTOM2_RS1_RS2
#define MASK_CUSTOM1_RS1_RS2
#define CSR_MHPMCOUNTER11H
#define CSR_MHPMCOUNTER12H
#define MATCH_CUSTOM0_RS1
#define MATCH_CUSTOM1_RS1
#define CSR_HPMCOUNTER31H
#define CSR_MHPMCOUNTER25H
#define MATCH_CUSTOM0_RD_RS1_RS2
#define CSR_MHPMCOUNTER26H
#define CSR_HPMCOUNTER27H
#define MASK_CUSTOM3_RD_RS1_RS2
#define CSR_HPMCOUNTER17H
#define CSR_MHPMCOUNTER5H
#define CSR_HPMCOUNTER21H
#define CSR_MHPMCOUNTER24H
#define MATCH_CUSTOM3_RS1_RS2
#define CSR_HPMCOUNTER18H
#define MASK_CUSTOM2_RD_RS1_RS2
#define CSR_MHPMCOUNTER8H
#define CSR_MHPMCOUNTER3H
#define CSR_HPMCOUNTER14H
#define CSR_MHPMCOUNTER12
#define CSR_MHPMCOUNTER20H
#define MASK_CUSTOM0_RD_RS1_RS2
#define CAUSE_FAULT_STORE
#define MATCH_CUSTOM2_RS1
#define MATCH_CUSTOM0_RD_RS1
#define MATCH_CUSTOM3_RD_RS1
#define CAUSE_HYPERVISOR_ECALL
#define CSR_HPMCOUNTER28H
#define CSR_MHPMCOUNTER31H
#define CSR_MHPMCOUNTER6H
#define MASK_CUSTOM1_RD_RS1_RS2
#define CSR_HPMCOUNTER16H
#define CAUSE_MISALIGNED_FETCH
#define CSR_MHPMCOUNTER23H
#define CSR_HPMCOUNTER20H
#define CSR_MHPMCOUNTER17
#define CSR_MHPMCOUNTER11
#define MATCH_CUSTOM2_RD_RS1_RS2
#define MASK_CUSTOM0_RD_RS1
#define CSR_MHPMCOUNTER15H
#define CSR_HPMCOUNTER23H
#define CSR_HPMCOUNTER30H
#define CSR_MHPMCOUNTER10
#define CSR_MHPMCOUNTER14H
#define MATCH_CUSTOM2_RD_RS1
#define CSR_MHPMCOUNTER29
#define CAUSE_FAULT_FETCH
#define CSR_HPMCOUNTER13H
#define CAUSE_SUPERVISOR_ECALL
#define CSR_MHPMCOUNTER27
#define CSR_MHPMCOUNTER18
#define CSR_MHPMCOUNTER13H
#define CSR_HPMCOUNTER26H
#define MASK_CUSTOM2_RS1_RS2
#define CSR_MHPMCOUNTER4H
#define CSR_MHPMCOUNTER23
#define CSR_MHPMCOUNTER24
#define CAUSE_MISALIGNED_STORE
#define CSR_MHPMCOUNTER15
#define CSR_MHPMCOUNTER22
#define CSR_MHPMCOUNTER13
#define MASK_CUSTOM0_RS1_RS2
#define MATCH_CUSTOM3_RS1
#define CSR_MHPMCOUNTER30
#define CSR_HPMCOUNTER11H
#define CSR_HPMCOUNTER24H
#define CSR_MHPMCOUNTER22H
#define CSR_HPMCOUNTER29H
#define CSR_HPMCOUNTER10H
#define CSR_MHPMCOUNTER19H
#define CSR_MHPMCOUNTER16H
#define MASK_CUSTOM3_RS1_RS2
#define CSR_MHPMCOUNTER30H
#define CSR_MHPMCOUNTER19