Rizin
unix-like reverse engineering framework and cli tools
MipsMapping.c
Go to the documentation of this file.
1 /* Capstone Disassembly Engine */
2 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
3 
4 #ifdef CAPSTONE_HAS_MIPS
5 
6 #include <stdio.h> // debug
7 #include <string.h>
8 
9 #include "../../utils.h"
10 
11 #include "MipsMapping.h"
12 
13 #define GET_INSTRINFO_ENUM
14 #include "MipsGenInstrInfo.inc"
15 
16 #ifndef CAPSTONE_DIET
17 static const name_map reg_name_maps[] = {
19 
20  { MIPS_REG_PC, "pc"},
21 
22  //{ MIPS_REG_0, "0"},
23  { MIPS_REG_0, "zero"},
24  { MIPS_REG_1, "at"},
25  //{ MIPS_REG_1, "1"},
26  { MIPS_REG_2, "v0"},
27  //{ MIPS_REG_2, "2"},
28  { MIPS_REG_3, "v1"},
29  //{ MIPS_REG_3, "3"},
30  { MIPS_REG_4, "a0"},
31  //{ MIPS_REG_4, "4"},
32  { MIPS_REG_5, "a1"},
33  //{ MIPS_REG_5, "5"},
34  { MIPS_REG_6, "a2"},
35  //{ MIPS_REG_6, "6"},
36  { MIPS_REG_7, "a3"},
37  //{ MIPS_REG_7, "7"},
38  { MIPS_REG_8, "t0"},
39  //{ MIPS_REG_8, "8"},
40  { MIPS_REG_9, "t1"},
41  //{ MIPS_REG_9, "9"},
42  { MIPS_REG_10, "t2"},
43  //{ MIPS_REG_10, "10"},
44  { MIPS_REG_11, "t3"},
45  //{ MIPS_REG_11, "11"},
46  { MIPS_REG_12, "t4"},
47  //{ MIPS_REG_12, "12"},
48  { MIPS_REG_13, "t5"},
49  //{ MIPS_REG_13, "13"},
50  { MIPS_REG_14, "t6"},
51  //{ MIPS_REG_14, "14"},
52  { MIPS_REG_15, "t7"},
53  //{ MIPS_REG_15, "15"},
54  { MIPS_REG_16, "s0"},
55  //{ MIPS_REG_16, "16"},
56  { MIPS_REG_17, "s1"},
57  //{ MIPS_REG_17, "17"},
58  { MIPS_REG_18, "s2"},
59  //{ MIPS_REG_18, "18"},
60  { MIPS_REG_19, "s3"},
61  //{ MIPS_REG_19, "19"},
62  { MIPS_REG_20, "s4"},
63  //{ MIPS_REG_20, "20"},
64  { MIPS_REG_21, "s5"},
65  //{ MIPS_REG_21, "21"},
66  { MIPS_REG_22, "s6"},
67  //{ MIPS_REG_22, "22"},
68  { MIPS_REG_23, "s7"},
69  //{ MIPS_REG_23, "23"},
70  { MIPS_REG_24, "t8"},
71  //{ MIPS_REG_24, "24"},
72  { MIPS_REG_25, "t9"},
73  //{ MIPS_REG_25, "25"},
74  { MIPS_REG_26, "k0"},
75  //{ MIPS_REG_26, "26"},
76  { MIPS_REG_27, "k1"},
77  //{ MIPS_REG_27, "27"},
78  { MIPS_REG_28, "gp"},
79  //{ MIPS_REG_28, "28"},
80  { MIPS_REG_29, "sp"},
81  //{ MIPS_REG_29, "29"},
82  { MIPS_REG_30, "fp"},
83  //{ MIPS_REG_30, "30"},
84  { MIPS_REG_31, "ra"},
85  //{ MIPS_REG_31, "31"},
86 
87  { MIPS_REG_DSPCCOND, "dspccond"},
88  { MIPS_REG_DSPCARRY, "dspcarry"},
89  { MIPS_REG_DSPEFI, "dspefi"},
90  { MIPS_REG_DSPOUTFLAG, "dspoutflag"},
91  { MIPS_REG_DSPOUTFLAG16_19, "dspoutflag16_19"},
92  { MIPS_REG_DSPOUTFLAG20, "dspoutflag20"},
93  { MIPS_REG_DSPOUTFLAG21, "dspoutflag21"},
94  { MIPS_REG_DSPOUTFLAG22, "dspoutflag22"},
95  { MIPS_REG_DSPOUTFLAG23, "dspoutflag23"},
96  { MIPS_REG_DSPPOS, "dsppos"},
97  { MIPS_REG_DSPSCOUNT, "dspscount"},
98 
99  { MIPS_REG_AC0, "ac0"},
100  { MIPS_REG_AC1, "ac1"},
101  { MIPS_REG_AC2, "ac2"},
102  { MIPS_REG_AC3, "ac3"},
103 
104  { MIPS_REG_CC0, "cc0"},
105  { MIPS_REG_CC1, "cc1"},
106  { MIPS_REG_CC2, "cc2"},
107  { MIPS_REG_CC3, "cc3"},
108  { MIPS_REG_CC4, "cc4"},
109  { MIPS_REG_CC5, "cc5"},
110  { MIPS_REG_CC6, "cc6"},
111  { MIPS_REG_CC7, "cc7"},
112 
113  { MIPS_REG_F0, "f0"},
114  { MIPS_REG_F1, "f1"},
115  { MIPS_REG_F2, "f2"},
116  { MIPS_REG_F3, "f3"},
117  { MIPS_REG_F4, "f4"},
118  { MIPS_REG_F5, "f5"},
119  { MIPS_REG_F6, "f6"},
120  { MIPS_REG_F7, "f7"},
121  { MIPS_REG_F8, "f8"},
122  { MIPS_REG_F9, "f9"},
123  { MIPS_REG_F10, "f10"},
124  { MIPS_REG_F11, "f11"},
125  { MIPS_REG_F12, "f12"},
126  { MIPS_REG_F13, "f13"},
127  { MIPS_REG_F14, "f14"},
128  { MIPS_REG_F15, "f15"},
129  { MIPS_REG_F16, "f16"},
130  { MIPS_REG_F17, "f17"},
131  { MIPS_REG_F18, "f18"},
132  { MIPS_REG_F19, "f19"},
133  { MIPS_REG_F20, "f20"},
134  { MIPS_REG_F21, "f21"},
135  { MIPS_REG_F22, "f22"},
136  { MIPS_REG_F23, "f23"},
137  { MIPS_REG_F24, "f24"},
138  { MIPS_REG_F25, "f25"},
139  { MIPS_REG_F26, "f26"},
140  { MIPS_REG_F27, "f27"},
141  { MIPS_REG_F28, "f28"},
142  { MIPS_REG_F29, "f29"},
143  { MIPS_REG_F30, "f30"},
144  { MIPS_REG_F31, "f31"},
145 
146  { MIPS_REG_FCC0, "fcc0"},
147  { MIPS_REG_FCC1, "fcc1"},
148  { MIPS_REG_FCC2, "fcc2"},
149  { MIPS_REG_FCC3, "fcc3"},
150  { MIPS_REG_FCC4, "fcc4"},
151  { MIPS_REG_FCC5, "fcc5"},
152  { MIPS_REG_FCC6, "fcc6"},
153  { MIPS_REG_FCC7, "fcc7"},
154 
155  { MIPS_REG_W0, "w0"},
156  { MIPS_REG_W1, "w1"},
157  { MIPS_REG_W2, "w2"},
158  { MIPS_REG_W3, "w3"},
159  { MIPS_REG_W4, "w4"},
160  { MIPS_REG_W5, "w5"},
161  { MIPS_REG_W6, "w6"},
162  { MIPS_REG_W7, "w7"},
163  { MIPS_REG_W8, "w8"},
164  { MIPS_REG_W9, "w9"},
165  { MIPS_REG_W10, "w10"},
166  { MIPS_REG_W11, "w11"},
167  { MIPS_REG_W12, "w12"},
168  { MIPS_REG_W13, "w13"},
169  { MIPS_REG_W14, "w14"},
170  { MIPS_REG_W15, "w15"},
171  { MIPS_REG_W16, "w16"},
172  { MIPS_REG_W17, "w17"},
173  { MIPS_REG_W18, "w18"},
174  { MIPS_REG_W19, "w19"},
175  { MIPS_REG_W20, "w20"},
176  { MIPS_REG_W21, "w21"},
177  { MIPS_REG_W22, "w22"},
178  { MIPS_REG_W23, "w23"},
179  { MIPS_REG_W24, "w24"},
180  { MIPS_REG_W25, "w25"},
181  { MIPS_REG_W26, "w26"},
182  { MIPS_REG_W27, "w27"},
183  { MIPS_REG_W28, "w28"},
184  { MIPS_REG_W29, "w29"},
185  { MIPS_REG_W30, "w30"},
186  { MIPS_REG_W31, "w31"},
187 
188  { MIPS_REG_HI, "hi"},
189  { MIPS_REG_LO, "lo"},
190 
191  { MIPS_REG_P0, "p0"},
192  { MIPS_REG_P1, "p1"},
193  { MIPS_REG_P2, "p2"},
194 
195  { MIPS_REG_MPL0, "mpl0"},
196  { MIPS_REG_MPL1, "mpl1"},
197  { MIPS_REG_MPL2, "mpl2"},
198 };
199 #endif
200 
201 const char *Mips_reg_name(csh handle, unsigned int reg)
202 {
203 #ifndef CAPSTONE_DIET
204  if (reg >= ARR_SIZE(reg_name_maps))
205  return NULL;
206 
207  return reg_name_maps[reg].name;
208 #else
209  return NULL;
210 #endif
211 }
212 
213 static insn_map insns[] = {
214  // dummy item
215  {
216  0, 0,
217 #ifndef CAPSTONE_DIET
218  { 0 }, { 0 }, { 0 }, 0, 0
219 #endif
220  },
221 
222 #include "MipsMappingInsn.inc"
223 };
224 
225 // given internal insn id, return public instruction info
226 void Mips_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
227 {
228  unsigned int i;
229 
230  i = insn_find(insns, ARR_SIZE(insns), id, &h->insn_cache);
231  if (i != 0) {
232  insn->id = insns[i].mapid;
233 
234  if (h->detail) {
235 #ifndef CAPSTONE_DIET
236  memcpy(insn->detail->regs_read, insns[i].regs_use, sizeof(insns[i].regs_use));
237  insn->detail->regs_read_count = (uint8_t)count_positive(insns[i].regs_use);
238 
239  memcpy(insn->detail->regs_write, insns[i].regs_mod, sizeof(insns[i].regs_mod));
240  insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod);
241 
242  memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups));
243  insn->detail->groups_count = (uint8_t)count_positive8(insns[i].groups);
244 
245  if (insns[i].branch || insns[i].indirect_branch) {
246  // this insn also belongs to JUMP group. add JUMP group
247  insn->detail->groups[insn->detail->groups_count] = MIPS_GRP_JUMP;
248  insn->detail->groups_count++;
249  }
250 #endif
251  }
252  }
253 }
254 
255 static const name_map insn_name_maps[] = {
256  { MIPS_INS_INVALID, NULL },
257 
258  { MIPS_INS_ABSQ_S, "absq_s" },
259  { MIPS_INS_ADD, "add" },
260  { MIPS_INS_ADDIUPC, "addiupc" },
261  { MIPS_INS_ADDIUR1SP, "addiur1sp" },
262  { MIPS_INS_ADDIUR2, "addiur2" },
263  { MIPS_INS_ADDIUS5, "addius5" },
264  { MIPS_INS_ADDIUSP, "addiusp" },
265  { MIPS_INS_ADDQH, "addqh" },
266  { MIPS_INS_ADDQH_R, "addqh_r" },
267  { MIPS_INS_ADDQ, "addq" },
268  { MIPS_INS_ADDQ_S, "addq_s" },
269  { MIPS_INS_ADDSC, "addsc" },
270  { MIPS_INS_ADDS_A, "adds_a" },
271  { MIPS_INS_ADDS_S, "adds_s" },
272  { MIPS_INS_ADDS_U, "adds_u" },
273  { MIPS_INS_ADDU16, "addu16" },
274  { MIPS_INS_ADDUH, "adduh" },
275  { MIPS_INS_ADDUH_R, "adduh_r" },
276  { MIPS_INS_ADDU, "addu" },
277  { MIPS_INS_ADDU_S, "addu_s" },
278  { MIPS_INS_ADDVI, "addvi" },
279  { MIPS_INS_ADDV, "addv" },
280  { MIPS_INS_ADDWC, "addwc" },
281  { MIPS_INS_ADD_A, "add_a" },
282  { MIPS_INS_ADDI, "addi" },
283  { MIPS_INS_ADDIU, "addiu" },
284  { MIPS_INS_ALIGN, "align" },
285  { MIPS_INS_ALUIPC, "aluipc" },
286  { MIPS_INS_AND, "and" },
287  { MIPS_INS_AND16, "and16" },
288  { MIPS_INS_ANDI16, "andi16" },
289  { MIPS_INS_ANDI, "andi" },
290  { MIPS_INS_APPEND, "append" },
291  { MIPS_INS_ASUB_S, "asub_s" },
292  { MIPS_INS_ASUB_U, "asub_u" },
293  { MIPS_INS_AUI, "aui" },
294  { MIPS_INS_AUIPC, "auipc" },
295  { MIPS_INS_AVER_S, "aver_s" },
296  { MIPS_INS_AVER_U, "aver_u" },
297  { MIPS_INS_AVE_S, "ave_s" },
298  { MIPS_INS_AVE_U, "ave_u" },
299  { MIPS_INS_B16, "b16" },
300  { MIPS_INS_BADDU, "baddu" },
301  { MIPS_INS_BAL, "bal" },
302  { MIPS_INS_BALC, "balc" },
303  { MIPS_INS_BALIGN, "balign" },
304  { MIPS_INS_BBIT0, "bbit0" },
305  { MIPS_INS_BBIT032, "bbit032" },
306  { MIPS_INS_BBIT1, "bbit1" },
307  { MIPS_INS_BBIT132, "bbit132" },
308  { MIPS_INS_BC, "bc" },
309  { MIPS_INS_BC0F, "bc0f" },
310  { MIPS_INS_BC0FL, "bc0fl" },
311  { MIPS_INS_BC0T, "bc0t" },
312  { MIPS_INS_BC0TL, "bc0tl" },
313  { MIPS_INS_BC1EQZ, "bc1eqz" },
314  { MIPS_INS_BC1F, "bc1f" },
315  { MIPS_INS_BC1FL, "bc1fl" },
316  { MIPS_INS_BC1NEZ, "bc1nez" },
317  { MIPS_INS_BC1T, "bc1t" },
318  { MIPS_INS_BC1TL, "bc1tl" },
319  { MIPS_INS_BC2EQZ, "bc2eqz" },
320  { MIPS_INS_BC2F, "bc2f" },
321  { MIPS_INS_BC2FL, "bc2fl" },
322  { MIPS_INS_BC2NEZ, "bc2nez" },
323  { MIPS_INS_BC2T, "bc2t" },
324  { MIPS_INS_BC2TL, "bc2tl" },
325  { MIPS_INS_BC3F, "bc3f" },
326  { MIPS_INS_BC3FL, "bc3fl" },
327  { MIPS_INS_BC3T, "bc3t" },
328  { MIPS_INS_BC3TL, "bc3tl" },
329  { MIPS_INS_BCLRI, "bclri" },
330  { MIPS_INS_BCLR, "bclr" },
331  { MIPS_INS_BEQ, "beq" },
332  { MIPS_INS_BEQC, "beqc" },
333  { MIPS_INS_BEQL, "beql" },
334  { MIPS_INS_BEQZ16, "beqz16" },
335  { MIPS_INS_BEQZALC, "beqzalc" },
336  { MIPS_INS_BEQZC, "beqzc" },
337  { MIPS_INS_BGEC, "bgec" },
338  { MIPS_INS_BGEUC, "bgeuc" },
339  { MIPS_INS_BGEZ, "bgez" },
340  { MIPS_INS_BGEZAL, "bgezal" },
341  { MIPS_INS_BGEZALC, "bgezalc" },
342  { MIPS_INS_BGEZALL, "bgezall" },
343  { MIPS_INS_BGEZALS, "bgezals" },
344  { MIPS_INS_BGEZC, "bgezc" },
345  { MIPS_INS_BGEZL, "bgezl" },
346  { MIPS_INS_BGTZ, "bgtz" },
347  { MIPS_INS_BGTZALC, "bgtzalc" },
348  { MIPS_INS_BGTZC, "bgtzc" },
349  { MIPS_INS_BGTZL, "bgtzl" },
350  { MIPS_INS_BINSLI, "binsli" },
351  { MIPS_INS_BINSL, "binsl" },
352  { MIPS_INS_BINSRI, "binsri" },
353  { MIPS_INS_BINSR, "binsr" },
354  { MIPS_INS_BITREV, "bitrev" },
355  { MIPS_INS_BITSWAP, "bitswap" },
356  { MIPS_INS_BLEZ, "blez" },
357  { MIPS_INS_BLEZALC, "blezalc" },
358  { MIPS_INS_BLEZC, "blezc" },
359  { MIPS_INS_BLEZL, "blezl" },
360  { MIPS_INS_BLTC, "bltc" },
361  { MIPS_INS_BLTUC, "bltuc" },
362  { MIPS_INS_BLTZ, "bltz" },
363  { MIPS_INS_BLTZAL, "bltzal" },
364  { MIPS_INS_BLTZALC, "bltzalc" },
365  { MIPS_INS_BLTZALL, "bltzall" },
366  { MIPS_INS_BLTZALS, "bltzals" },
367  { MIPS_INS_BLTZC, "bltzc" },
368  { MIPS_INS_BLTZL, "bltzl" },
369  { MIPS_INS_BMNZI, "bmnzi" },
370  { MIPS_INS_BMNZ, "bmnz" },
371  { MIPS_INS_BMZI, "bmzi" },
372  { MIPS_INS_BMZ, "bmz" },
373  { MIPS_INS_BNE, "bne" },
374  { MIPS_INS_BNEC, "bnec" },
375  { MIPS_INS_BNEGI, "bnegi" },
376  { MIPS_INS_BNEG, "bneg" },
377  { MIPS_INS_BNEL, "bnel" },
378  { MIPS_INS_BNEZ16, "bnez16" },
379  { MIPS_INS_BNEZALC, "bnezalc" },
380  { MIPS_INS_BNEZC, "bnezc" },
381  { MIPS_INS_BNVC, "bnvc" },
382  { MIPS_INS_BNZ, "bnz" },
383  { MIPS_INS_BOVC, "bovc" },
384  { MIPS_INS_BPOSGE32, "bposge32" },
385  { MIPS_INS_BREAK, "break" },
386  { MIPS_INS_BREAK16, "break16" },
387  { MIPS_INS_BSELI, "bseli" },
388  { MIPS_INS_BSEL, "bsel" },
389  { MIPS_INS_BSETI, "bseti" },
390  { MIPS_INS_BSET, "bset" },
391  { MIPS_INS_BZ, "bz" },
392  { MIPS_INS_BEQZ, "beqz" },
393  { MIPS_INS_B, "b" },
394  { MIPS_INS_BNEZ, "bnez" },
395  { MIPS_INS_BTEQZ, "bteqz" },
396  { MIPS_INS_BTNEZ, "btnez" },
397  { MIPS_INS_CACHE, "cache" },
398  { MIPS_INS_CEIL, "ceil" },
399  { MIPS_INS_CEQI, "ceqi" },
400  { MIPS_INS_CEQ, "ceq" },
401  { MIPS_INS_CFC1, "cfc1" },
402  { MIPS_INS_CFCMSA, "cfcmsa" },
403  { MIPS_INS_CINS, "cins" },
404  { MIPS_INS_CINS32, "cins32" },
405  { MIPS_INS_CLASS, "class" },
406  { MIPS_INS_CLEI_S, "clei_s" },
407  { MIPS_INS_CLEI_U, "clei_u" },
408  { MIPS_INS_CLE_S, "cle_s" },
409  { MIPS_INS_CLE_U, "cle_u" },
410  { MIPS_INS_CLO, "clo" },
411  { MIPS_INS_CLTI_S, "clti_s" },
412  { MIPS_INS_CLTI_U, "clti_u" },
413  { MIPS_INS_CLT_S, "clt_s" },
414  { MIPS_INS_CLT_U, "clt_u" },
415  { MIPS_INS_CLZ, "clz" },
416  { MIPS_INS_CMPGDU, "cmpgdu" },
417  { MIPS_INS_CMPGU, "cmpgu" },
418  { MIPS_INS_CMPU, "cmpu" },
419  { MIPS_INS_CMP, "cmp" },
420  { MIPS_INS_COPY_S, "copy_s" },
421  { MIPS_INS_COPY_U, "copy_u" },
422  { MIPS_INS_CTC1, "ctc1" },
423  { MIPS_INS_CTCMSA, "ctcmsa" },
424  { MIPS_INS_CVT, "cvt" },
425  { MIPS_INS_C, "c" },
426  { MIPS_INS_CMPI, "cmpi" },
427  { MIPS_INS_DADD, "dadd" },
428  { MIPS_INS_DADDI, "daddi" },
429  { MIPS_INS_DADDIU, "daddiu" },
430  { MIPS_INS_DADDU, "daddu" },
431  { MIPS_INS_DAHI, "dahi" },
432  { MIPS_INS_DALIGN, "dalign" },
433  { MIPS_INS_DATI, "dati" },
434  { MIPS_INS_DAUI, "daui" },
435  { MIPS_INS_DBITSWAP, "dbitswap" },
436  { MIPS_INS_DCLO, "dclo" },
437  { MIPS_INS_DCLZ, "dclz" },
438  { MIPS_INS_DDIV, "ddiv" },
439  { MIPS_INS_DDIVU, "ddivu" },
440  { MIPS_INS_DERET, "deret" },
441  { MIPS_INS_DEXT, "dext" },
442  { MIPS_INS_DEXTM, "dextm" },
443  { MIPS_INS_DEXTU, "dextu" },
444  { MIPS_INS_DI, "di" },
445  { MIPS_INS_DINS, "dins" },
446  { MIPS_INS_DINSM, "dinsm" },
447  { MIPS_INS_DINSU, "dinsu" },
448  { MIPS_INS_DIV, "div" },
449  { MIPS_INS_DIVU, "divu" },
450  { MIPS_INS_DIV_S, "div_s" },
451  { MIPS_INS_DIV_U, "div_u" },
452  { MIPS_INS_DLSA, "dlsa" },
453  { MIPS_INS_DMFC0, "dmfc0" },
454  { MIPS_INS_DMFC1, "dmfc1" },
455  { MIPS_INS_DMFC2, "dmfc2" },
456  { MIPS_INS_DMOD, "dmod" },
457  { MIPS_INS_DMODU, "dmodu" },
458  { MIPS_INS_DMTC0, "dmtc0" },
459  { MIPS_INS_DMTC1, "dmtc1" },
460  { MIPS_INS_DMTC2, "dmtc2" },
461  { MIPS_INS_DMUH, "dmuh" },
462  { MIPS_INS_DMUHU, "dmuhu" },
463  { MIPS_INS_DMUL, "dmul" },
464  { MIPS_INS_DMULT, "dmult" },
465  { MIPS_INS_DMULTU, "dmultu" },
466  { MIPS_INS_DMULU, "dmulu" },
467  { MIPS_INS_DOTP_S, "dotp_s" },
468  { MIPS_INS_DOTP_U, "dotp_u" },
469  { MIPS_INS_DPADD_S, "dpadd_s" },
470  { MIPS_INS_DPADD_U, "dpadd_u" },
471  { MIPS_INS_DPAQX_SA, "dpaqx_sa" },
472  { MIPS_INS_DPAQX_S, "dpaqx_s" },
473  { MIPS_INS_DPAQ_SA, "dpaq_sa" },
474  { MIPS_INS_DPAQ_S, "dpaq_s" },
475  { MIPS_INS_DPAU, "dpau" },
476  { MIPS_INS_DPAX, "dpax" },
477  { MIPS_INS_DPA, "dpa" },
478  { MIPS_INS_DPOP, "dpop" },
479  { MIPS_INS_DPSQX_SA, "dpsqx_sa" },
480  { MIPS_INS_DPSQX_S, "dpsqx_s" },
481  { MIPS_INS_DPSQ_SA, "dpsq_sa" },
482  { MIPS_INS_DPSQ_S, "dpsq_s" },
483  { MIPS_INS_DPSUB_S, "dpsub_s" },
484  { MIPS_INS_DPSUB_U, "dpsub_u" },
485  { MIPS_INS_DPSU, "dpsu" },
486  { MIPS_INS_DPSX, "dpsx" },
487  { MIPS_INS_DPS, "dps" },
488  { MIPS_INS_DROTR, "drotr" },
489  { MIPS_INS_DROTR32, "drotr32" },
490  { MIPS_INS_DROTRV, "drotrv" },
491  { MIPS_INS_DSBH, "dsbh" },
492  { MIPS_INS_DSHD, "dshd" },
493  { MIPS_INS_DSLL, "dsll" },
494  { MIPS_INS_DSLL32, "dsll32" },
495  { MIPS_INS_DSLLV, "dsllv" },
496  { MIPS_INS_DSRA, "dsra" },
497  { MIPS_INS_DSRA32, "dsra32" },
498  { MIPS_INS_DSRAV, "dsrav" },
499  { MIPS_INS_DSRL, "dsrl" },
500  { MIPS_INS_DSRL32, "dsrl32" },
501  { MIPS_INS_DSRLV, "dsrlv" },
502  { MIPS_INS_DSUB, "dsub" },
503  { MIPS_INS_DSUBU, "dsubu" },
504  { MIPS_INS_EHB, "ehb" },
505  { MIPS_INS_EI, "ei" },
506  { MIPS_INS_ERET, "eret" },
507  { MIPS_INS_EXT, "ext" },
508  { MIPS_INS_EXTP, "extp" },
509  { MIPS_INS_EXTPDP, "extpdp" },
510  { MIPS_INS_EXTPDPV, "extpdpv" },
511  { MIPS_INS_EXTPV, "extpv" },
512  { MIPS_INS_EXTRV_RS, "extrv_rs" },
513  { MIPS_INS_EXTRV_R, "extrv_r" },
514  { MIPS_INS_EXTRV_S, "extrv_s" },
515  { MIPS_INS_EXTRV, "extrv" },
516  { MIPS_INS_EXTR_RS, "extr_rs" },
517  { MIPS_INS_EXTR_R, "extr_r" },
518  { MIPS_INS_EXTR_S, "extr_s" },
519  { MIPS_INS_EXTR, "extr" },
520  { MIPS_INS_EXTS, "exts" },
521  { MIPS_INS_EXTS32, "exts32" },
522  { MIPS_INS_ABS, "abs" },
523  { MIPS_INS_FADD, "fadd" },
524  { MIPS_INS_FCAF, "fcaf" },
525  { MIPS_INS_FCEQ, "fceq" },
526  { MIPS_INS_FCLASS, "fclass" },
527  { MIPS_INS_FCLE, "fcle" },
528  { MIPS_INS_FCLT, "fclt" },
529  { MIPS_INS_FCNE, "fcne" },
530  { MIPS_INS_FCOR, "fcor" },
531  { MIPS_INS_FCUEQ, "fcueq" },
532  { MIPS_INS_FCULE, "fcule" },
533  { MIPS_INS_FCULT, "fcult" },
534  { MIPS_INS_FCUNE, "fcune" },
535  { MIPS_INS_FCUN, "fcun" },
536  { MIPS_INS_FDIV, "fdiv" },
537  { MIPS_INS_FEXDO, "fexdo" },
538  { MIPS_INS_FEXP2, "fexp2" },
539  { MIPS_INS_FEXUPL, "fexupl" },
540  { MIPS_INS_FEXUPR, "fexupr" },
541  { MIPS_INS_FFINT_S, "ffint_s" },
542  { MIPS_INS_FFINT_U, "ffint_u" },
543  { MIPS_INS_FFQL, "ffql" },
544  { MIPS_INS_FFQR, "ffqr" },
545  { MIPS_INS_FILL, "fill" },
546  { MIPS_INS_FLOG2, "flog2" },
547  { MIPS_INS_FLOOR, "floor" },
548  { MIPS_INS_FMADD, "fmadd" },
549  { MIPS_INS_FMAX_A, "fmax_a" },
550  { MIPS_INS_FMAX, "fmax" },
551  { MIPS_INS_FMIN_A, "fmin_a" },
552  { MIPS_INS_FMIN, "fmin" },
553  { MIPS_INS_MOV, "mov" },
554  { MIPS_INS_FMSUB, "fmsub" },
555  { MIPS_INS_FMUL, "fmul" },
556  { MIPS_INS_MUL, "mul" },
557  { MIPS_INS_NEG, "neg" },
558  { MIPS_INS_FRCP, "frcp" },
559  { MIPS_INS_FRINT, "frint" },
560  { MIPS_INS_FRSQRT, "frsqrt" },
561  { MIPS_INS_FSAF, "fsaf" },
562  { MIPS_INS_FSEQ, "fseq" },
563  { MIPS_INS_FSLE, "fsle" },
564  { MIPS_INS_FSLT, "fslt" },
565  { MIPS_INS_FSNE, "fsne" },
566  { MIPS_INS_FSOR, "fsor" },
567  { MIPS_INS_FSQRT, "fsqrt" },
568  { MIPS_INS_SQRT, "sqrt" },
569  { MIPS_INS_FSUB, "fsub" },
570  { MIPS_INS_SUB, "sub" },
571  { MIPS_INS_FSUEQ, "fsueq" },
572  { MIPS_INS_FSULE, "fsule" },
573  { MIPS_INS_FSULT, "fsult" },
574  { MIPS_INS_FSUNE, "fsune" },
575  { MIPS_INS_FSUN, "fsun" },
576  { MIPS_INS_FTINT_S, "ftint_s" },
577  { MIPS_INS_FTINT_U, "ftint_u" },
578  { MIPS_INS_FTQ, "ftq" },
579  { MIPS_INS_FTRUNC_S, "ftrunc_s" },
580  { MIPS_INS_FTRUNC_U, "ftrunc_u" },
581  { MIPS_INS_HADD_S, "hadd_s" },
582  { MIPS_INS_HADD_U, "hadd_u" },
583  { MIPS_INS_HSUB_S, "hsub_s" },
584  { MIPS_INS_HSUB_U, "hsub_u" },
585  { MIPS_INS_ILVEV, "ilvev" },
586  { MIPS_INS_ILVL, "ilvl" },
587  { MIPS_INS_ILVOD, "ilvod" },
588  { MIPS_INS_ILVR, "ilvr" },
589  { MIPS_INS_INS, "ins" },
590  { MIPS_INS_INSERT, "insert" },
591  { MIPS_INS_INSV, "insv" },
592  { MIPS_INS_INSVE, "insve" },
593  { MIPS_INS_J, "j" },
594  { MIPS_INS_JAL, "jal" },
595  { MIPS_INS_JALR, "jalr" },
596  { MIPS_INS_JALRS16, "jalrs16" },
597  { MIPS_INS_JALRS, "jalrs" },
598  { MIPS_INS_JALS, "jals" },
599  { MIPS_INS_JALX, "jalx" },
600  { MIPS_INS_JIALC, "jialc" },
601  { MIPS_INS_JIC, "jic" },
602  { MIPS_INS_JR, "jr" },
603  { MIPS_INS_JR16, "jr16" },
604  { MIPS_INS_JRADDIUSP, "jraddiusp" },
605  { MIPS_INS_JRC, "jrc" },
606  { MIPS_INS_JALRC, "jalrc" },
607  { MIPS_INS_LB, "lb" },
608  { MIPS_INS_LBU16, "lbu16" },
609  { MIPS_INS_LBUX, "lbux" },
610  { MIPS_INS_LBU, "lbu" },
611  { MIPS_INS_LD, "ld" },
612  { MIPS_INS_LDC1, "ldc1" },
613  { MIPS_INS_LDC2, "ldc2" },
614  { MIPS_INS_LDC3, "ldc3" },
615  { MIPS_INS_LDI, "ldi" },
616  { MIPS_INS_LDL, "ldl" },
617  { MIPS_INS_LDPC, "ldpc" },
618  { MIPS_INS_LDR, "ldr" },
619  { MIPS_INS_LDXC1, "ldxc1" },
620  { MIPS_INS_LH, "lh" },
621  { MIPS_INS_LHU16, "lhu16" },
622  { MIPS_INS_LHX, "lhx" },
623  { MIPS_INS_LHU, "lhu" },
624  { MIPS_INS_LI16, "li16" },
625  { MIPS_INS_LL, "ll" },
626  { MIPS_INS_LLD, "lld" },
627  { MIPS_INS_LSA, "lsa" },
628  { MIPS_INS_LUXC1, "luxc1" },
629  { MIPS_INS_LUI, "lui" },
630  { MIPS_INS_LW, "lw" },
631  { MIPS_INS_LW16, "lw16" },
632  { MIPS_INS_LWC1, "lwc1" },
633  { MIPS_INS_LWC2, "lwc2" },
634  { MIPS_INS_LWC3, "lwc3" },
635  { MIPS_INS_LWL, "lwl" },
636  { MIPS_INS_LWM16, "lwm16" },
637  { MIPS_INS_LWM32, "lwm32" },
638  { MIPS_INS_LWPC, "lwpc" },
639  { MIPS_INS_LWP, "lwp" },
640  { MIPS_INS_LWR, "lwr" },
641  { MIPS_INS_LWUPC, "lwupc" },
642  { MIPS_INS_LWU, "lwu" },
643  { MIPS_INS_LWX, "lwx" },
644  { MIPS_INS_LWXC1, "lwxc1" },
645  { MIPS_INS_LWXS, "lwxs" },
646  { MIPS_INS_LI, "li" },
647  { MIPS_INS_MADD, "madd" },
648  { MIPS_INS_MADDF, "maddf" },
649  { MIPS_INS_MADDR_Q, "maddr_q" },
650  { MIPS_INS_MADDU, "maddu" },
651  { MIPS_INS_MADDV, "maddv" },
652  { MIPS_INS_MADD_Q, "madd_q" },
653  { MIPS_INS_MAQ_SA, "maq_sa" },
654  { MIPS_INS_MAQ_S, "maq_s" },
655  { MIPS_INS_MAXA, "maxa" },
656  { MIPS_INS_MAXI_S, "maxi_s" },
657  { MIPS_INS_MAXI_U, "maxi_u" },
658  { MIPS_INS_MAX_A, "max_a" },
659  { MIPS_INS_MAX, "max" },
660  { MIPS_INS_MAX_S, "max_s" },
661  { MIPS_INS_MAX_U, "max_u" },
662  { MIPS_INS_MFC0, "mfc0" },
663  { MIPS_INS_MFC1, "mfc1" },
664  { MIPS_INS_MFC2, "mfc2" },
665  { MIPS_INS_MFHC1, "mfhc1" },
666  { MIPS_INS_MFHI, "mfhi" },
667  { MIPS_INS_MFLO, "mflo" },
668  { MIPS_INS_MINA, "mina" },
669  { MIPS_INS_MINI_S, "mini_s" },
670  { MIPS_INS_MINI_U, "mini_u" },
671  { MIPS_INS_MIN_A, "min_a" },
672  { MIPS_INS_MIN, "min" },
673  { MIPS_INS_MIN_S, "min_s" },
674  { MIPS_INS_MIN_U, "min_u" },
675  { MIPS_INS_MOD, "mod" },
676  { MIPS_INS_MODSUB, "modsub" },
677  { MIPS_INS_MODU, "modu" },
678  { MIPS_INS_MOD_S, "mod_s" },
679  { MIPS_INS_MOD_U, "mod_u" },
680  { MIPS_INS_MOVE, "move" },
681  { MIPS_INS_MOVEP, "movep" },
682  { MIPS_INS_MOVF, "movf" },
683  { MIPS_INS_MOVN, "movn" },
684  { MIPS_INS_MOVT, "movt" },
685  { MIPS_INS_MOVZ, "movz" },
686  { MIPS_INS_MSUB, "msub" },
687  { MIPS_INS_MSUBF, "msubf" },
688  { MIPS_INS_MSUBR_Q, "msubr_q" },
689  { MIPS_INS_MSUBU, "msubu" },
690  { MIPS_INS_MSUBV, "msubv" },
691  { MIPS_INS_MSUB_Q, "msub_q" },
692  { MIPS_INS_MTC0, "mtc0" },
693  { MIPS_INS_MTC1, "mtc1" },
694  { MIPS_INS_MTC2, "mtc2" },
695  { MIPS_INS_MTHC1, "mthc1" },
696  { MIPS_INS_MTHI, "mthi" },
697  { MIPS_INS_MTHLIP, "mthlip" },
698  { MIPS_INS_MTLO, "mtlo" },
699  { MIPS_INS_MTM0, "mtm0" },
700  { MIPS_INS_MTM1, "mtm1" },
701  { MIPS_INS_MTM2, "mtm2" },
702  { MIPS_INS_MTP0, "mtp0" },
703  { MIPS_INS_MTP1, "mtp1" },
704  { MIPS_INS_MTP2, "mtp2" },
705  { MIPS_INS_MUH, "muh" },
706  { MIPS_INS_MUHU, "muhu" },
707  { MIPS_INS_MULEQ_S, "muleq_s" },
708  { MIPS_INS_MULEU_S, "muleu_s" },
709  { MIPS_INS_MULQ_RS, "mulq_rs" },
710  { MIPS_INS_MULQ_S, "mulq_s" },
711  { MIPS_INS_MULR_Q, "mulr_q" },
712  { MIPS_INS_MULSAQ_S, "mulsaq_s" },
713  { MIPS_INS_MULSA, "mulsa" },
714  { MIPS_INS_MULT, "mult" },
715  { MIPS_INS_MULTU, "multu" },
716  { MIPS_INS_MULU, "mulu" },
717  { MIPS_INS_MULV, "mulv" },
718  { MIPS_INS_MUL_Q, "mul_q" },
719  { MIPS_INS_MUL_S, "mul_s" },
720  { MIPS_INS_NLOC, "nloc" },
721  { MIPS_INS_NLZC, "nlzc" },
722  { MIPS_INS_NMADD, "nmadd" },
723  { MIPS_INS_NMSUB, "nmsub" },
724  { MIPS_INS_NOR, "nor" },
725  { MIPS_INS_NORI, "nori" },
726  { MIPS_INS_NOT16, "not16" },
727  { MIPS_INS_NOT, "not" },
728  { MIPS_INS_OR, "or" },
729  { MIPS_INS_OR16, "or16" },
730  { MIPS_INS_ORI, "ori" },
731  { MIPS_INS_PACKRL, "packrl" },
732  { MIPS_INS_PAUSE, "pause" },
733  { MIPS_INS_PCKEV, "pckev" },
734  { MIPS_INS_PCKOD, "pckod" },
735  { MIPS_INS_PCNT, "pcnt" },
736  { MIPS_INS_PICK, "pick" },
737  { MIPS_INS_POP, "pop" },
738  { MIPS_INS_PRECEQU, "precequ" },
739  { MIPS_INS_PRECEQ, "preceq" },
740  { MIPS_INS_PRECEU, "preceu" },
741  { MIPS_INS_PRECRQU_S, "precrqu_s" },
742  { MIPS_INS_PRECRQ, "precrq" },
743  { MIPS_INS_PRECRQ_RS, "precrq_rs" },
744  { MIPS_INS_PRECR, "precr" },
745  { MIPS_INS_PRECR_SRA, "precr_sra" },
746  { MIPS_INS_PRECR_SRA_R, "precr_sra_r" },
747  { MIPS_INS_PREF, "pref" },
748  { MIPS_INS_PREPEND, "prepend" },
749  { MIPS_INS_RADDU, "raddu" },
750  { MIPS_INS_RDDSP, "rddsp" },
751  { MIPS_INS_RDHWR, "rdhwr" },
752  { MIPS_INS_REPLV, "replv" },
753  { MIPS_INS_REPL, "repl" },
754  { MIPS_INS_RINT, "rint" },
755  { MIPS_INS_ROTR, "rotr" },
756  { MIPS_INS_ROTRV, "rotrv" },
757  { MIPS_INS_ROUND, "round" },
758  { MIPS_INS_SAT_S, "sat_s" },
759  { MIPS_INS_SAT_U, "sat_u" },
760  { MIPS_INS_SB, "sb" },
761  { MIPS_INS_SB16, "sb16" },
762  { MIPS_INS_SC, "sc" },
763  { MIPS_INS_SCD, "scd" },
764  { MIPS_INS_SD, "sd" },
765  { MIPS_INS_SDBBP, "sdbbp" },
766  { MIPS_INS_SDBBP16, "sdbbp16" },
767  { MIPS_INS_SDC1, "sdc1" },
768  { MIPS_INS_SDC2, "sdc2" },
769  { MIPS_INS_SDC3, "sdc3" },
770  { MIPS_INS_SDL, "sdl" },
771  { MIPS_INS_SDR, "sdr" },
772  { MIPS_INS_SDXC1, "sdxc1" },
773  { MIPS_INS_SEB, "seb" },
774  { MIPS_INS_SEH, "seh" },
775  { MIPS_INS_SELEQZ, "seleqz" },
776  { MIPS_INS_SELNEZ, "selnez" },
777  { MIPS_INS_SEL, "sel" },
778  { MIPS_INS_SEQ, "seq" },
779  { MIPS_INS_SEQI, "seqi" },
780  { MIPS_INS_SH, "sh" },
781  { MIPS_INS_SH16, "sh16" },
782  { MIPS_INS_SHF, "shf" },
783  { MIPS_INS_SHILO, "shilo" },
784  { MIPS_INS_SHILOV, "shilov" },
785  { MIPS_INS_SHLLV, "shllv" },
786  { MIPS_INS_SHLLV_S, "shllv_s" },
787  { MIPS_INS_SHLL, "shll" },
788  { MIPS_INS_SHLL_S, "shll_s" },
789  { MIPS_INS_SHRAV, "shrav" },
790  { MIPS_INS_SHRAV_R, "shrav_r" },
791  { MIPS_INS_SHRA, "shra" },
792  { MIPS_INS_SHRA_R, "shra_r" },
793  { MIPS_INS_SHRLV, "shrlv" },
794  { MIPS_INS_SHRL, "shrl" },
795  { MIPS_INS_SLDI, "sldi" },
796  { MIPS_INS_SLD, "sld" },
797  { MIPS_INS_SLL, "sll" },
798  { MIPS_INS_SLL16, "sll16" },
799  { MIPS_INS_SLLI, "slli" },
800  { MIPS_INS_SLLV, "sllv" },
801  { MIPS_INS_SLT, "slt" },
802  { MIPS_INS_SLTI, "slti" },
803  { MIPS_INS_SLTIU, "sltiu" },
804  { MIPS_INS_SLTU, "sltu" },
805  { MIPS_INS_SNE, "sne" },
806  { MIPS_INS_SNEI, "snei" },
807  { MIPS_INS_SPLATI, "splati" },
808  { MIPS_INS_SPLAT, "splat" },
809  { MIPS_INS_SRA, "sra" },
810  { MIPS_INS_SRAI, "srai" },
811  { MIPS_INS_SRARI, "srari" },
812  { MIPS_INS_SRAR, "srar" },
813  { MIPS_INS_SRAV, "srav" },
814  { MIPS_INS_SRL, "srl" },
815  { MIPS_INS_SRL16, "srl16" },
816  { MIPS_INS_SRLI, "srli" },
817  { MIPS_INS_SRLRI, "srlri" },
818  { MIPS_INS_SRLR, "srlr" },
819  { MIPS_INS_SRLV, "srlv" },
820  { MIPS_INS_SSNOP, "ssnop" },
821  { MIPS_INS_ST, "st" },
822  { MIPS_INS_SUBQH, "subqh" },
823  { MIPS_INS_SUBQH_R, "subqh_r" },
824  { MIPS_INS_SUBQ, "subq" },
825  { MIPS_INS_SUBQ_S, "subq_s" },
826  { MIPS_INS_SUBSUS_U, "subsus_u" },
827  { MIPS_INS_SUBSUU_S, "subsuu_s" },
828  { MIPS_INS_SUBS_S, "subs_s" },
829  { MIPS_INS_SUBS_U, "subs_u" },
830  { MIPS_INS_SUBU16, "subu16" },
831  { MIPS_INS_SUBUH, "subuh" },
832  { MIPS_INS_SUBUH_R, "subuh_r" },
833  { MIPS_INS_SUBU, "subu" },
834  { MIPS_INS_SUBU_S, "subu_s" },
835  { MIPS_INS_SUBVI, "subvi" },
836  { MIPS_INS_SUBV, "subv" },
837  { MIPS_INS_SUXC1, "suxc1" },
838  { MIPS_INS_SW, "sw" },
839  { MIPS_INS_SW16, "sw16" },
840  { MIPS_INS_SWC1, "swc1" },
841  { MIPS_INS_SWC2, "swc2" },
842  { MIPS_INS_SWC3, "swc3" },
843  { MIPS_INS_SWL, "swl" },
844  { MIPS_INS_SWM16, "swm16" },
845  { MIPS_INS_SWM32, "swm32" },
846  { MIPS_INS_SWP, "swp" },
847  { MIPS_INS_SWR, "swr" },
848  { MIPS_INS_SWXC1, "swxc1" },
849  { MIPS_INS_SYNC, "sync" },
850  { MIPS_INS_SYNCI, "synci" },
851  { MIPS_INS_SYSCALL, "syscall" },
852  { MIPS_INS_TEQ, "teq" },
853  { MIPS_INS_TEQI, "teqi" },
854  { MIPS_INS_TGE, "tge" },
855  { MIPS_INS_TGEI, "tgei" },
856  { MIPS_INS_TGEIU, "tgeiu" },
857  { MIPS_INS_TGEU, "tgeu" },
858  { MIPS_INS_TLBP, "tlbp" },
859  { MIPS_INS_TLBR, "tlbr" },
860  { MIPS_INS_TLBWI, "tlbwi" },
861  { MIPS_INS_TLBWR, "tlbwr" },
862  { MIPS_INS_TLT, "tlt" },
863  { MIPS_INS_TLTI, "tlti" },
864  { MIPS_INS_TLTIU, "tltiu" },
865  { MIPS_INS_TLTU, "tltu" },
866  { MIPS_INS_TNE, "tne" },
867  { MIPS_INS_TNEI, "tnei" },
868  { MIPS_INS_TRUNC, "trunc" },
869  { MIPS_INS_V3MULU, "v3mulu" },
870  { MIPS_INS_VMM0, "vmm0" },
871  { MIPS_INS_VMULU, "vmulu" },
872  { MIPS_INS_VSHF, "vshf" },
873  { MIPS_INS_WAIT, "wait" },
874  { MIPS_INS_WRDSP, "wrdsp" },
875  { MIPS_INS_WSBH, "wsbh" },
876  { MIPS_INS_XOR, "xor" },
877  { MIPS_INS_XOR16, "xor16" },
878  { MIPS_INS_XORI, "xori" },
879 
880  // alias instructions
881  { MIPS_INS_NOP, "nop" },
882  { MIPS_INS_NEGU, "negu" },
883 
884  { MIPS_INS_JALR_HB, "jalr.hb" },
885  { MIPS_INS_JR_HB, "jr.hb" },
886 };
887 
888 const char *Mips_insn_name(csh handle, unsigned int id)
889 {
890 #ifndef CAPSTONE_DIET
891  if (id >= MIPS_INS_ENDING)
892  return NULL;
893 
894  return insn_name_maps[id].name;
895 #else
896  return NULL;
897 #endif
898 }
899 
900 #ifndef CAPSTONE_DIET
901 static const name_map group_name_maps[] = {
902  // generic groups
903  { MIPS_GRP_INVALID, NULL },
904  { MIPS_GRP_JUMP, "jump" },
905  { MIPS_GRP_CALL, "call" },
906  { MIPS_GRP_RET, "ret" },
907  { MIPS_GRP_INT, "int" },
908  { MIPS_GRP_IRET, "iret" },
909  { MIPS_GRP_PRIVILEGE, "privileged" },
910  { MIPS_GRP_BRANCH_RELATIVE, "branch_relative" },
911 
912  // architecture-specific groups
913  { MIPS_GRP_BITCOUNT, "bitcount" },
914  { MIPS_GRP_DSP, "dsp" },
915  { MIPS_GRP_DSPR2, "dspr2" },
916  { MIPS_GRP_FPIDX, "fpidx" },
917  { MIPS_GRP_MSA, "msa" },
918  { MIPS_GRP_MIPS32R2, "mips32r2" },
919  { MIPS_GRP_MIPS64, "mips64" },
920  { MIPS_GRP_MIPS64R2, "mips64r2" },
921  { MIPS_GRP_SEINREG, "seinreg" },
922  { MIPS_GRP_STDENC, "stdenc" },
923  { MIPS_GRP_SWAP, "swap" },
924  { MIPS_GRP_MICROMIPS, "micromips" },
925  { MIPS_GRP_MIPS16MODE, "mips16mode" },
926  { MIPS_GRP_FP64BIT, "fp64bit" },
927  { MIPS_GRP_NONANSFPMATH, "nonansfpmath" },
928  { MIPS_GRP_NOTFP64BIT, "notfp64bit" },
929  { MIPS_GRP_NOTINMICROMIPS, "notinmicromips" },
930  { MIPS_GRP_NOTNACL, "notnacl" },
931 
932  { MIPS_GRP_NOTMIPS32R6, "notmips32r6" },
933  { MIPS_GRP_NOTMIPS64R6, "notmips64r6" },
934  { MIPS_GRP_CNMIPS, "cnmips" },
935 
936  { MIPS_GRP_MIPS32, "mips32" },
937  { MIPS_GRP_MIPS32R6, "mips32r6" },
938  { MIPS_GRP_MIPS64R6, "mips64r6" },
939 
940  { MIPS_GRP_MIPS2, "mips2" },
941  { MIPS_GRP_MIPS3, "mips3" },
942  { MIPS_GRP_MIPS3_32, "mips3_32"},
943  { MIPS_GRP_MIPS3_32R2, "mips3_32r2" },
944 
945  { MIPS_GRP_MIPS4_32, "mips4_32" },
946  { MIPS_GRP_MIPS4_32R2, "mips4_32r2" },
947  { MIPS_GRP_MIPS5_32R2, "mips5_32r2" },
948 
949  { MIPS_GRP_GP32BIT, "gp32bit" },
950  { MIPS_GRP_GP64BIT, "gp64bit" },
951 };
952 #endif
953 
954 const char *Mips_group_name(csh handle, unsigned int id)
955 {
956 #ifndef CAPSTONE_DIET
958 #else
959  return NULL;
960 #endif
961 }
962 
963 // map instruction name to public instruction ID
964 mips_reg Mips_map_insn(const char *name)
965 {
966  // handle special alias first
967  unsigned int i;
968 
969  // NOTE: skip first NULL name in insn_name_maps
970  i = name2id(&insn_name_maps[1], ARR_SIZE(insn_name_maps) - 1, name);
971 
972  return (i != -1)? i : MIPS_REG_INVALID;
973 }
974 
975 // map internal raw register to 'public' register
976 mips_reg Mips_map_register(unsigned int r)
977 {
978  // for some reasons different Mips modes can map different register number to
979  // the same Mips register. this function handles the issue for exposing Mips
980  // operands by mapping internal registers to 'public' register.
981  static const unsigned int map[] = { 0,
1028  MIPS_REG_AC2, MIPS_REG_AC3, 0, 0, 0,
1061  };
1062 
1063  if (r < ARR_SIZE(map))
1064  return map[r];
1065 
1066  // cannot find this register
1067  return 0;
1068 }
1069 
1070 #endif
static name_map group_name_maps[]
mips_reg Mips_map_register(unsigned int r)
const char * Mips_group_name(csh handle, unsigned int id)
mips_reg Mips_map_insn(const char *name)
const char * Mips_reg_name(csh handle, unsigned int reg)
const char * Mips_insn_name(csh handle, unsigned int id)
void Mips_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
@ MIPS_INS_MTP0
@ MIPS_INS_HSUB_S
@ MIPS_INS_PRECR_SRA
@ MIPS_INS_EXTPDPV
@ MIPS_INS_ABSQ_S
@ MIPS_INS_JRADDIUSP
@ MIPS_INS_DDIVU
@ MIPS_INS_EXTPDP
@ MIPS_INS_PRECEU
@ MIPS_INS_SHLL
@ MIPS_INS_MTHLIP
@ MIPS_INS_ADDS_A
@ MIPS_INS_SELEQZ
@ MIPS_INS_DMUH
@ MIPS_INS_ILVL
@ MIPS_INS_BINSR
@ MIPS_INS_DPAQX_S
@ MIPS_INS_TLBP
@ MIPS_INS_FFQR
@ MIPS_INS_AUIPC
@ MIPS_INS_BEQZC
@ MIPS_INS_CMPU
@ MIPS_INS_BGEZL
@ MIPS_INS_XORI
@ MIPS_INS_DPSQX_S
@ MIPS_INS_MSUB
@ MIPS_INS_ADDV
@ MIPS_INS_MIN_U
@ MIPS_INS_AUI
@ MIPS_INS_FLOG2
@ MIPS_INS_TGEIU
@ MIPS_INS_BLTZ
@ MIPS_INS_FMSUB
@ MIPS_INS_DPADD_U
@ MIPS_INS_FFINT_U
@ MIPS_INS_ADDU_S
@ MIPS_INS_LDC1
@ MIPS_INS_DPA
@ MIPS_INS_HADD_S
@ MIPS_INS_FRCP
@ MIPS_INS_SEH
@ MIPS_INS_BNEC
@ MIPS_INS_FSLT
@ MIPS_INS_DMUL
@ MIPS_INS_DSRL32
@ MIPS_INS_LDPC
@ MIPS_INS_SNE
@ MIPS_INS_FSOR
@ MIPS_INS_SHRA
@ MIPS_INS_BGTZ
@ MIPS_INS_INSERT
@ MIPS_INS_BBIT032
@ MIPS_INS_DMULT
@ MIPS_INS_FCULT
@ M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S_DADDI
@ MIPS_INS_ANDI16
@ MIPS_INS_SDBBP16
@ MIPS_INS_PAUSE
@ MIPS_INS_BALIGN
@ MIPS_INS_VMULU
@ MIPS_INS_BADDU
@ MIPS_INS_EXTRV_S
@ MIPS_INS_INSV
@ MIPS_INS_LWC3
@ MIPS_INS_DPSU
@ MIPS_INS_DOTP_U
@ MIPS_INS_BC3FL
@ MIPS_INS_MSUBV
@ MIPS_INS_SEQI
@ MIPS_INS_SLLV
@ MIPS_INS_TNEI
@ MIPS_INS_CLE_S
@ MIPS_INS_JALR_HB
@ MIPS_INS_TLTI
@ MIPS_INS_SLTI
@ MIPS_INS_CINS
@ MIPS_INS_DAHI
@ MIPS_INS_ADDQ_S
@ MIPS_INS_CLZ
@ MIPS_INS_DMTC0
@ MIPS_INS_FCLASS
@ MIPS_INS_DMUHU
@ MIPS_INS_JR
@ MIPS_INS_ADDIUR2
@ MIPS_INS_SB
@ MIPS_INS_BC3TL
@ MIPS_INS_TGEI
@ MIPS_INS_MFC1
@ MIPS_INS_FSUNE
@ MIPS_INS_DSLL32
@ MIPS_INS_SUBV
@ MIPS_INS_BNEL
@ MIPS_INS_DADDU
@ MIPS_INS_MUHU
@ MIPS_INS_SHLLV_S
@ MIPS_INS_MFC2
@ MIPS_INS_MUL_S
@ MIPS_INS_XOR16
@ MIPS_INS_BLTZAL
lzma_index ** i
Definition: index.h:629
static mcore_handle handle
Definition: asm_mcore.c:8
size_t csh
Definition: capstone.h:71
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
size_t map(int syms, int left, int len)
Definition: enough.c:237
#define reg(n)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
#define ARR_SIZE(a)
Definition: ocaml.c:13
int id
Definition: op.c:540
unsigned char uint8_t
Definition: sftypes.h:31
#define h(i)
Definition: sha256.c:48
Definition: utils.h:19
Definition: utils.h:36
const char * name
Definition: utils.h:38
Definition: z80asm.h:102
@ MIPS_GRP_MIPS3
Definition: mips.h:940
@ MIPS_GRP_RET
= CS_GRP_RET
Definition: mips.h:904
@ MIPS_GRP_MIPS16MODE
Definition: mips.h:927
@ MIPS_GRP_MICROMIPS
Definition: mips.h:926
@ MIPS_GRP_MIPS4_32R2
Definition: mips.h:944
@ MIPS_GRP_DSP
Definition: mips.h:916
@ MIPS_GRP_FPIDX
Definition: mips.h:918
@ MIPS_GRP_INVALID
= CS_GRP_INVALID
Definition: mips.h:896
@ MIPS_GRP_STDENC
Definition: mips.h:924
@ MIPS_GRP_MIPS5_32R2
Definition: mips.h:945
@ MIPS_GRP_JUMP
= CS_GRP_JUMP
Definition: mips.h:900
@ MIPS_GRP_GP64BIT
Definition: mips.h:947
@ MIPS_GRP_IRET
= CS_GRP_IRET
Definition: mips.h:908
@ MIPS_GRP_INT
= CS_GRP_INT
Definition: mips.h:906
@ MIPS_GRP_MIPS64R2
Definition: mips.h:922
@ MIPS_GRP_BITCOUNT
Definition: mips.h:915
@ MIPS_GRP_MIPS2
Definition: mips.h:939
@ MIPS_GRP_MIPS4_32
Definition: mips.h:943
@ MIPS_GRP_SWAP
Definition: mips.h:925
@ MIPS_GRP_NOTMIPS64R6
Definition: mips.h:934
@ MIPS_GRP_MIPS64R6
Definition: mips.h:938
@ MIPS_GRP_FP64BIT
Definition: mips.h:928
@ MIPS_GRP_MIPS3_32
Definition: mips.h:941
@ MIPS_GRP_MIPS32R6
Definition: mips.h:937
@ MIPS_GRP_CALL
= CS_GRP_CALL
Definition: mips.h:902
@ MIPS_GRP_MIPS32R2
Definition: mips.h:920
@ MIPS_GRP_NOTFP64BIT
Definition: mips.h:930
@ MIPS_GRP_PRIVILEGE
= CS_GRP_PRIVILEGE
Definition: mips.h:910
@ MIPS_GRP_NOTNACL
Definition: mips.h:932
@ MIPS_GRP_NONANSFPMATH
Definition: mips.h:929
@ MIPS_GRP_MSA
Definition: mips.h:919
@ MIPS_GRP_MIPS3_32R2
Definition: mips.h:942
@ MIPS_GRP_NOTINMICROMIPS
Definition: mips.h:931
@ MIPS_GRP_GP32BIT
Definition: mips.h:946
@ MIPS_GRP_BRANCH_RELATIVE
= CS_GRP_BRANCH_RELATIVE
Definition: mips.h:912
@ MIPS_GRP_NOTMIPS32R6
Definition: mips.h:933
@ MIPS_GRP_DSPR2
Definition: mips.h:917
@ MIPS_GRP_CNMIPS
Definition: mips.h:935
@ MIPS_GRP_MIPS32
Definition: mips.h:936
@ MIPS_GRP_MIPS64
Definition: mips.h:921
@ MIPS_GRP_SEINREG
Definition: mips.h:923
mips_reg
MIPS registers.
Definition: mips.h:30
@ MIPS_REG_20
Definition: mips.h:55
@ MIPS_REG_LO
Definition: mips.h:175
@ MIPS_REG_P2
Definition: mips.h:179
@ MIPS_REG_MPL2
Definition: mips.h:183
@ MIPS_REG_T1
Definition: mips.h:197
@ MIPS_REG_W7
Definition: mips.h:148
@ MIPS_REG_T7
Definition: mips.h:203
@ MIPS_REG_T0
Definition: mips.h:196
@ MIPS_REG_F15
Definition: mips.h:113
@ MIPS_REG_17
Definition: mips.h:52
@ MIPS_REG_24
Definition: mips.h:59
@ MIPS_REG_CC1
Definition: mips.h:89
@ MIPS_REG_S2
Definition: mips.h:206
@ MIPS_REG_F12
Definition: mips.h:110
@ MIPS_REG_4
Definition: mips.h:39
@ MIPS_REG_K0
Definition: mips.h:214
@ MIPS_REG_F1
Definition: mips.h:99
@ MIPS_REG_S5
Definition: mips.h:209
@ MIPS_REG_K1
Definition: mips.h:215
@ MIPS_REG_DSPEFI
Definition: mips.h:71
@ MIPS_REG_DSPOUTFLAG16_19
Definition: mips.h:73
@ MIPS_REG_W2
Definition: mips.h:143
@ MIPS_REG_W11
Definition: mips.h:152
@ MIPS_REG_ZERO
Definition: mips.h:188
@ MIPS_REG_16
Definition: mips.h:51
@ MIPS_REG_CC5
Definition: mips.h:93
@ MIPS_REG_FCC5
Definition: mips.h:136
@ MIPS_REG_CC3
Definition: mips.h:91
@ MIPS_REG_F10
Definition: mips.h:108
@ MIPS_REG_W5
Definition: mips.h:146
@ MIPS_REG_DSPCCOND
Definition: mips.h:69
@ MIPS_REG_F28
Definition: mips.h:126
@ MIPS_REG_F29
Definition: mips.h:127
@ MIPS_REG_FCC7
Definition: mips.h:138
@ MIPS_REG_S7
Definition: mips.h:211
@ MIPS_REG_F6
Definition: mips.h:104
@ MIPS_REG_F31
Definition: mips.h:129
@ MIPS_REG_DSPSCOUNT
Definition: mips.h:79
@ MIPS_REG_27
Definition: mips.h:62
@ MIPS_REG_F7
Definition: mips.h:105
@ MIPS_REG_W23
Definition: mips.h:164
@ MIPS_REG_AC3
Definition: mips.h:85
@ MIPS_REG_W13
Definition: mips.h:154
@ MIPS_REG_F5
Definition: mips.h:103
@ MIPS_REG_W25
Definition: mips.h:166
@ MIPS_REG_F26
Definition: mips.h:124
@ MIPS_REG_F17
Definition: mips.h:115
@ MIPS_REG_F25
Definition: mips.h:123
@ MIPS_REG_W19
Definition: mips.h:160
@ MIPS_REG_DSPPOS
Definition: mips.h:78
@ MIPS_REG_T9
Definition: mips.h:213
@ MIPS_REG_AT
Definition: mips.h:189
@ MIPS_REG_F21
Definition: mips.h:119
@ MIPS_REG_2
Definition: mips.h:37
@ MIPS_REG_W27
Definition: mips.h:168
@ MIPS_REG_DSPOUTFLAG22
Definition: mips.h:76
@ MIPS_REG_21
Definition: mips.h:56
@ MIPS_REG_W1
Definition: mips.h:142
@ MIPS_REG_W29
Definition: mips.h:170
@ MIPS_REG_F8
Definition: mips.h:106
@ MIPS_REG_W0
Definition: mips.h:141
@ MIPS_REG_FCC4
Definition: mips.h:135
@ MIPS_REG_A2
Definition: mips.h:194
@ MIPS_REG_F3
Definition: mips.h:101
@ MIPS_REG_19
Definition: mips.h:54
@ MIPS_REG_DSPOUTFLAG
Definition: mips.h:72
@ MIPS_REG_F24
Definition: mips.h:122
@ MIPS_REG_W15
Definition: mips.h:156
@ MIPS_REG_A1
Definition: mips.h:193
@ MIPS_REG_DSPCARRY
Definition: mips.h:70
@ MIPS_REG_DSPOUTFLAG23
Definition: mips.h:77
@ MIPS_REG_F20
Definition: mips.h:118
@ MIPS_REG_V0
Definition: mips.h:190
@ MIPS_REG_CC2
Definition: mips.h:90
@ MIPS_REG_T8
Definition: mips.h:212
@ MIPS_REG_F2
Definition: mips.h:100
@ MIPS_REG_28
Definition: mips.h:63
@ MIPS_REG_15
Definition: mips.h:50
@ MIPS_REG_HI
Definition: mips.h:174
@ MIPS_REG_AC1
Definition: mips.h:83
@ MIPS_REG_29
Definition: mips.h:64
@ MIPS_REG_W31
Definition: mips.h:172
@ MIPS_REG_W24
Definition: mips.h:165
@ MIPS_REG_S3
Definition: mips.h:207
@ MIPS_REG_T2
Definition: mips.h:198
@ MIPS_REG_30
Definition: mips.h:65
@ MIPS_REG_S4
Definition: mips.h:208
@ MIPS_REG_W3
Definition: mips.h:144
@ MIPS_REG_T4
Definition: mips.h:200
@ MIPS_REG_S6
Definition: mips.h:210
@ MIPS_REG_CC0
Definition: mips.h:88
@ MIPS_REG_W18
Definition: mips.h:159
@ MIPS_REG_F23
Definition: mips.h:121
@ MIPS_REG_GP
Definition: mips.h:216
@ MIPS_REG_DSPOUTFLAG20
Definition: mips.h:74
@ MIPS_REG_F11
Definition: mips.h:109
@ MIPS_REG_F14
Definition: mips.h:112
@ MIPS_REG_23
Definition: mips.h:58
@ MIPS_REG_W21
Definition: mips.h:162
@ MIPS_REG_FCC0
Definition: mips.h:131
@ MIPS_REG_W6
Definition: mips.h:147
@ MIPS_REG_11
Definition: mips.h:46
@ MIPS_REG_W30
Definition: mips.h:171
@ MIPS_REG_A0
Definition: mips.h:192
@ MIPS_REG_F27
Definition: mips.h:125
@ MIPS_REG_P0
Definition: mips.h:177
@ MIPS_REG_F13
Definition: mips.h:111
@ MIPS_REG_S1
Definition: mips.h:205
@ MIPS_REG_6
Definition: mips.h:41
@ MIPS_REG_F4
Definition: mips.h:102
@ MIPS_REG_PC
Definition: mips.h:33
@ MIPS_REG_DSPOUTFLAG21
Definition: mips.h:75
@ MIPS_REG_RA
Definition: mips.h:219
@ MIPS_REG_12
Definition: mips.h:47
@ MIPS_REG_7
Definition: mips.h:42
@ MIPS_REG_MPL0
Definition: mips.h:181
@ MIPS_REG_FCC1
Definition: mips.h:132
@ MIPS_REG_26
Definition: mips.h:61
@ MIPS_REG_T5
Definition: mips.h:201
@ MIPS_REG_W22
Definition: mips.h:163
@ MIPS_REG_5
Definition: mips.h:40
@ MIPS_REG_F18
Definition: mips.h:116
@ MIPS_REG_INVALID
Definition: mips.h:31
@ MIPS_REG_1
Definition: mips.h:36
@ MIPS_REG_W20
Definition: mips.h:161
@ MIPS_REG_CC7
Definition: mips.h:95
@ MIPS_REG_W4
Definition: mips.h:145
@ MIPS_REG_W17
Definition: mips.h:158
@ MIPS_REG_FCC3
Definition: mips.h:134
@ MIPS_REG_W16
Definition: mips.h:157
@ MIPS_REG_T3
Definition: mips.h:199
@ MIPS_REG_AC0
Definition: mips.h:82
@ MIPS_REG_FCC6
Definition: mips.h:137
@ MIPS_REG_18
Definition: mips.h:53
@ MIPS_REG_W28
Definition: mips.h:169
@ MIPS_REG_P1
Definition: mips.h:178
@ MIPS_REG_W26
Definition: mips.h:167
@ MIPS_REG_9
Definition: mips.h:44
@ MIPS_REG_A3
Definition: mips.h:195
@ MIPS_REG_FP
Definition: mips.h:218
@ MIPS_REG_0
Definition: mips.h:35
@ MIPS_REG_FCC2
Definition: mips.h:133
@ MIPS_REG_F19
Definition: mips.h:117
@ MIPS_REG_25
Definition: mips.h:60
@ MIPS_REG_AC2
Definition: mips.h:84
@ MIPS_REG_31
Definition: mips.h:66
@ MIPS_REG_F16
Definition: mips.h:114
@ MIPS_REG_F0
Definition: mips.h:98
@ MIPS_REG_F22
Definition: mips.h:120
@ MIPS_REG_8
Definition: mips.h:43
@ MIPS_REG_CC6
Definition: mips.h:94
@ MIPS_REG_W12
Definition: mips.h:153
@ MIPS_REG_T6
Definition: mips.h:202
@ MIPS_REG_W9
Definition: mips.h:150
@ MIPS_REG_W10
Definition: mips.h:151
@ MIPS_REG_3
Definition: mips.h:38
@ MIPS_REG_CC4
Definition: mips.h:92
@ MIPS_REG_F30
Definition: mips.h:128
@ MIPS_REG_S0
Definition: mips.h:204
@ MIPS_REG_MPL1
Definition: mips.h:182
@ MIPS_REG_SP
Definition: mips.h:217
@ MIPS_REG_F9
Definition: mips.h:107
@ MIPS_REG_W8
Definition: mips.h:149
@ MIPS_REG_14
Definition: mips.h:49
@ MIPS_REG_10
Definition: mips.h:45
@ MIPS_REG_22
Definition: mips.h:57
@ MIPS_REG_W14
Definition: mips.h:155
@ MIPS_REG_V1
Definition: mips.h:191
@ MIPS_REG_13
Definition: mips.h:48
int name2id(const name_map *map, int max, const char *name)
Definition: utils.c:42
unsigned int count_positive(const uint16_t *list)
Definition: utils.c:72
unsigned int count_positive8(const unsigned char *list)
Definition: utils.c:83
unsigned short insn_find(const insn_map *insns, unsigned int max, unsigned int id, unsigned short **cache)
Definition: utils.c:31
const char * id2name(const name_map *map, int max, const unsigned int id)
Definition: utils.c:56
static struct insnlist * insns[64]
Definition: tricore-dis.c:69