1#ifndef CAPSTONE_MIPS_H
2#define CAPSTONE_MIPS_H
3
4/* Capstone Disassembly Engine */
5/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#include "platform.h"
12
13// GCC MIPS toolchain has a default macro called "mips" which breaks
14// compilation
15#undef mips
16
17#ifdef _MSC_VER
18#pragma warning(disable:4201)
19#endif
20
21/// Operand type for instruction's operands
22typedef enum mips_op_type {
23 MIPS_OP_INVALID = 0, ///< = CS_OP_INVALID (Uninitialized).
24 MIPS_OP_REG, ///< = CS_OP_REG (Register operand).
25 MIPS_OP_IMM, ///< = CS_OP_IMM (Immediate operand).
26 MIPS_OP_MEM, ///< = CS_OP_MEM (Memory operand).
27} mips_op_type;
28
29/// MIPS registers
30typedef enum mips_reg {
31 MIPS_REG_INVALID = 0,
32 // General purpose registers
33 MIPS_REG_PC,
34
35 MIPS_REG_0,
36 MIPS_REG_1,
37 MIPS_REG_2,
38 MIPS_REG_3,
39 MIPS_REG_4,
40 MIPS_REG_5,
41 MIPS_REG_6,
42 MIPS_REG_7,
43 MIPS_REG_8,
44 MIPS_REG_9,
45 MIPS_REG_10,
46 MIPS_REG_11,
47 MIPS_REG_12,
48 MIPS_REG_13,
49 MIPS_REG_14,
50 MIPS_REG_15,
51 MIPS_REG_16,
52 MIPS_REG_17,
53 MIPS_REG_18,
54 MIPS_REG_19,
55 MIPS_REG_20,
56 MIPS_REG_21,
57 MIPS_REG_22,
58 MIPS_REG_23,
59 MIPS_REG_24,
60 MIPS_REG_25,
61 MIPS_REG_26,
62 MIPS_REG_27,
63 MIPS_REG_28,
64 MIPS_REG_29,
65 MIPS_REG_30,
66 MIPS_REG_31,
67
68 // DSP registers
69 MIPS_REG_DSPCCOND,
70 MIPS_REG_DSPCARRY,
71 MIPS_REG_DSPEFI,
72 MIPS_REG_DSPOUTFLAG,
73 MIPS_REG_DSPOUTFLAG16_19,
74 MIPS_REG_DSPOUTFLAG20,
75 MIPS_REG_DSPOUTFLAG21,
76 MIPS_REG_DSPOUTFLAG22,
77 MIPS_REG_DSPOUTFLAG23,
78 MIPS_REG_DSPPOS,
79 MIPS_REG_DSPSCOUNT,
80
81 // ACC registers
82 MIPS_REG_AC0,
83 MIPS_REG_AC1,
84 MIPS_REG_AC2,
85 MIPS_REG_AC3,
86
87 // COP registers
88 MIPS_REG_CC0,
89 MIPS_REG_CC1,
90 MIPS_REG_CC2,
91 MIPS_REG_CC3,
92 MIPS_REG_CC4,
93 MIPS_REG_CC5,
94 MIPS_REG_CC6,
95 MIPS_REG_CC7,
96
97 // FPU registers
98 MIPS_REG_F0,
99 MIPS_REG_F1,
100 MIPS_REG_F2,
101 MIPS_REG_F3,
102 MIPS_REG_F4,
103 MIPS_REG_F5,
104 MIPS_REG_F6,
105 MIPS_REG_F7,
106 MIPS_REG_F8,
107 MIPS_REG_F9,
108 MIPS_REG_F10,
109 MIPS_REG_F11,
110 MIPS_REG_F12,
111 MIPS_REG_F13,
112 MIPS_REG_F14,
113 MIPS_REG_F15,
114 MIPS_REG_F16,
115 MIPS_REG_F17,
116 MIPS_REG_F18,
117 MIPS_REG_F19,
118 MIPS_REG_F20,
119 MIPS_REG_F21,
120 MIPS_REG_F22,
121 MIPS_REG_F23,
122 MIPS_REG_F24,
123 MIPS_REG_F25,
124 MIPS_REG_F26,
125 MIPS_REG_F27,
126 MIPS_REG_F28,
127 MIPS_REG_F29,
128 MIPS_REG_F30,
129 MIPS_REG_F31,
130
131 MIPS_REG_FCC0,
132 MIPS_REG_FCC1,
133 MIPS_REG_FCC2,
134 MIPS_REG_FCC3,
135 MIPS_REG_FCC4,
136 MIPS_REG_FCC5,
137 MIPS_REG_FCC6,
138 MIPS_REG_FCC7,
139
140 // AFPR128
141 MIPS_REG_W0,
142 MIPS_REG_W1,
143 MIPS_REG_W2,
144 MIPS_REG_W3,
145 MIPS_REG_W4,
146 MIPS_REG_W5,
147 MIPS_REG_W6,
148 MIPS_REG_W7,
149 MIPS_REG_W8,
150 MIPS_REG_W9,
151 MIPS_REG_W10,
152 MIPS_REG_W11,
153 MIPS_REG_W12,
154 MIPS_REG_W13,
155 MIPS_REG_W14,
156 MIPS_REG_W15,
157 MIPS_REG_W16,
158 MIPS_REG_W17,
159 MIPS_REG_W18,
160 MIPS_REG_W19,
161 MIPS_REG_W20,
162 MIPS_REG_W21,
163 MIPS_REG_W22,
164 MIPS_REG_W23,
165 MIPS_REG_W24,
166 MIPS_REG_W25,
167 MIPS_REG_W26,
168 MIPS_REG_W27,
169 MIPS_REG_W28,
170 MIPS_REG_W29,
171 MIPS_REG_W30,
172 MIPS_REG_W31,
173
174 MIPS_REG_HI,
175 MIPS_REG_LO,
176
177 MIPS_REG_P0,
178 MIPS_REG_P1,
179 MIPS_REG_P2,
180
181 MIPS_REG_MPL0,
182 MIPS_REG_MPL1,
183 MIPS_REG_MPL2,
184
185 MIPS_REG_ENDING, // <-- mark the end of the list or registers
186
187 // alias registers
188 MIPS_REG_ZERO = MIPS_REG_0,
189 MIPS_REG_AT = MIPS_REG_1,
190 MIPS_REG_V0 = MIPS_REG_2,
191 MIPS_REG_V1 = MIPS_REG_3,
192 MIPS_REG_A0 = MIPS_REG_4,
193 MIPS_REG_A1 = MIPS_REG_5,
194 MIPS_REG_A2 = MIPS_REG_6,
195 MIPS_REG_A3 = MIPS_REG_7,
196 MIPS_REG_T0 = MIPS_REG_8,
197 MIPS_REG_T1 = MIPS_REG_9,
198 MIPS_REG_T2 = MIPS_REG_10,
199 MIPS_REG_T3 = MIPS_REG_11,
200 MIPS_REG_T4 = MIPS_REG_12,
201 MIPS_REG_T5 = MIPS_REG_13,
202 MIPS_REG_T6 = MIPS_REG_14,
203 MIPS_REG_T7 = MIPS_REG_15,
204 MIPS_REG_S0 = MIPS_REG_16,
205 MIPS_REG_S1 = MIPS_REG_17,
206 MIPS_REG_S2 = MIPS_REG_18,
207 MIPS_REG_S3 = MIPS_REG_19,
208 MIPS_REG_S4 = MIPS_REG_20,
209 MIPS_REG_S5 = MIPS_REG_21,
210 MIPS_REG_S6 = MIPS_REG_22,
211 MIPS_REG_S7 = MIPS_REG_23,
212 MIPS_REG_T8 = MIPS_REG_24,
213 MIPS_REG_T9 = MIPS_REG_25,
214 MIPS_REG_K0 = MIPS_REG_26,
215 MIPS_REG_K1 = MIPS_REG_27,
216 MIPS_REG_GP = MIPS_REG_28,
217 MIPS_REG_SP = MIPS_REG_29,
218 MIPS_REG_FP = MIPS_REG_30, MIPS_REG_S8 = MIPS_REG_30,
219 MIPS_REG_RA = MIPS_REG_31,
220
221 MIPS_REG_HI0 = MIPS_REG_AC0,
222 MIPS_REG_HI1 = MIPS_REG_AC1,
223 MIPS_REG_HI2 = MIPS_REG_AC2,
224 MIPS_REG_HI3 = MIPS_REG_AC3,
225
226 MIPS_REG_LO0 = MIPS_REG_HI0,
227 MIPS_REG_LO1 = MIPS_REG_HI1,
228 MIPS_REG_LO2 = MIPS_REG_HI2,
229 MIPS_REG_LO3 = MIPS_REG_HI3,
230} mips_reg;
231
232/// Instruction's operand referring to memory
233/// This is associated with MIPS_OP_MEM operand type above
234typedef struct mips_op_mem {
235 mips_reg base; ///< base register
236 int64_t disp; ///< displacement/offset value
237} mips_op_mem;
238
239/// Instruction operand
240typedef struct cs_mips_op {
241 mips_op_type type; ///< operand type
242 union {
243 mips_reg reg; ///< register value for REG operand
244 int64_t imm; ///< immediate value for IMM operand
245 mips_op_mem mem; ///< base/index/scale/disp value for MEM operand
246 };
247} cs_mips_op;
248
249/// Instruction structure
250typedef struct cs_mips {
251 /// Number of operands of this instruction,
252 /// or 0 when instruction has no operand.
253 uint8_t op_count;
254 cs_mips_op operands[10]; ///< operands for this instruction.
255} cs_mips;
256
257/// MIPS instruction
258typedef enum mips_insn {
259 MIPS_INS_INVALID = 0,
260
261 MIPS_INS_ABSQ_S,
262 MIPS_INS_ADD,
263 MIPS_INS_ADDIUPC,
264 MIPS_INS_ADDIUR1SP,
265 MIPS_INS_ADDIUR2,
266 MIPS_INS_ADDIUS5,
267 MIPS_INS_ADDIUSP,
268 MIPS_INS_ADDQH,
269 MIPS_INS_ADDQH_R,
270 MIPS_INS_ADDQ,
271 MIPS_INS_ADDQ_S,
272 MIPS_INS_ADDSC,
273 MIPS_INS_ADDS_A,
274 MIPS_INS_ADDS_S,
275 MIPS_INS_ADDS_U,
276 MIPS_INS_ADDU16,
277 MIPS_INS_ADDUH,
278 MIPS_INS_ADDUH_R,
279 MIPS_INS_ADDU,
280 MIPS_INS_ADDU_S,
281 MIPS_INS_ADDVI,
282 MIPS_INS_ADDV,
283 MIPS_INS_ADDWC,
284 MIPS_INS_ADD_A,
285 MIPS_INS_ADDI,
286 MIPS_INS_ADDIU,
287 MIPS_INS_ALIGN,
288 MIPS_INS_ALUIPC,
289 MIPS_INS_AND,
290 MIPS_INS_AND16,
291 MIPS_INS_ANDI16,
292 MIPS_INS_ANDI,
293 MIPS_INS_APPEND,
294 MIPS_INS_ASUB_S,
295 MIPS_INS_ASUB_U,
296 MIPS_INS_AUI,
297 MIPS_INS_AUIPC,
298 MIPS_INS_AVER_S,
299 MIPS_INS_AVER_U,
300 MIPS_INS_AVE_S,
301 MIPS_INS_AVE_U,
302 MIPS_INS_B16,
303 MIPS_INS_BADDU,
304 MIPS_INS_BAL,
305 MIPS_INS_BALC,
306 MIPS_INS_BALIGN,
307 MIPS_INS_BBIT0,
308 MIPS_INS_BBIT032,
309 MIPS_INS_BBIT1,
310 MIPS_INS_BBIT132,
311 MIPS_INS_BC,
312 MIPS_INS_BC0F,
313 MIPS_INS_BC0FL,
314 MIPS_INS_BC0T,
315 MIPS_INS_BC0TL,
316 MIPS_INS_BC1EQZ,
317 MIPS_INS_BC1F,
318 MIPS_INS_BC1FL,
319 MIPS_INS_BC1NEZ,
320 MIPS_INS_BC1T,
321 MIPS_INS_BC1TL,
322 MIPS_INS_BC2EQZ,
323 MIPS_INS_BC2F,
324 MIPS_INS_BC2FL,
325 MIPS_INS_BC2NEZ,
326 MIPS_INS_BC2T,
327 MIPS_INS_BC2TL,
328 MIPS_INS_BC3F,
329 MIPS_INS_BC3FL,
330 MIPS_INS_BC3T,
331 MIPS_INS_BC3TL,
332 MIPS_INS_BCLRI,
333 MIPS_INS_BCLR,
334 MIPS_INS_BEQ,
335 MIPS_INS_BEQC,
336 MIPS_INS_BEQL,
337 MIPS_INS_BEQZ16,
338 MIPS_INS_BEQZALC,
339 MIPS_INS_BEQZC,
340 MIPS_INS_BGEC,
341 MIPS_INS_BGEUC,
342 MIPS_INS_BGEZ,
343 MIPS_INS_BGEZAL,
344 MIPS_INS_BGEZALC,
345 MIPS_INS_BGEZALL,
346 MIPS_INS_BGEZALS,
347 MIPS_INS_BGEZC,
348 MIPS_INS_BGEZL,
349 MIPS_INS_BGTZ,
350 MIPS_INS_BGTZALC,
351 MIPS_INS_BGTZC,
352 MIPS_INS_BGTZL,
353 MIPS_INS_BINSLI,
354 MIPS_INS_BINSL,
355 MIPS_INS_BINSRI,
356 MIPS_INS_BINSR,
357 MIPS_INS_BITREV,
358 MIPS_INS_BITSWAP,
359 MIPS_INS_BLEZ,
360 MIPS_INS_BLEZALC,
361 MIPS_INS_BLEZC,
362 MIPS_INS_BLEZL,
363 MIPS_INS_BLTC,
364 MIPS_INS_BLTUC,
365 MIPS_INS_BLTZ,
366 MIPS_INS_BLTZAL,
367 MIPS_INS_BLTZALC,
368 MIPS_INS_BLTZALL,
369 MIPS_INS_BLTZALS,
370 MIPS_INS_BLTZC,
371 MIPS_INS_BLTZL,
372 MIPS_INS_BMNZI,
373 MIPS_INS_BMNZ,
374 MIPS_INS_BMZI,
375 MIPS_INS_BMZ,
376 MIPS_INS_BNE,
377 MIPS_INS_BNEC,
378 MIPS_INS_BNEGI,
379 MIPS_INS_BNEG,
380 MIPS_INS_BNEL,
381 MIPS_INS_BNEZ16,
382 MIPS_INS_BNEZALC,
383 MIPS_INS_BNEZC,
384 MIPS_INS_BNVC,
385 MIPS_INS_BNZ,
386 MIPS_INS_BOVC,
387 MIPS_INS_BPOSGE32,
388 MIPS_INS_BREAK,
389 MIPS_INS_BREAK16,
390 MIPS_INS_BSELI,
391 MIPS_INS_BSEL,
392 MIPS_INS_BSETI,
393 MIPS_INS_BSET,
394 MIPS_INS_BZ,
395 MIPS_INS_BEQZ,
396 MIPS_INS_B,
397 MIPS_INS_BNEZ,
398 MIPS_INS_BTEQZ,
399 MIPS_INS_BTNEZ,
400 MIPS_INS_CACHE,
401 MIPS_INS_CEIL,
402 MIPS_INS_CEQI,
403 MIPS_INS_CEQ,
404 MIPS_INS_CFC1,
405 MIPS_INS_CFCMSA,
406 MIPS_INS_CINS,
407 MIPS_INS_CINS32,
408 MIPS_INS_CLASS,
409 MIPS_INS_CLEI_S,
410 MIPS_INS_CLEI_U,
411 MIPS_INS_CLE_S,
412 MIPS_INS_CLE_U,
413 MIPS_INS_CLO,
414 MIPS_INS_CLTI_S,
415 MIPS_INS_CLTI_U,
416 MIPS_INS_CLT_S,
417 MIPS_INS_CLT_U,
418 MIPS_INS_CLZ,
419 MIPS_INS_CMPGDU,
420 MIPS_INS_CMPGU,
421 MIPS_INS_CMPU,
422 MIPS_INS_CMP,
423 MIPS_INS_COPY_S,
424 MIPS_INS_COPY_U,
425 MIPS_INS_CTC1,
426 MIPS_INS_CTCMSA,
427 MIPS_INS_CVT,
428 MIPS_INS_C,
429 MIPS_INS_CMPI,
430 MIPS_INS_DADD,
431 MIPS_INS_DADDI,
432 MIPS_INS_DADDIU,
433 MIPS_INS_DADDU,
434 MIPS_INS_DAHI,
435 MIPS_INS_DALIGN,
436 MIPS_INS_DATI,
437 MIPS_INS_DAUI,
438 MIPS_INS_DBITSWAP,
439 MIPS_INS_DCLO,
440 MIPS_INS_DCLZ,
441 MIPS_INS_DDIV,
442 MIPS_INS_DDIVU,
443 MIPS_INS_DERET,
444 MIPS_INS_DEXT,
445 MIPS_INS_DEXTM,
446 MIPS_INS_DEXTU,
447 MIPS_INS_DI,
448 MIPS_INS_DINS,
449 MIPS_INS_DINSM,
450 MIPS_INS_DINSU,
451 MIPS_INS_DIV,
452 MIPS_INS_DIVU,
453 MIPS_INS_DIV_S,
454 MIPS_INS_DIV_U,
455 MIPS_INS_DLSA,
456 MIPS_INS_DMFC0,
457 MIPS_INS_DMFC1,
458 MIPS_INS_DMFC2,
459 MIPS_INS_DMOD,
460 MIPS_INS_DMODU,
461 MIPS_INS_DMTC0,
462 MIPS_INS_DMTC1,
463 MIPS_INS_DMTC2,
464 MIPS_INS_DMUH,
465 MIPS_INS_DMUHU,
466 MIPS_INS_DMUL,
467 MIPS_INS_DMULT,
468 MIPS_INS_DMULTU,
469 MIPS_INS_DMULU,
470 MIPS_INS_DOTP_S,
471 MIPS_INS_DOTP_U,
472 MIPS_INS_DPADD_S,
473 MIPS_INS_DPADD_U,
474 MIPS_INS_DPAQX_SA,
475 MIPS_INS_DPAQX_S,
476 MIPS_INS_DPAQ_SA,
477 MIPS_INS_DPAQ_S,
478 MIPS_INS_DPAU,
479 MIPS_INS_DPAX,
480 MIPS_INS_DPA,
481 MIPS_INS_DPOP,
482 MIPS_INS_DPSQX_SA,
483 MIPS_INS_DPSQX_S,
484 MIPS_INS_DPSQ_SA,
485 MIPS_INS_DPSQ_S,
486 MIPS_INS_DPSUB_S,
487 MIPS_INS_DPSUB_U,
488 MIPS_INS_DPSU,
489 MIPS_INS_DPSX,
490 MIPS_INS_DPS,
491 MIPS_INS_DROTR,
492 MIPS_INS_DROTR32,
493 MIPS_INS_DROTRV,
494 MIPS_INS_DSBH,
495 MIPS_INS_DSHD,
496 MIPS_INS_DSLL,
497 MIPS_INS_DSLL32,
498 MIPS_INS_DSLLV,
499 MIPS_INS_DSRA,
500 MIPS_INS_DSRA32,
501 MIPS_INS_DSRAV,
502 MIPS_INS_DSRL,
503 MIPS_INS_DSRL32,
504 MIPS_INS_DSRLV,
505 MIPS_INS_DSUB,
506 MIPS_INS_DSUBU,
507 MIPS_INS_EHB,
508 MIPS_INS_EI,
509 MIPS_INS_ERET,
510 MIPS_INS_EXT,
511 MIPS_INS_EXTP,
512 MIPS_INS_EXTPDP,
513 MIPS_INS_EXTPDPV,
514 MIPS_INS_EXTPV,
515 MIPS_INS_EXTRV_RS,
516 MIPS_INS_EXTRV_R,
517 MIPS_INS_EXTRV_S,
518 MIPS_INS_EXTRV,
519 MIPS_INS_EXTR_RS,
520 MIPS_INS_EXTR_R,
521 MIPS_INS_EXTR_S,
522 MIPS_INS_EXTR,
523 MIPS_INS_EXTS,
524 MIPS_INS_EXTS32,
525 MIPS_INS_ABS,
526 MIPS_INS_FADD,
527 MIPS_INS_FCAF,
528 MIPS_INS_FCEQ,
529 MIPS_INS_FCLASS,
530 MIPS_INS_FCLE,
531 MIPS_INS_FCLT,
532 MIPS_INS_FCNE,
533 MIPS_INS_FCOR,
534 MIPS_INS_FCUEQ,
535 MIPS_INS_FCULE,
536 MIPS_INS_FCULT,
537 MIPS_INS_FCUNE,
538 MIPS_INS_FCUN,
539 MIPS_INS_FDIV,
540 MIPS_INS_FEXDO,
541 MIPS_INS_FEXP2,
542 MIPS_INS_FEXUPL,
543 MIPS_INS_FEXUPR,
544 MIPS_INS_FFINT_S,
545 MIPS_INS_FFINT_U,
546 MIPS_INS_FFQL,
547 MIPS_INS_FFQR,
548 MIPS_INS_FILL,
549 MIPS_INS_FLOG2,
550 MIPS_INS_FLOOR,
551 MIPS_INS_FMADD,
552 MIPS_INS_FMAX_A,
553 MIPS_INS_FMAX,
554 MIPS_INS_FMIN_A,
555 MIPS_INS_FMIN,
556 MIPS_INS_MOV,
557 MIPS_INS_FMSUB,
558 MIPS_INS_FMUL,
559 MIPS_INS_MUL,
560 MIPS_INS_NEG,
561 MIPS_INS_FRCP,
562 MIPS_INS_FRINT,
563 MIPS_INS_FRSQRT,
564 MIPS_INS_FSAF,
565 MIPS_INS_FSEQ,
566 MIPS_INS_FSLE,
567 MIPS_INS_FSLT,
568 MIPS_INS_FSNE,
569 MIPS_INS_FSOR,
570 MIPS_INS_FSQRT,
571 MIPS_INS_SQRT,
572 MIPS_INS_FSUB,
573 MIPS_INS_SUB,
574 MIPS_INS_FSUEQ,
575 MIPS_INS_FSULE,
576 MIPS_INS_FSULT,
577 MIPS_INS_FSUNE,
578 MIPS_INS_FSUN,
579 MIPS_INS_FTINT_S,
580 MIPS_INS_FTINT_U,
581 MIPS_INS_FTQ,
582 MIPS_INS_FTRUNC_S,
583 MIPS_INS_FTRUNC_U,
584 MIPS_INS_HADD_S,
585 MIPS_INS_HADD_U,
586 MIPS_INS_HSUB_S,
587 MIPS_INS_HSUB_U,
588 MIPS_INS_ILVEV,
589 MIPS_INS_ILVL,
590 MIPS_INS_ILVOD,
591 MIPS_INS_ILVR,
592 MIPS_INS_INS,
593 MIPS_INS_INSERT,
594 MIPS_INS_INSV,
595 MIPS_INS_INSVE,
596 MIPS_INS_J,
597 MIPS_INS_JAL,
598 MIPS_INS_JALR,
599 MIPS_INS_JALRS16,
600 MIPS_INS_JALRS,
601 MIPS_INS_JALS,
602 MIPS_INS_JALX,
603 MIPS_INS_JIALC,
604 MIPS_INS_JIC,
605 MIPS_INS_JR,
606 MIPS_INS_JR16,
607 MIPS_INS_JRADDIUSP,
608 MIPS_INS_JRC,
609 MIPS_INS_JALRC,
610 MIPS_INS_LB,
611 MIPS_INS_LBU16,
612 MIPS_INS_LBUX,
613 MIPS_INS_LBU,
614 MIPS_INS_LD,
615 MIPS_INS_LDC1,
616 MIPS_INS_LDC2,
617 MIPS_INS_LDC3,
618 MIPS_INS_LDI,
619 MIPS_INS_LDL,
620 MIPS_INS_LDPC,
621 MIPS_INS_LDR,
622 MIPS_INS_LDXC1,
623 MIPS_INS_LH,
624 MIPS_INS_LHU16,
625 MIPS_INS_LHX,
626 MIPS_INS_LHU,
627 MIPS_INS_LI16,
628 MIPS_INS_LL,
629 MIPS_INS_LLD,
630 MIPS_INS_LSA,
631 MIPS_INS_LUXC1,
632 MIPS_INS_LUI,
633 MIPS_INS_LW,
634 MIPS_INS_LW16,
635 MIPS_INS_LWC1,
636 MIPS_INS_LWC2,
637 MIPS_INS_LWC3,
638 MIPS_INS_LWL,
639 MIPS_INS_LWM16,
640 MIPS_INS_LWM32,
641 MIPS_INS_LWPC,
642 MIPS_INS_LWP,
643 MIPS_INS_LWR,
644 MIPS_INS_LWUPC,
645 MIPS_INS_LWU,
646 MIPS_INS_LWX,
647 MIPS_INS_LWXC1,
648 MIPS_INS_LWXS,
649 MIPS_INS_LI,
650 MIPS_INS_MADD,
651 MIPS_INS_MADDF,
652 MIPS_INS_MADDR_Q,
653 MIPS_INS_MADDU,
654 MIPS_INS_MADDV,
655 MIPS_INS_MADD_Q,
656 MIPS_INS_MAQ_SA,
657 MIPS_INS_MAQ_S,
658 MIPS_INS_MAXA,
659 MIPS_INS_MAXI_S,
660 MIPS_INS_MAXI_U,
661 MIPS_INS_MAX_A,
662 MIPS_INS_MAX,
663 MIPS_INS_MAX_S,
664 MIPS_INS_MAX_U,
665 MIPS_INS_MFC0,
666 MIPS_INS_MFC1,
667 MIPS_INS_MFC2,
668 MIPS_INS_MFHC1,
669 MIPS_INS_MFHI,
670 MIPS_INS_MFLO,
671 MIPS_INS_MINA,
672 MIPS_INS_MINI_S,
673 MIPS_INS_MINI_U,
674 MIPS_INS_MIN_A,
675 MIPS_INS_MIN,
676 MIPS_INS_MIN_S,
677 MIPS_INS_MIN_U,
678 MIPS_INS_MOD,
679 MIPS_INS_MODSUB,
680 MIPS_INS_MODU,
681 MIPS_INS_MOD_S,
682 MIPS_INS_MOD_U,
683 MIPS_INS_MOVE,
684 MIPS_INS_MOVEP,
685 MIPS_INS_MOVF,
686 MIPS_INS_MOVN,
687 MIPS_INS_MOVT,
688 MIPS_INS_MOVZ,
689 MIPS_INS_MSUB,
690 MIPS_INS_MSUBF,
691 MIPS_INS_MSUBR_Q,
692 MIPS_INS_MSUBU,
693 MIPS_INS_MSUBV,
694 MIPS_INS_MSUB_Q,
695 MIPS_INS_MTC0,
696 MIPS_INS_MTC1,
697 MIPS_INS_MTC2,
698 MIPS_INS_MTHC1,
699 MIPS_INS_MTHI,
700 MIPS_INS_MTHLIP,
701 MIPS_INS_MTLO,
702 MIPS_INS_MTM0,
703 MIPS_INS_MTM1,
704 MIPS_INS_MTM2,
705 MIPS_INS_MTP0,
706 MIPS_INS_MTP1,
707 MIPS_INS_MTP2,
708 MIPS_INS_MUH,
709 MIPS_INS_MUHU,
710 MIPS_INS_MULEQ_S,
711 MIPS_INS_MULEU_S,
712 MIPS_INS_MULQ_RS,
713 MIPS_INS_MULQ_S,
714 MIPS_INS_MULR_Q,
715 MIPS_INS_MULSAQ_S,
716 MIPS_INS_MULSA,
717 MIPS_INS_MULT,
718 MIPS_INS_MULTU,
719 MIPS_INS_MULU,
720 MIPS_INS_MULV,
721 MIPS_INS_MUL_Q,
722 MIPS_INS_MUL_S,
723 MIPS_INS_NLOC,
724 MIPS_INS_NLZC,
725 MIPS_INS_NMADD,
726 MIPS_INS_NMSUB,
727 MIPS_INS_NOR,
728 MIPS_INS_NORI,
729 MIPS_INS_NOT16,
730 MIPS_INS_NOT,
731 MIPS_INS_OR,
732 MIPS_INS_OR16,
733 MIPS_INS_ORI,
734 MIPS_INS_PACKRL,
735 MIPS_INS_PAUSE,
736 MIPS_INS_PCKEV,
737 MIPS_INS_PCKOD,
738 MIPS_INS_PCNT,
739 MIPS_INS_PICK,
740 MIPS_INS_POP,
741 MIPS_INS_PRECEQU,
742 MIPS_INS_PRECEQ,
743 MIPS_INS_PRECEU,
744 MIPS_INS_PRECRQU_S,
745 MIPS_INS_PRECRQ,
746 MIPS_INS_PRECRQ_RS,
747 MIPS_INS_PRECR,
748 MIPS_INS_PRECR_SRA,
749 MIPS_INS_PRECR_SRA_R,
750 MIPS_INS_PREF,
751 MIPS_INS_PREPEND,
752 MIPS_INS_RADDU,
753 MIPS_INS_RDDSP,
754 MIPS_INS_RDHWR,
755 MIPS_INS_REPLV,
756 MIPS_INS_REPL,
757 MIPS_INS_RINT,
758 MIPS_INS_ROTR,
759 MIPS_INS_ROTRV,
760 MIPS_INS_ROUND,
761 MIPS_INS_SAT_S,
762 MIPS_INS_SAT_U,
763 MIPS_INS_SB,
764 MIPS_INS_SB16,
765 MIPS_INS_SC,
766 MIPS_INS_SCD,
767 MIPS_INS_SD,
768 MIPS_INS_SDBBP,
769 MIPS_INS_SDBBP16,
770 MIPS_INS_SDC1,
771 MIPS_INS_SDC2,
772 MIPS_INS_SDC3,
773 MIPS_INS_SDL,
774 MIPS_INS_SDR,
775 MIPS_INS_SDXC1,
776 MIPS_INS_SEB,
777 MIPS_INS_SEH,
778 MIPS_INS_SELEQZ,
779 MIPS_INS_SELNEZ,
780 MIPS_INS_SEL,
781 MIPS_INS_SEQ,
782 MIPS_INS_SEQI,
783 MIPS_INS_SH,
784 MIPS_INS_SH16,
785 MIPS_INS_SHF,
786 MIPS_INS_SHILO,
787 MIPS_INS_SHILOV,
788 MIPS_INS_SHLLV,
789 MIPS_INS_SHLLV_S,
790 MIPS_INS_SHLL,
791 MIPS_INS_SHLL_S,
792 MIPS_INS_SHRAV,
793 MIPS_INS_SHRAV_R,
794 MIPS_INS_SHRA,
795 MIPS_INS_SHRA_R,
796 MIPS_INS_SHRLV,
797 MIPS_INS_SHRL,
798 MIPS_INS_SLDI,
799 MIPS_INS_SLD,
800 MIPS_INS_SLL,
801 MIPS_INS_SLL16,
802 MIPS_INS_SLLI,
803 MIPS_INS_SLLV,
804 MIPS_INS_SLT,
805 MIPS_INS_SLTI,
806 MIPS_INS_SLTIU,
807 MIPS_INS_SLTU,
808 MIPS_INS_SNE,
809 MIPS_INS_SNEI,
810 MIPS_INS_SPLATI,
811 MIPS_INS_SPLAT,
812 MIPS_INS_SRA,
813 MIPS_INS_SRAI,
814 MIPS_INS_SRARI,
815 MIPS_INS_SRAR,
816 MIPS_INS_SRAV,
817 MIPS_INS_SRL,
818 MIPS_INS_SRL16,
819 MIPS_INS_SRLI,
820 MIPS_INS_SRLRI,
821 MIPS_INS_SRLR,
822 MIPS_INS_SRLV,
823 MIPS_INS_SSNOP,
824 MIPS_INS_ST,
825 MIPS_INS_SUBQH,
826 MIPS_INS_SUBQH_R,
827 MIPS_INS_SUBQ,
828 MIPS_INS_SUBQ_S,
829 MIPS_INS_SUBSUS_U,
830 MIPS_INS_SUBSUU_S,
831 MIPS_INS_SUBS_S,
832 MIPS_INS_SUBS_U,
833 MIPS_INS_SUBU16,
834 MIPS_INS_SUBUH,
835 MIPS_INS_SUBUH_R,
836 MIPS_INS_SUBU,
837 MIPS_INS_SUBU_S,
838 MIPS_INS_SUBVI,
839 MIPS_INS_SUBV,
840 MIPS_INS_SUXC1,
841 MIPS_INS_SW,
842 MIPS_INS_SW16,
843 MIPS_INS_SWC1,
844 MIPS_INS_SWC2,
845 MIPS_INS_SWC3,
846 MIPS_INS_SWL,
847 MIPS_INS_SWM16,
848 MIPS_INS_SWM32,
849 MIPS_INS_SWP,
850 MIPS_INS_SWR,
851 MIPS_INS_SWXC1,
852 MIPS_INS_SYNC,
853 MIPS_INS_SYNCI,
854 MIPS_INS_SYSCALL,
855 MIPS_INS_TEQ,
856 MIPS_INS_TEQI,
857 MIPS_INS_TGE,
858 MIPS_INS_TGEI,
859 MIPS_INS_TGEIU,
860 MIPS_INS_TGEU,
861 MIPS_INS_TLBP,
862 MIPS_INS_TLBR,
863 MIPS_INS_TLBWI,
864 MIPS_INS_TLBWR,
865 MIPS_INS_TLT,
866 MIPS_INS_TLTI,
867 MIPS_INS_TLTIU,
868 MIPS_INS_TLTU,
869 MIPS_INS_TNE,
870 MIPS_INS_TNEI,
871 MIPS_INS_TRUNC,
872 MIPS_INS_V3MULU,
873 MIPS_INS_VMM0,
874 MIPS_INS_VMULU,
875 MIPS_INS_VSHF,
876 MIPS_INS_WAIT,
877 MIPS_INS_WRDSP,
878 MIPS_INS_WSBH,
879 MIPS_INS_XOR,
880 MIPS_INS_XOR16,
881 MIPS_INS_XORI,
882
883 //> some alias instructions
884 MIPS_INS_NOP,
885 MIPS_INS_NEGU,
886
887 //> special instructions
888 MIPS_INS_JALR_HB, // jump and link with Hazard Barrier
889 MIPS_INS_JR_HB, // jump register with Hazard Barrier
890
891 MIPS_INS_ENDING,
892} mips_insn;
893
894/// Group of MIPS instructions
895typedef enum mips_insn_group {
896 MIPS_GRP_INVALID = 0, ///< = CS_GRP_INVALID
897
898 // Generic groups
899 // all jump instructions (conditional+direct+indirect jumps)
900 MIPS_GRP_JUMP, ///< = CS_GRP_JUMP
901 // all call instructions
902 MIPS_GRP_CALL, ///< = CS_GRP_CALL
903 // all return instructions
904 MIPS_GRP_RET, ///< = CS_GRP_RET
905 // all interrupt instructions (int+syscall)
906 MIPS_GRP_INT, ///< = CS_GRP_INT
907 // all interrupt return instructions
908 MIPS_GRP_IRET, ///< = CS_GRP_IRET
909 // all privileged instructions
910 MIPS_GRP_PRIVILEGE, ///< = CS_GRP_PRIVILEGE
911 // all relative branching instructions
912 MIPS_GRP_BRANCH_RELATIVE, ///< = CS_GRP_BRANCH_RELATIVE
913
914 // Architecture-specific groups
915 MIPS_GRP_BITCOUNT = 128,
916 MIPS_GRP_DSP,
917 MIPS_GRP_DSPR2,
918 MIPS_GRP_FPIDX,
919 MIPS_GRP_MSA,
920 MIPS_GRP_MIPS32R2,
921 MIPS_GRP_MIPS64,
922 MIPS_GRP_MIPS64R2,
923 MIPS_GRP_SEINREG,
924 MIPS_GRP_STDENC,
925 MIPS_GRP_SWAP,
926 MIPS_GRP_MICROMIPS,
927 MIPS_GRP_MIPS16MODE,
928 MIPS_GRP_FP64BIT,
929 MIPS_GRP_NONANSFPMATH,
930 MIPS_GRP_NOTFP64BIT,
931 MIPS_GRP_NOTINMICROMIPS,
932 MIPS_GRP_NOTNACL,
933 MIPS_GRP_NOTMIPS32R6,
934 MIPS_GRP_NOTMIPS64R6,
935 MIPS_GRP_CNMIPS,
936 MIPS_GRP_MIPS32,
937 MIPS_GRP_MIPS32R6,
938 MIPS_GRP_MIPS64R6,
939 MIPS_GRP_MIPS2,
940 MIPS_GRP_MIPS3,
941 MIPS_GRP_MIPS3_32,
942 MIPS_GRP_MIPS3_32R2,
943 MIPS_GRP_MIPS4_32,
944 MIPS_GRP_MIPS4_32R2,
945 MIPS_GRP_MIPS5_32R2,
946 MIPS_GRP_GP32BIT,
947 MIPS_GRP_GP64BIT,
948
949 MIPS_GRP_ENDING,
950} mips_insn_group;
951
952#ifdef __cplusplus
953}
954#endif
955
956#endif
957