1 /* Capstone Disassembly Engine */
2 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
3
4 #ifdef CAPSTONE_HAS_POWERPC
5
6 #include <stdio.h> // debug
7 #include <string.h>
8
9 #include "../../utils.h"
10
11 #include "PPCMapping.h"
12
13 #define GET_INSTRINFO_ENUM
14 #include "PPCGenInstrInfo.inc"
15
16 #ifndef CAPSTONE_DIET
17 static const name_map reg_name_maps[] = {
18 { PPC_REG_INVALID, NULL },
19
20 { PPC_REG_CARRY, "ca" },
21 { PPC_REG_CR0, "cr0" },
22 { PPC_REG_CR1, "cr1" },
23 { PPC_REG_CR2, "cr2" },
24 { PPC_REG_CR3, "cr3" },
25 { PPC_REG_CR4, "cr4" },
26 { PPC_REG_CR5, "cr5" },
27 { PPC_REG_CR6, "cr6" },
28 { PPC_REG_CR7, "cr7" },
29 { PPC_REG_CTR, "ctr" },
30 { PPC_REG_F0, "f0" },
31 { PPC_REG_F1, "f1" },
32 { PPC_REG_F2, "f2" },
33 { PPC_REG_F3, "f3" },
34 { PPC_REG_F4, "f4" },
35 { PPC_REG_F5, "f5" },
36 { PPC_REG_F6, "f6" },
37 { PPC_REG_F7, "f7" },
38 { PPC_REG_F8, "f8" },
39 { PPC_REG_F9, "f9" },
40 { PPC_REG_F10, "f10" },
41 { PPC_REG_F11, "f11" },
42 { PPC_REG_F12, "f12" },
43 { PPC_REG_F13, "f13" },
44 { PPC_REG_F14, "f14" },
45 { PPC_REG_F15, "f15" },
46 { PPC_REG_F16, "f16" },
47 { PPC_REG_F17, "f17" },
48 { PPC_REG_F18, "f18" },
49 { PPC_REG_F19, "f19" },
50 { PPC_REG_F20, "f20" },
51 { PPC_REG_F21, "f21" },
52 { PPC_REG_F22, "f22" },
53 { PPC_REG_F23, "f23" },
54 { PPC_REG_F24, "f24" },
55 { PPC_REG_F25, "f25" },
56 { PPC_REG_F26, "f26" },
57 { PPC_REG_F27, "f27" },
58 { PPC_REG_F28, "f28" },
59 { PPC_REG_F29, "f29" },
60 { PPC_REG_F30, "f30" },
61 { PPC_REG_F31, "f31" },
62 { PPC_REG_LR, "lr" },
63 { PPC_REG_R0, "r0" },
64 { PPC_REG_R1, "r1" },
65 { PPC_REG_R2, "r2" },
66 { PPC_REG_R3, "r3" },
67 { PPC_REG_R4, "r4" },
68 { PPC_REG_R5, "r5" },
69 { PPC_REG_R6, "r6" },
70 { PPC_REG_R7, "r7" },
71 { PPC_REG_R8, "r8" },
72 { PPC_REG_R9, "r9" },
73 { PPC_REG_R10, "r10" },
74 { PPC_REG_R11, "r11" },
75 { PPC_REG_R12, "r12" },
76 { PPC_REG_R13, "r13" },
77 { PPC_REG_R14, "r14" },
78 { PPC_REG_R15, "r15" },
79 { PPC_REG_R16, "r16" },
80 { PPC_REG_R17, "r17" },
81 { PPC_REG_R18, "r18" },
82 { PPC_REG_R19, "r19" },
83 { PPC_REG_R20, "r20" },
84 { PPC_REG_R21, "r21" },
85 { PPC_REG_R22, "r22" },
86 { PPC_REG_R23, "r23" },
87 { PPC_REG_R24, "r24" },
88 { PPC_REG_R25, "r25" },
89 { PPC_REG_R26, "r26" },
90 { PPC_REG_R27, "r27" },
91 { PPC_REG_R28, "r28" },
92 { PPC_REG_R29, "r29" },
93 { PPC_REG_R30, "r30" },
94 { PPC_REG_R31, "r31" },
95 { PPC_REG_V0, "v0" },
96 { PPC_REG_V1, "v1" },
97 { PPC_REG_V2, "v2" },
98 { PPC_REG_V3, "v3" },
99 { PPC_REG_V4, "v4" },
100 { PPC_REG_V5, "v5" },
101 { PPC_REG_V6, "v6" },
102 { PPC_REG_V7, "v7" },
103 { PPC_REG_V8, "v8" },
104 { PPC_REG_V9, "v9" },
105 { PPC_REG_V10, "v10" },
106 { PPC_REG_V11, "v11" },
107 { PPC_REG_V12, "v12" },
108 { PPC_REG_V13, "v13" },
109 { PPC_REG_V14, "v14" },
110 { PPC_REG_V15, "v15" },
111 { PPC_REG_V16, "v16" },
112 { PPC_REG_V17, "v17" },
113 { PPC_REG_V18, "v18" },
114 { PPC_REG_V19, "v19" },
115 { PPC_REG_V20, "v20" },
116 { PPC_REG_V21, "v21" },
117 { PPC_REG_V22, "v22" },
118 { PPC_REG_V23, "v23" },
119 { PPC_REG_V24, "v24" },
120 { PPC_REG_V25, "v25" },
121 { PPC_REG_V26, "v26" },
122 { PPC_REG_V27, "v27" },
123 { PPC_REG_V28, "v28" },
124 { PPC_REG_V29, "v29" },
125 { PPC_REG_V30, "v30" },
126 { PPC_REG_V31, "v31" },
127 { PPC_REG_VRSAVE, "vrsave" },
128 { PPC_REG_VS0, "vs0"},
129 { PPC_REG_VS1, "vs1"},
130 { PPC_REG_VS2, "vs2"},
131 { PPC_REG_VS3, "vs3"},
132 { PPC_REG_VS4, "vs4"},
133 { PPC_REG_VS5, "vs5"},
134 { PPC_REG_VS6, "vs6"},
135 { PPC_REG_VS7, "vs7"},
136 { PPC_REG_VS8, "vs8"},
137 { PPC_REG_VS9, "vs9"},
138 { PPC_REG_VS10, "vs10"},
139 { PPC_REG_VS11, "vs11"},
140 { PPC_REG_VS12, "vs12"},
141 { PPC_REG_VS13, "vs13"},
142 { PPC_REG_VS14, "vs14"},
143 { PPC_REG_VS15, "vs15"},
144 { PPC_REG_VS16, "vs16"},
145 { PPC_REG_VS17, "vs17"},
146 { PPC_REG_VS18, "vs18"},
147 { PPC_REG_VS19, "vs19"},
148 { PPC_REG_VS20, "vs20"},
149 { PPC_REG_VS21, "vs21"},
150 { PPC_REG_VS22, "vs22"},
151 { PPC_REG_VS23, "vs23"},
152 { PPC_REG_VS24, "vs24"},
153 { PPC_REG_VS25, "vs25"},
154 { PPC_REG_VS26, "vs26"},
155 { PPC_REG_VS27, "vs27"},
156 { PPC_REG_VS28, "vs28"},
157 { PPC_REG_VS29, "vs29"},
158 { PPC_REG_VS30, "vs30"},
159 { PPC_REG_VS31, "vs31"},
160 { PPC_REG_VS32, "vs32"},
161 { PPC_REG_VS33, "vs33"},
162 { PPC_REG_VS34, "vs34"},
163 { PPC_REG_VS35, "vs35"},
164 { PPC_REG_VS36, "vs36"},
165 { PPC_REG_VS37, "vs37"},
166 { PPC_REG_VS38, "vs38"},
167 { PPC_REG_VS39, "vs39"},
168 { PPC_REG_VS40, "vs40"},
169 { PPC_REG_VS41, "vs41"},
170 { PPC_REG_VS42, "vs42"},
171 { PPC_REG_VS43, "vs43"},
172 { PPC_REG_VS44, "vs44"},
173 { PPC_REG_VS45, "vs45"},
174 { PPC_REG_VS46, "vs46"},
175 { PPC_REG_VS47, "vs47"},
176 { PPC_REG_VS48, "vs48"},
177 { PPC_REG_VS49, "vs49"},
178 { PPC_REG_VS50, "vs50"},
179 { PPC_REG_VS51, "vs51"},
180 { PPC_REG_VS52, "vs52"},
181 { PPC_REG_VS53, "vs53"},
182 { PPC_REG_VS54, "vs54"},
183 { PPC_REG_VS55, "vs55"},
184 { PPC_REG_VS56, "vs56"},
185 { PPC_REG_VS57, "vs57"},
186 { PPC_REG_VS58, "vs58"},
187 { PPC_REG_VS59, "vs59"},
188 { PPC_REG_VS60, "vs60"},
189 { PPC_REG_VS61, "vs61"},
190 { PPC_REG_VS62, "vs62"},
191 { PPC_REG_VS63, "vs63"},
192 { PPC_REG_Q0, "q0" },
193 { PPC_REG_Q1, "q1" },
194 { PPC_REG_Q2, "q2" },
195 { PPC_REG_Q3, "q3" },
196 { PPC_REG_Q4, "q4" },
197 { PPC_REG_Q5, "q5" },
198 { PPC_REG_Q6, "q6" },
199 { PPC_REG_Q7, "q7" },
200 { PPC_REG_Q8, "q8" },
201 { PPC_REG_Q9, "q9" },
202 { PPC_REG_Q10, "q10" },
203 { PPC_REG_Q11, "q11" },
204 { PPC_REG_Q12, "q12" },
205 { PPC_REG_Q13, "q13" },
206 { PPC_REG_Q14, "q14" },
207 { PPC_REG_Q15, "q15" },
208 { PPC_REG_Q16, "q16" },
209 { PPC_REG_Q17, "q17" },
210 { PPC_REG_Q18, "q18" },
211 { PPC_REG_Q19, "q19" },
212 { PPC_REG_Q20, "q20" },
213 { PPC_REG_Q21, "q21" },
214 { PPC_REG_Q22, "q22" },
215 { PPC_REG_Q23, "q23" },
216 { PPC_REG_Q24, "q24" },
217 { PPC_REG_Q25, "q25" },
218 { PPC_REG_Q26, "q26" },
219 { PPC_REG_Q27, "q27" },
220 { PPC_REG_Q28, "q28" },
221 { PPC_REG_Q29, "q29" },
222 { PPC_REG_Q30, "q30" },
223 { PPC_REG_Q31, "q31" },
224
225 // extras
226 { PPC_REG_RM, "rm" },
227 { PPC_REG_CTR8, "ctr8" },
228 { PPC_REG_LR8, "lr8" },
229 { PPC_REG_CR1EQ, "cr1eq" },
230 { PPC_REG_X2, "x2" },
231 };
232 #endif
233
PPC_reg_name(csh handle,unsigned int reg)234 const char *PPC_reg_name(csh handle, unsigned int reg)
235 {
236 #ifndef CAPSTONE_DIET
237 if (reg >= ARR_SIZE(reg_name_maps))
238 return NULL;
239
240 return reg_name_maps[reg].name;
241 #else
242 return NULL;
243 #endif
244 }
245
246 static const insn_map insns[] = {
247 // dummy item
248 {
249 0, 0,
250 #ifndef CAPSTONE_DIET
251 { 0 }, { 0 }, { 0 }, 0, 0
252 #endif
253 },
254
255 #include "PPCMappingInsn.inc"
256 };
257
258 // given internal insn id, return public instruction info
PPC_get_insn_id(cs_struct * h,cs_insn * insn,unsigned int id)259 void PPC_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
260 {
261 int i;
262
263 i = insn_find(insns, ARR_SIZE(insns), id, &h->insn_cache);
264 if (i != 0) {
265 insn->id = insns[i].mapid;
266
267 if (h->detail) {
268 #ifndef CAPSTONE_DIET
269 cs_struct handle;
270 handle.detail = h->detail;
271
272 memcpy(insn->detail->regs_read, insns[i].regs_use, sizeof(insns[i].regs_use));
273 insn->detail->regs_read_count = (uint8_t)count_positive(insns[i].regs_use);
274
275 memcpy(insn->detail->regs_write, insns[i].regs_mod, sizeof(insns[i].regs_mod));
276 insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod);
277
278 memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups));
279 insn->detail->groups_count = (uint8_t)count_positive8(insns[i].groups);
280
281 if (insns[i].branch || insns[i].indirect_branch) {
282 // this insn also belongs to JUMP group. add JUMP group
283 insn->detail->groups[insn->detail->groups_count] = PPC_GRP_JUMP;
284 insn->detail->groups_count++;
285 }
286
287 insn->detail->ppc.update_cr0 = cs_reg_write((csh)&handle, insn, PPC_REG_CR0);
288 #endif
289 }
290 }
291 }
292
293 #ifndef CAPSTONE_DIET
294 static const name_map insn_name_maps[] = {
295 { PPC_INS_INVALID, NULL },
296
297 { PPC_INS_ADD, "add" },
298 { PPC_INS_ADDC, "addc" },
299 { PPC_INS_ADDE, "adde" },
300 { PPC_INS_ADDI, "addi" },
301 { PPC_INS_ADDIC, "addic" },
302 { PPC_INS_ADDIS, "addis" },
303 { PPC_INS_ADDME, "addme" },
304 { PPC_INS_ADDZE, "addze" },
305 { PPC_INS_AND, "and" },
306 { PPC_INS_ANDC, "andc" },
307 { PPC_INS_ANDIS, "andis" },
308 { PPC_INS_ANDI, "andi" },
309 { PPC_INS_ATTN, "attn" },
310 { PPC_INS_B, "b" },
311 { PPC_INS_BA, "ba" },
312 { PPC_INS_BC, "bc" },
313 { PPC_INS_BCCTR, "bcctr" },
314 { PPC_INS_BCCTRL, "bcctrl" },
315 { PPC_INS_BCL, "bcl" },
316 { PPC_INS_BCLR, "bclr" },
317 { PPC_INS_BCLRL, "bclrl" },
318 { PPC_INS_BCTR, "bctr" },
319 { PPC_INS_BCTRL, "bctrl" },
320 { PPC_INS_BCT, "bct" },
321 { PPC_INS_BDNZ, "bdnz" },
322 { PPC_INS_BDNZA, "bdnza" },
323 { PPC_INS_BDNZL, "bdnzl" },
324 { PPC_INS_BDNZLA, "bdnzla" },
325 { PPC_INS_BDNZLR, "bdnzlr" },
326 { PPC_INS_BDNZLRL, "bdnzlrl" },
327 { PPC_INS_BDZ, "bdz" },
328 { PPC_INS_BDZA, "bdza" },
329 { PPC_INS_BDZL, "bdzl" },
330 { PPC_INS_BDZLA, "bdzla" },
331 { PPC_INS_BDZLR, "bdzlr" },
332 { PPC_INS_BDZLRL, "bdzlrl" },
333 { PPC_INS_BL, "bl" },
334 { PPC_INS_BLA, "bla" },
335 { PPC_INS_BLR, "blr" },
336 { PPC_INS_BLRL, "blrl" },
337 { PPC_INS_BRINC, "brinc" },
338 { PPC_INS_CMPB, "cmpb" },
339 { PPC_INS_CMPD, "cmpd" },
340 { PPC_INS_CMPDI, "cmpdi" },
341 { PPC_INS_CMPLD, "cmpld" },
342 { PPC_INS_CMPLDI, "cmpldi" },
343 { PPC_INS_CMPLW, "cmplw" },
344 { PPC_INS_CMPLWI, "cmplwi" },
345 { PPC_INS_CMPW, "cmpw" },
346 { PPC_INS_CMPWI, "cmpwi" },
347 { PPC_INS_CNTLZD, "cntlzd" },
348 { PPC_INS_CNTLZW, "cntlzw" },
349 { PPC_INS_CREQV, "creqv" },
350 { PPC_INS_CRXOR, "crxor" },
351 { PPC_INS_CRAND, "crand" },
352 { PPC_INS_CRANDC, "crandc" },
353 { PPC_INS_CRNAND, "crnand" },
354 { PPC_INS_CRNOR, "crnor" },
355 { PPC_INS_CROR, "cror" },
356 { PPC_INS_CRORC, "crorc" },
357 { PPC_INS_DCBA, "dcba" },
358 { PPC_INS_DCBF, "dcbf" },
359 { PPC_INS_DCBI, "dcbi" },
360 { PPC_INS_DCBST, "dcbst" },
361 { PPC_INS_DCBT, "dcbt" },
362 { PPC_INS_DCBTST, "dcbtst" },
363 { PPC_INS_DCBZ, "dcbz" },
364 { PPC_INS_DCBZL, "dcbzl" },
365 { PPC_INS_DCCCI, "dccci" },
366 { PPC_INS_DIVD, "divd" },
367 { PPC_INS_DIVDU, "divdu" },
368 { PPC_INS_DIVW, "divw" },
369 { PPC_INS_DIVWU, "divwu" },
370 { PPC_INS_DSS, "dss" },
371 { PPC_INS_DSSALL, "dssall" },
372 { PPC_INS_DST, "dst" },
373 { PPC_INS_DSTST, "dstst" },
374 { PPC_INS_DSTSTT, "dststt" },
375 { PPC_INS_DSTT, "dstt" },
376 { PPC_INS_EQV, "eqv" },
377 { PPC_INS_EVABS, "evabs" },
378 { PPC_INS_EVADDIW, "evaddiw" },
379 { PPC_INS_EVADDSMIAAW, "evaddsmiaaw" },
380 { PPC_INS_EVADDSSIAAW, "evaddssiaaw" },
381 { PPC_INS_EVADDUMIAAW, "evaddumiaaw" },
382 { PPC_INS_EVADDUSIAAW, "evaddusiaaw" },
383 { PPC_INS_EVADDW, "evaddw" },
384 { PPC_INS_EVAND, "evand" },
385 { PPC_INS_EVANDC, "evandc" },
386 { PPC_INS_EVCMPEQ, "evcmpeq" },
387 { PPC_INS_EVCMPGTS, "evcmpgts" },
388 { PPC_INS_EVCMPGTU, "evcmpgtu" },
389 { PPC_INS_EVCMPLTS, "evcmplts" },
390 { PPC_INS_EVCMPLTU, "evcmpltu" },
391 { PPC_INS_EVCNTLSW, "evcntlsw" },
392 { PPC_INS_EVCNTLZW, "evcntlzw" },
393 { PPC_INS_EVDIVWS, "evdivws" },
394 { PPC_INS_EVDIVWU, "evdivwu" },
395 { PPC_INS_EVEQV, "eveqv" },
396 { PPC_INS_EVEXTSB, "evextsb" },
397 { PPC_INS_EVEXTSH, "evextsh" },
398 { PPC_INS_EVLDD, "evldd" },
399 { PPC_INS_EVLDDX, "evlddx" },
400 { PPC_INS_EVLDH, "evldh" },
401 { PPC_INS_EVLDHX, "evldhx" },
402 { PPC_INS_EVLDW, "evldw" },
403 { PPC_INS_EVLDWX, "evldwx" },
404 { PPC_INS_EVLHHESPLAT, "evlhhesplat" },
405 { PPC_INS_EVLHHESPLATX, "evlhhesplatx" },
406 { PPC_INS_EVLHHOSSPLAT, "evlhhossplat" },
407 { PPC_INS_EVLHHOSSPLATX, "evlhhossplatx" },
408 { PPC_INS_EVLHHOUSPLAT, "evlhhousplat" },
409 { PPC_INS_EVLHHOUSPLATX, "evlhhousplatx" },
410 { PPC_INS_EVLWHE, "evlwhe" },
411 { PPC_INS_EVLWHEX, "evlwhex" },
412 { PPC_INS_EVLWHOS, "evlwhos" },
413 { PPC_INS_EVLWHOSX, "evlwhosx" },
414 { PPC_INS_EVLWHOU, "evlwhou" },
415 { PPC_INS_EVLWHOUX, "evlwhoux" },
416 { PPC_INS_EVLWHSPLAT, "evlwhsplat" },
417 { PPC_INS_EVLWHSPLATX, "evlwhsplatx" },
418 { PPC_INS_EVLWWSPLAT, "evlwwsplat" },
419 { PPC_INS_EVLWWSPLATX, "evlwwsplatx" },
420 { PPC_INS_EVMERGEHI, "evmergehi" },
421 { PPC_INS_EVMERGEHILO, "evmergehilo" },
422 { PPC_INS_EVMERGELO, "evmergelo" },
423 { PPC_INS_EVMERGELOHI, "evmergelohi" },
424 { PPC_INS_EVMHEGSMFAA, "evmhegsmfaa" },
425 { PPC_INS_EVMHEGSMFAN, "evmhegsmfan" },
426 { PPC_INS_EVMHEGSMIAA, "evmhegsmiaa" },
427 { PPC_INS_EVMHEGSMIAN, "evmhegsmian" },
428 { PPC_INS_EVMHEGUMIAA, "evmhegumiaa" },
429 { PPC_INS_EVMHEGUMIAN, "evmhegumian" },
430 { PPC_INS_EVMHESMF, "evmhesmf" },
431 { PPC_INS_EVMHESMFA, "evmhesmfa" },
432 { PPC_INS_EVMHESMFAAW, "evmhesmfaaw" },
433 { PPC_INS_EVMHESMFANW, "evmhesmfanw" },
434 { PPC_INS_EVMHESMI, "evmhesmi" },
435 { PPC_INS_EVMHESMIA, "evmhesmia" },
436 { PPC_INS_EVMHESMIAAW, "evmhesmiaaw" },
437 { PPC_INS_EVMHESMIANW, "evmhesmianw" },
438 { PPC_INS_EVMHESSF, "evmhessf" },
439 { PPC_INS_EVMHESSFA, "evmhessfa" },
440 { PPC_INS_EVMHESSFAAW, "evmhessfaaw" },
441 { PPC_INS_EVMHESSFANW, "evmhessfanw" },
442 { PPC_INS_EVMHESSIAAW, "evmhessiaaw" },
443 { PPC_INS_EVMHESSIANW, "evmhessianw" },
444 { PPC_INS_EVMHEUMI, "evmheumi" },
445 { PPC_INS_EVMHEUMIA, "evmheumia" },
446 { PPC_INS_EVMHEUMIAAW, "evmheumiaaw" },
447 { PPC_INS_EVMHEUMIANW, "evmheumianw" },
448 { PPC_INS_EVMHEUSIAAW, "evmheusiaaw" },
449 { PPC_INS_EVMHEUSIANW, "evmheusianw" },
450 { PPC_INS_EVMHOGSMFAA, "evmhogsmfaa" },
451 { PPC_INS_EVMHOGSMFAN, "evmhogsmfan" },
452 { PPC_INS_EVMHOGSMIAA, "evmhogsmiaa" },
453 { PPC_INS_EVMHOGSMIAN, "evmhogsmian" },
454 { PPC_INS_EVMHOGUMIAA, "evmhogumiaa" },
455 { PPC_INS_EVMHOGUMIAN, "evmhogumian" },
456 { PPC_INS_EVMHOSMF, "evmhosmf" },
457 { PPC_INS_EVMHOSMFA, "evmhosmfa" },
458 { PPC_INS_EVMHOSMFAAW, "evmhosmfaaw" },
459 { PPC_INS_EVMHOSMFANW, "evmhosmfanw" },
460 { PPC_INS_EVMHOSMI, "evmhosmi" },
461 { PPC_INS_EVMHOSMIA, "evmhosmia" },
462 { PPC_INS_EVMHOSMIAAW, "evmhosmiaaw" },
463 { PPC_INS_EVMHOSMIANW, "evmhosmianw" },
464 { PPC_INS_EVMHOSSF, "evmhossf" },
465 { PPC_INS_EVMHOSSFA, "evmhossfa" },
466 { PPC_INS_EVMHOSSFAAW, "evmhossfaaw" },
467 { PPC_INS_EVMHOSSFANW, "evmhossfanw" },
468 { PPC_INS_EVMHOSSIAAW, "evmhossiaaw" },
469 { PPC_INS_EVMHOSSIANW, "evmhossianw" },
470 { PPC_INS_EVMHOUMI, "evmhoumi" },
471 { PPC_INS_EVMHOUMIA, "evmhoumia" },
472 { PPC_INS_EVMHOUMIAAW, "evmhoumiaaw" },
473 { PPC_INS_EVMHOUMIANW, "evmhoumianw" },
474 { PPC_INS_EVMHOUSIAAW, "evmhousiaaw" },
475 { PPC_INS_EVMHOUSIANW, "evmhousianw" },
476 { PPC_INS_EVMRA, "evmra" },
477 { PPC_INS_EVMWHSMF, "evmwhsmf" },
478 { PPC_INS_EVMWHSMFA, "evmwhsmfa" },
479 { PPC_INS_EVMWHSMI, "evmwhsmi" },
480 { PPC_INS_EVMWHSMIA, "evmwhsmia" },
481 { PPC_INS_EVMWHSSF, "evmwhssf" },
482 { PPC_INS_EVMWHSSFA, "evmwhssfa" },
483 { PPC_INS_EVMWHUMI, "evmwhumi" },
484 { PPC_INS_EVMWHUMIA, "evmwhumia" },
485 { PPC_INS_EVMWLSMIAAW, "evmwlsmiaaw" },
486 { PPC_INS_EVMWLSMIANW, "evmwlsmianw" },
487 { PPC_INS_EVMWLSSIAAW, "evmwlssiaaw" },
488 { PPC_INS_EVMWLSSIANW, "evmwlssianw" },
489 { PPC_INS_EVMWLUMI, "evmwlumi" },
490 { PPC_INS_EVMWLUMIA, "evmwlumia" },
491 { PPC_INS_EVMWLUMIAAW, "evmwlumiaaw" },
492 { PPC_INS_EVMWLUMIANW, "evmwlumianw" },
493 { PPC_INS_EVMWLUSIAAW, "evmwlusiaaw" },
494 { PPC_INS_EVMWLUSIANW, "evmwlusianw" },
495 { PPC_INS_EVMWSMF, "evmwsmf" },
496 { PPC_INS_EVMWSMFA, "evmwsmfa" },
497 { PPC_INS_EVMWSMFAA, "evmwsmfaa" },
498 { PPC_INS_EVMWSMFAN, "evmwsmfan" },
499 { PPC_INS_EVMWSMI, "evmwsmi" },
500 { PPC_INS_EVMWSMIA, "evmwsmia" },
501 { PPC_INS_EVMWSMIAA, "evmwsmiaa" },
502 { PPC_INS_EVMWSMIAN, "evmwsmian" },
503 { PPC_INS_EVMWSSF, "evmwssf" },
504 { PPC_INS_EVMWSSFA, "evmwssfa" },
505 { PPC_INS_EVMWSSFAA, "evmwssfaa" },
506 { PPC_INS_EVMWSSFAN, "evmwssfan" },
507 { PPC_INS_EVMWUMI, "evmwumi" },
508 { PPC_INS_EVMWUMIA, "evmwumia" },
509 { PPC_INS_EVMWUMIAA, "evmwumiaa" },
510 { PPC_INS_EVMWUMIAN, "evmwumian" },
511 { PPC_INS_EVNAND, "evnand" },
512 { PPC_INS_EVNEG, "evneg" },
513 { PPC_INS_EVNOR, "evnor" },
514 { PPC_INS_EVOR, "evor" },
515 { PPC_INS_EVORC, "evorc" },
516 { PPC_INS_EVRLW, "evrlw" },
517 { PPC_INS_EVRLWI, "evrlwi" },
518 { PPC_INS_EVRNDW, "evrndw" },
519 { PPC_INS_EVSLW, "evslw" },
520 { PPC_INS_EVSLWI, "evslwi" },
521 { PPC_INS_EVSPLATFI, "evsplatfi" },
522 { PPC_INS_EVSPLATI, "evsplati" },
523 { PPC_INS_EVSRWIS, "evsrwis" },
524 { PPC_INS_EVSRWIU, "evsrwiu" },
525 { PPC_INS_EVSRWS, "evsrws" },
526 { PPC_INS_EVSRWU, "evsrwu" },
527 { PPC_INS_EVSTDD, "evstdd" },
528 { PPC_INS_EVSTDDX, "evstddx" },
529 { PPC_INS_EVSTDH, "evstdh" },
530 { PPC_INS_EVSTDHX, "evstdhx" },
531 { PPC_INS_EVSTDW, "evstdw" },
532 { PPC_INS_EVSTDWX, "evstdwx" },
533 { PPC_INS_EVSTWHE, "evstwhe" },
534 { PPC_INS_EVSTWHEX, "evstwhex" },
535 { PPC_INS_EVSTWHO, "evstwho" },
536 { PPC_INS_EVSTWHOX, "evstwhox" },
537 { PPC_INS_EVSTWWE, "evstwwe" },
538 { PPC_INS_EVSTWWEX, "evstwwex" },
539 { PPC_INS_EVSTWWO, "evstwwo" },
540 { PPC_INS_EVSTWWOX, "evstwwox" },
541 { PPC_INS_EVSUBFSMIAAW, "evsubfsmiaaw" },
542 { PPC_INS_EVSUBFSSIAAW, "evsubfssiaaw" },
543 { PPC_INS_EVSUBFUMIAAW, "evsubfumiaaw" },
544 { PPC_INS_EVSUBFUSIAAW, "evsubfusiaaw" },
545 { PPC_INS_EVSUBFW, "evsubfw" },
546 { PPC_INS_EVSUBIFW, "evsubifw" },
547 { PPC_INS_EVXOR, "evxor" },
548 { PPC_INS_EXTSB, "extsb" },
549 { PPC_INS_EXTSH, "extsh" },
550 { PPC_INS_EXTSW, "extsw" },
551 { PPC_INS_EIEIO, "eieio" },
552 { PPC_INS_FABS, "fabs" },
553 { PPC_INS_FADD, "fadd" },
554 { PPC_INS_FADDS, "fadds" },
555 { PPC_INS_FCFID, "fcfid" },
556 { PPC_INS_FCFIDS, "fcfids" },
557 { PPC_INS_FCFIDU, "fcfidu" },
558 { PPC_INS_FCFIDUS, "fcfidus" },
559 { PPC_INS_FCMPU, "fcmpu" },
560 { PPC_INS_FCPSGN, "fcpsgn" },
561 { PPC_INS_FCTID, "fctid" },
562 { PPC_INS_FCTIDUZ, "fctiduz" },
563 { PPC_INS_FCTIDZ, "fctidz" },
564 { PPC_INS_FCTIW, "fctiw" },
565 { PPC_INS_FCTIWUZ, "fctiwuz" },
566 { PPC_INS_FCTIWZ, "fctiwz" },
567 { PPC_INS_FDIV, "fdiv" },
568 { PPC_INS_FDIVS, "fdivs" },
569 { PPC_INS_FMADD, "fmadd" },
570 { PPC_INS_FMADDS, "fmadds" },
571 { PPC_INS_FMR, "fmr" },
572 { PPC_INS_FMSUB, "fmsub" },
573 { PPC_INS_FMSUBS, "fmsubs" },
574 { PPC_INS_FMUL, "fmul" },
575 { PPC_INS_FMULS, "fmuls" },
576 { PPC_INS_FNABS, "fnabs" },
577 { PPC_INS_FNEG, "fneg" },
578 { PPC_INS_FNMADD, "fnmadd" },
579 { PPC_INS_FNMADDS, "fnmadds" },
580 { PPC_INS_FNMSUB, "fnmsub" },
581 { PPC_INS_FNMSUBS, "fnmsubs" },
582 { PPC_INS_FRE, "fre" },
583 { PPC_INS_FRES, "fres" },
584 { PPC_INS_FRIM, "frim" },
585 { PPC_INS_FRIN, "frin" },
586 { PPC_INS_FRIP, "frip" },
587 { PPC_INS_FRIZ, "friz" },
588 { PPC_INS_FRSP, "frsp" },
589 { PPC_INS_FRSQRTE, "frsqrte" },
590 { PPC_INS_FRSQRTES, "frsqrtes" },
591 { PPC_INS_FSEL, "fsel" },
592 { PPC_INS_FSQRT, "fsqrt" },
593 { PPC_INS_FSQRTS, "fsqrts" },
594 { PPC_INS_FSUB, "fsub" },
595 { PPC_INS_FSUBS, "fsubs" },
596 { PPC_INS_ICBI, "icbi" },
597 { PPC_INS_ICBT, "icbt" },
598 { PPC_INS_ICCCI, "iccci" },
599 { PPC_INS_ISEL, "isel" },
600 { PPC_INS_ISYNC, "isync" },
601 { PPC_INS_LA, "la" },
602 { PPC_INS_LBZ, "lbz" },
603 { PPC_INS_LBZCIX, "lbzcix" },
604 { PPC_INS_LBZU, "lbzu" },
605 { PPC_INS_LBZUX, "lbzux" },
606 { PPC_INS_LBZX, "lbzx" },
607 { PPC_INS_LD, "ld" },
608 { PPC_INS_LDARX, "ldarx" },
609 { PPC_INS_LDBRX, "ldbrx" },
610 { PPC_INS_LDCIX, "ldcix" },
611 { PPC_INS_LDU, "ldu" },
612 { PPC_INS_LDUX, "ldux" },
613 { PPC_INS_LDX, "ldx" },
614 { PPC_INS_LFD, "lfd" },
615 { PPC_INS_LFDU, "lfdu" },
616 { PPC_INS_LFDUX, "lfdux" },
617 { PPC_INS_LFDX, "lfdx" },
618 { PPC_INS_LFIWAX, "lfiwax" },
619 { PPC_INS_LFIWZX, "lfiwzx" },
620 { PPC_INS_LFS, "lfs" },
621 { PPC_INS_LFSU, "lfsu" },
622 { PPC_INS_LFSUX, "lfsux" },
623 { PPC_INS_LFSX, "lfsx" },
624 { PPC_INS_LHA, "lha" },
625 { PPC_INS_LHAU, "lhau" },
626 { PPC_INS_LHAUX, "lhaux" },
627 { PPC_INS_LHAX, "lhax" },
628 { PPC_INS_LHBRX, "lhbrx" },
629 { PPC_INS_LHZ, "lhz" },
630 { PPC_INS_LHZCIX, "lhzcix" },
631 { PPC_INS_LHZU, "lhzu" },
632 { PPC_INS_LHZUX, "lhzux" },
633 { PPC_INS_LHZX, "lhzx" },
634 { PPC_INS_LI, "li" },
635 { PPC_INS_LIS, "lis" },
636 { PPC_INS_LMW, "lmw" },
637 { PPC_INS_LSWI, "lswi" },
638 { PPC_INS_LVEBX, "lvebx" },
639 { PPC_INS_LVEHX, "lvehx" },
640 { PPC_INS_LVEWX, "lvewx" },
641 { PPC_INS_LVSL, "lvsl" },
642 { PPC_INS_LVSR, "lvsr" },
643 { PPC_INS_LVX, "lvx" },
644 { PPC_INS_LVXL, "lvxl" },
645 { PPC_INS_LWA, "lwa" },
646 { PPC_INS_LWARX, "lwarx" },
647 { PPC_INS_LWAUX, "lwaux" },
648 { PPC_INS_LWAX, "lwax" },
649 { PPC_INS_LWBRX, "lwbrx" },
650 { PPC_INS_LWZ, "lwz" },
651 { PPC_INS_LWZCIX, "lwzcix" },
652 { PPC_INS_LWZU, "lwzu" },
653 { PPC_INS_LWZUX, "lwzux" },
654 { PPC_INS_LWZX, "lwzx" },
655 { PPC_INS_LXSDX, "lxsdx" },
656 { PPC_INS_LXVD2X, "lxvd2x" },
657 { PPC_INS_LXVDSX, "lxvdsx" },
658 { PPC_INS_LXVW4X, "lxvw4x" },
659 { PPC_INS_MBAR, "mbar" },
660 { PPC_INS_MCRF, "mcrf" },
661 { PPC_INS_MCRFS, "mcrfs" },
662 { PPC_INS_MFCR, "mfcr" },
663 { PPC_INS_MFCTR, "mfctr" },
664 { PPC_INS_MFDCR, "mfdcr" },
665 { PPC_INS_MFFS, "mffs" },
666 { PPC_INS_MFLR, "mflr" },
667 { PPC_INS_MFMSR, "mfmsr" },
668 { PPC_INS_MFOCRF, "mfocrf" },
669 { PPC_INS_MFSPR, "mfspr" },
670 { PPC_INS_MFSR, "mfsr" },
671 { PPC_INS_MFSRIN, "mfsrin" },
672 { PPC_INS_MFTB, "mftb" },
673 { PPC_INS_MFVSCR, "mfvscr" },
674 { PPC_INS_MSYNC, "msync" },
675 { PPC_INS_MTCRF, "mtcrf" },
676 { PPC_INS_MTCTR, "mtctr" },
677 { PPC_INS_MTDCR, "mtdcr" },
678 { PPC_INS_MTFSB0, "mtfsb0" },
679 { PPC_INS_MTFSB1, "mtfsb1" },
680 { PPC_INS_MTFSF, "mtfsf" },
681 { PPC_INS_MTFSFI, "mtfsfi" },
682 { PPC_INS_MTLR, "mtlr" },
683 { PPC_INS_MTMSR, "mtmsr" },
684 { PPC_INS_MTMSRD, "mtmsrd" },
685 { PPC_INS_MTOCRF, "mtocrf" },
686 { PPC_INS_MTSPR, "mtspr" },
687 { PPC_INS_MTSR, "mtsr" },
688 { PPC_INS_MTSRIN, "mtsrin" },
689 { PPC_INS_MTVSCR, "mtvscr" },
690 { PPC_INS_MULHD, "mulhd" },
691 { PPC_INS_MULHDU, "mulhdu" },
692 { PPC_INS_MULHW, "mulhw" },
693 { PPC_INS_MULHWU, "mulhwu" },
694 { PPC_INS_MULLD, "mulld" },
695 { PPC_INS_MULLI, "mulli" },
696 { PPC_INS_MULLW, "mullw" },
697 { PPC_INS_NAND, "nand" },
698 { PPC_INS_NEG, "neg" },
699 { PPC_INS_NOP, "nop" },
700 { PPC_INS_ORI, "ori" },
701 { PPC_INS_NOR, "nor" },
702 { PPC_INS_OR, "or" },
703 { PPC_INS_ORC, "orc" },
704 { PPC_INS_ORIS, "oris" },
705 { PPC_INS_POPCNTD, "popcntd" },
706 { PPC_INS_POPCNTW, "popcntw" },
707 { PPC_INS_QVALIGNI, "qvaligni" },
708 { PPC_INS_QVESPLATI, "qvesplati" },
709 { PPC_INS_QVFABS, "qvfabs" },
710 { PPC_INS_QVFADD, "qvfadd" },
711 { PPC_INS_QVFADDS, "qvfadds" },
712 { PPC_INS_QVFCFID, "qvfcfid" },
713 { PPC_INS_QVFCFIDS, "qvfcfids" },
714 { PPC_INS_QVFCFIDU, "qvfcfidu" },
715 { PPC_INS_QVFCFIDUS, "qvfcfidus" },
716 { PPC_INS_QVFCMPEQ, "qvfcmpeq" },
717 { PPC_INS_QVFCMPGT, "qvfcmpgt" },
718 { PPC_INS_QVFCMPLT, "qvfcmplt" },
719 { PPC_INS_QVFCPSGN, "qvfcpsgn" },
720 { PPC_INS_QVFCTID, "qvfctid" },
721 { PPC_INS_QVFCTIDU, "qvfctidu" },
722 { PPC_INS_QVFCTIDUZ, "qvfctiduz" },
723 { PPC_INS_QVFCTIDZ, "qvfctidz" },
724 { PPC_INS_QVFCTIW, "qvfctiw" },
725 { PPC_INS_QVFCTIWU, "qvfctiwu" },
726 { PPC_INS_QVFCTIWUZ, "qvfctiwuz" },
727 { PPC_INS_QVFCTIWZ, "qvfctiwz" },
728 { PPC_INS_QVFLOGICAL, "qvflogical" },
729 { PPC_INS_QVFMADD, "qvfmadd" },
730 { PPC_INS_QVFMADDS, "qvfmadds" },
731 { PPC_INS_QVFMR, "qvfmr" },
732 { PPC_INS_QVFMSUB, "qvfmsub" },
733 { PPC_INS_QVFMSUBS, "qvfmsubs" },
734 { PPC_INS_QVFMUL, "qvfmul" },
735 { PPC_INS_QVFMULS, "qvfmuls" },
736 { PPC_INS_QVFNABS, "qvfnabs" },
737 { PPC_INS_QVFNEG, "qvfneg" },
738 { PPC_INS_QVFNMADD, "qvfnmadd" },
739 { PPC_INS_QVFNMADDS, "qvfnmadds" },
740 { PPC_INS_QVFNMSUB, "qvfnmsub" },
741 { PPC_INS_QVFNMSUBS, "qvfnmsubs" },
742 { PPC_INS_QVFPERM, "qvfperm" },
743 { PPC_INS_QVFRE, "qvfre" },
744 { PPC_INS_QVFRES, "qvfres" },
745 { PPC_INS_QVFRIM, "qvfrim" },
746 { PPC_INS_QVFRIN, "qvfrin" },
747 { PPC_INS_QVFRIP, "qvfrip" },
748 { PPC_INS_QVFRIZ, "qvfriz" },
749 { PPC_INS_QVFRSP, "qvfrsp" },
750 { PPC_INS_QVFRSQRTE, "qvfrsqrte" },
751 { PPC_INS_QVFRSQRTES, "qvfrsqrtes" },
752 { PPC_INS_QVFSEL, "qvfsel" },
753 { PPC_INS_QVFSUB, "qvfsub" },
754 { PPC_INS_QVFSUBS, "qvfsubs" },
755 { PPC_INS_QVFTSTNAN, "qvftstnan" },
756 { PPC_INS_QVFXMADD, "qvfxmadd" },
757 { PPC_INS_QVFXMADDS, "qvfxmadds" },
758 { PPC_INS_QVFXMUL, "qvfxmul" },
759 { PPC_INS_QVFXMULS, "qvfxmuls" },
760 { PPC_INS_QVFXXCPNMADD, "qvfxxcpnmadd" },
761 { PPC_INS_QVFXXCPNMADDS, "qvfxxcpnmadds" },
762 { PPC_INS_QVFXXMADD, "qvfxxmadd" },
763 { PPC_INS_QVFXXMADDS, "qvfxxmadds" },
764 { PPC_INS_QVFXXNPMADD, "qvfxxnpmadd" },
765 { PPC_INS_QVFXXNPMADDS, "qvfxxnpmadds" },
766 { PPC_INS_QVGPCI, "qvgpci" },
767 { PPC_INS_QVLFCDUX, "qvlfcdux" },
768 { PPC_INS_QVLFCDUXA, "qvlfcduxa" },
769 { PPC_INS_QVLFCDX, "qvlfcdx" },
770 { PPC_INS_QVLFCDXA, "qvlfcdxa" },
771 { PPC_INS_QVLFCSUX, "qvlfcsux" },
772 { PPC_INS_QVLFCSUXA, "qvlfcsuxa" },
773 { PPC_INS_QVLFCSX, "qvlfcsx" },
774 { PPC_INS_QVLFCSXA, "qvlfcsxa" },
775 { PPC_INS_QVLFDUX, "qvlfdux" },
776 { PPC_INS_QVLFDUXA, "qvlfduxa" },
777 { PPC_INS_QVLFDX, "qvlfdx" },
778 { PPC_INS_QVLFDXA, "qvlfdxa" },
779 { PPC_INS_QVLFIWAX, "qvlfiwax" },
780 { PPC_INS_QVLFIWAXA, "qvlfiwaxa" },
781 { PPC_INS_QVLFIWZX, "qvlfiwzx" },
782 { PPC_INS_QVLFIWZXA, "qvlfiwzxa" },
783 { PPC_INS_QVLFSUX, "qvlfsux" },
784 { PPC_INS_QVLFSUXA, "qvlfsuxa" },
785 { PPC_INS_QVLFSX, "qvlfsx" },
786 { PPC_INS_QVLFSXA, "qvlfsxa" },
787 { PPC_INS_QVLPCLDX, "qvlpcldx" },
788 { PPC_INS_QVLPCLSX, "qvlpclsx" },
789 { PPC_INS_QVLPCRDX, "qvlpcrdx" },
790 { PPC_INS_QVLPCRSX, "qvlpcrsx" },
791 { PPC_INS_QVSTFCDUX, "qvstfcdux" },
792 { PPC_INS_QVSTFCDUXA, "qvstfcduxa" },
793 { PPC_INS_QVSTFCDUXI, "qvstfcduxi" },
794 { PPC_INS_QVSTFCDUXIA, "qvstfcduxia" },
795 { PPC_INS_QVSTFCDX, "qvstfcdx" },
796 { PPC_INS_QVSTFCDXA, "qvstfcdxa" },
797 { PPC_INS_QVSTFCDXI, "qvstfcdxi" },
798 { PPC_INS_QVSTFCDXIA, "qvstfcdxia" },
799 { PPC_INS_QVSTFCSUX, "qvstfcsux" },
800 { PPC_INS_QVSTFCSUXA, "qvstfcsuxa" },
801 { PPC_INS_QVSTFCSUXI, "qvstfcsuxi" },
802 { PPC_INS_QVSTFCSUXIA, "qvstfcsuxia" },
803 { PPC_INS_QVSTFCSX, "qvstfcsx" },
804 { PPC_INS_QVSTFCSXA, "qvstfcsxa" },
805 { PPC_INS_QVSTFCSXI, "qvstfcsxi" },
806 { PPC_INS_QVSTFCSXIA, "qvstfcsxia" },
807 { PPC_INS_QVSTFDUX, "qvstfdux" },
808 { PPC_INS_QVSTFDUXA, "qvstfduxa" },
809 { PPC_INS_QVSTFDUXI, "qvstfduxi" },
810 { PPC_INS_QVSTFDUXIA, "qvstfduxia" },
811 { PPC_INS_QVSTFDX, "qvstfdx" },
812 { PPC_INS_QVSTFDXA, "qvstfdxa" },
813 { PPC_INS_QVSTFDXI, "qvstfdxi" },
814 { PPC_INS_QVSTFDXIA, "qvstfdxia" },
815 { PPC_INS_QVSTFIWX, "qvstfiwx" },
816 { PPC_INS_QVSTFIWXA, "qvstfiwxa" },
817 { PPC_INS_QVSTFSUX, "qvstfsux" },
818 { PPC_INS_QVSTFSUXA, "qvstfsuxa" },
819 { PPC_INS_QVSTFSUXI, "qvstfsuxi" },
820 { PPC_INS_QVSTFSUXIA, "qvstfsuxia" },
821 { PPC_INS_QVSTFSX, "qvstfsx" },
822 { PPC_INS_QVSTFSXA, "qvstfsxa" },
823 { PPC_INS_QVSTFSXI, "qvstfsxi" },
824 { PPC_INS_QVSTFSXIA, "qvstfsxia" },
825 { PPC_INS_RFCI, "rfci" },
826 { PPC_INS_RFDI, "rfdi" },
827 { PPC_INS_RFI, "rfi" },
828 { PPC_INS_RFID, "rfid" },
829 { PPC_INS_RFMCI, "rfmci" },
830 { PPC_INS_RLDCL, "rldcl" },
831 { PPC_INS_RLDCR, "rldcr" },
832 { PPC_INS_RLDIC, "rldic" },
833 { PPC_INS_RLDICL, "rldicl" },
834 { PPC_INS_RLDICR, "rldicr" },
835 { PPC_INS_RLDIMI, "rldimi" },
836 { PPC_INS_RLWIMI, "rlwimi" },
837 { PPC_INS_RLWINM, "rlwinm" },
838 { PPC_INS_RLWNM, "rlwnm" },
839 { PPC_INS_SC, "sc" },
840 { PPC_INS_SLBIA, "slbia" },
841 { PPC_INS_SLBIE, "slbie" },
842 { PPC_INS_SLBMFEE, "slbmfee" },
843 { PPC_INS_SLBMTE, "slbmte" },
844 { PPC_INS_SLD, "sld" },
845 { PPC_INS_SLW, "slw" },
846 { PPC_INS_SRAD, "srad" },
847 { PPC_INS_SRADI, "sradi" },
848 { PPC_INS_SRAW, "sraw" },
849 { PPC_INS_SRAWI, "srawi" },
850 { PPC_INS_SRD, "srd" },
851 { PPC_INS_SRW, "srw" },
852 { PPC_INS_STB, "stb" },
853 { PPC_INS_STBCIX, "stbcix" },
854 { PPC_INS_STBU, "stbu" },
855 { PPC_INS_STBUX, "stbux" },
856 { PPC_INS_STBX, "stbx" },
857 { PPC_INS_STD, "std" },
858 { PPC_INS_STDBRX, "stdbrx" },
859 { PPC_INS_STDCIX, "stdcix" },
860 { PPC_INS_STDCX, "stdcx" },
861 { PPC_INS_STDU, "stdu" },
862 { PPC_INS_STDUX, "stdux" },
863 { PPC_INS_STDX, "stdx" },
864 { PPC_INS_STFD, "stfd" },
865 { PPC_INS_STFDU, "stfdu" },
866 { PPC_INS_STFDUX, "stfdux" },
867 { PPC_INS_STFDX, "stfdx" },
868 { PPC_INS_STFIWX, "stfiwx" },
869 { PPC_INS_STFS, "stfs" },
870 { PPC_INS_STFSU, "stfsu" },
871 { PPC_INS_STFSUX, "stfsux" },
872 { PPC_INS_STFSX, "stfsx" },
873 { PPC_INS_STH, "sth" },
874 { PPC_INS_STHBRX, "sthbrx" },
875 { PPC_INS_STHCIX, "sthcix" },
876 { PPC_INS_STHU, "sthu" },
877 { PPC_INS_STHUX, "sthux" },
878 { PPC_INS_STHX, "sthx" },
879 { PPC_INS_STMW, "stmw" },
880 { PPC_INS_STSWI, "stswi" },
881 { PPC_INS_STVEBX, "stvebx" },
882 { PPC_INS_STVEHX, "stvehx" },
883 { PPC_INS_STVEWX, "stvewx" },
884 { PPC_INS_STVX, "stvx" },
885 { PPC_INS_STVXL, "stvxl" },
886 { PPC_INS_STW, "stw" },
887 { PPC_INS_STWBRX, "stwbrx" },
888 { PPC_INS_STWCIX, "stwcix" },
889 { PPC_INS_STWCX, "stwcx" },
890 { PPC_INS_STWU, "stwu" },
891 { PPC_INS_STWUX, "stwux" },
892 { PPC_INS_STWX, "stwx" },
893 { PPC_INS_STXSDX, "stxsdx" },
894 { PPC_INS_STXVD2X, "stxvd2x" },
895 { PPC_INS_STXVW4X, "stxvw4x" },
896 { PPC_INS_SUBF, "subf" },
897 { PPC_INS_SUBFC, "subfc" },
898 { PPC_INS_SUBFE, "subfe" },
899 { PPC_INS_SUBFIC, "subfic" },
900 { PPC_INS_SUBFME, "subfme" },
901 { PPC_INS_SUBFZE, "subfze" },
902 { PPC_INS_SYNC, "sync" },
903 { PPC_INS_TD, "td" },
904 { PPC_INS_TDI, "tdi" },
905 { PPC_INS_TLBIA, "tlbia" },
906 { PPC_INS_TLBIE, "tlbie" },
907 { PPC_INS_TLBIEL, "tlbiel" },
908 { PPC_INS_TLBIVAX, "tlbivax" },
909 { PPC_INS_TLBLD, "tlbld" },
910 { PPC_INS_TLBLI, "tlbli" },
911 { PPC_INS_TLBRE, "tlbre" },
912 { PPC_INS_TLBSX, "tlbsx" },
913 { PPC_INS_TLBSYNC, "tlbsync" },
914 { PPC_INS_TLBWE, "tlbwe" },
915 { PPC_INS_TRAP, "trap" },
916 { PPC_INS_TW, "tw" },
917 { PPC_INS_TWI, "twi" },
918 { PPC_INS_VADDCUW, "vaddcuw" },
919 { PPC_INS_VADDFP, "vaddfp" },
920 { PPC_INS_VADDSBS, "vaddsbs" },
921 { PPC_INS_VADDSHS, "vaddshs" },
922 { PPC_INS_VADDSWS, "vaddsws" },
923 { PPC_INS_VADDUBM, "vaddubm" },
924 { PPC_INS_VADDUBS, "vaddubs" },
925 { PPC_INS_VADDUDM, "vaddudm" },
926 { PPC_INS_VADDUHM, "vadduhm" },
927 { PPC_INS_VADDUHS, "vadduhs" },
928 { PPC_INS_VADDUWM, "vadduwm" },
929 { PPC_INS_VADDUWS, "vadduws" },
930 { PPC_INS_VAND, "vand" },
931 { PPC_INS_VANDC, "vandc" },
932 { PPC_INS_VAVGSB, "vavgsb" },
933 { PPC_INS_VAVGSH, "vavgsh" },
934 { PPC_INS_VAVGSW, "vavgsw" },
935 { PPC_INS_VAVGUB, "vavgub" },
936 { PPC_INS_VAVGUH, "vavguh" },
937 { PPC_INS_VAVGUW, "vavguw" },
938 { PPC_INS_VCFSX, "vcfsx" },
939 { PPC_INS_VCFUX, "vcfux" },
940 { PPC_INS_VCLZB, "vclzb" },
941 { PPC_INS_VCLZD, "vclzd" },
942 { PPC_INS_VCLZH, "vclzh" },
943 { PPC_INS_VCLZW, "vclzw" },
944 { PPC_INS_VCMPBFP, "vcmpbfp" },
945 { PPC_INS_VCMPEQFP, "vcmpeqfp" },
946 { PPC_INS_VCMPEQUB, "vcmpequb" },
947 { PPC_INS_VCMPEQUD, "vcmpequd" },
948 { PPC_INS_VCMPEQUH, "vcmpequh" },
949 { PPC_INS_VCMPEQUW, "vcmpequw" },
950 { PPC_INS_VCMPGEFP, "vcmpgefp" },
951 { PPC_INS_VCMPGTFP, "vcmpgtfp" },
952 { PPC_INS_VCMPGTSB, "vcmpgtsb" },
953 { PPC_INS_VCMPGTSD, "vcmpgtsd" },
954 { PPC_INS_VCMPGTSH, "vcmpgtsh" },
955 { PPC_INS_VCMPGTSW, "vcmpgtsw" },
956 { PPC_INS_VCMPGTUB, "vcmpgtub" },
957 { PPC_INS_VCMPGTUD, "vcmpgtud" },
958 { PPC_INS_VCMPGTUH, "vcmpgtuh" },
959 { PPC_INS_VCMPGTUW, "vcmpgtuw" },
960 { PPC_INS_VCTSXS, "vctsxs" },
961 { PPC_INS_VCTUXS, "vctuxs" },
962 { PPC_INS_VEQV, "veqv" },
963 { PPC_INS_VEXPTEFP, "vexptefp" },
964 { PPC_INS_VLOGEFP, "vlogefp" },
965 { PPC_INS_VMADDFP, "vmaddfp" },
966 { PPC_INS_VMAXFP, "vmaxfp" },
967 { PPC_INS_VMAXSB, "vmaxsb" },
968 { PPC_INS_VMAXSD, "vmaxsd" },
969 { PPC_INS_VMAXSH, "vmaxsh" },
970 { PPC_INS_VMAXSW, "vmaxsw" },
971 { PPC_INS_VMAXUB, "vmaxub" },
972 { PPC_INS_VMAXUD, "vmaxud" },
973 { PPC_INS_VMAXUH, "vmaxuh" },
974 { PPC_INS_VMAXUW, "vmaxuw" },
975 { PPC_INS_VMHADDSHS, "vmhaddshs" },
976 { PPC_INS_VMHRADDSHS, "vmhraddshs" },
977 { PPC_INS_VMINUD, "vminud" },
978 { PPC_INS_VMINFP, "vminfp" },
979 { PPC_INS_VMINSB, "vminsb" },
980 { PPC_INS_VMINSD, "vminsd" },
981 { PPC_INS_VMINSH, "vminsh" },
982 { PPC_INS_VMINSW, "vminsw" },
983 { PPC_INS_VMINUB, "vminub" },
984 { PPC_INS_VMINUH, "vminuh" },
985 { PPC_INS_VMINUW, "vminuw" },
986 { PPC_INS_VMLADDUHM, "vmladduhm" },
987 { PPC_INS_VMRGHB, "vmrghb" },
988 { PPC_INS_VMRGHH, "vmrghh" },
989 { PPC_INS_VMRGHW, "vmrghw" },
990 { PPC_INS_VMRGLB, "vmrglb" },
991 { PPC_INS_VMRGLH, "vmrglh" },
992 { PPC_INS_VMRGLW, "vmrglw" },
993 { PPC_INS_VMSUMMBM, "vmsummbm" },
994 { PPC_INS_VMSUMSHM, "vmsumshm" },
995 { PPC_INS_VMSUMSHS, "vmsumshs" },
996 { PPC_INS_VMSUMUBM, "vmsumubm" },
997 { PPC_INS_VMSUMUHM, "vmsumuhm" },
998 { PPC_INS_VMSUMUHS, "vmsumuhs" },
999 { PPC_INS_VMULESB, "vmulesb" },
1000 { PPC_INS_VMULESH, "vmulesh" },
1001 { PPC_INS_VMULESW, "vmulesw" },
1002 { PPC_INS_VMULEUB, "vmuleub" },
1003 { PPC_INS_VMULEUH, "vmuleuh" },
1004 { PPC_INS_VMULEUW, "vmuleuw" },
1005 { PPC_INS_VMULOSB, "vmulosb" },
1006 { PPC_INS_VMULOSH, "vmulosh" },
1007 { PPC_INS_VMULOSW, "vmulosw" },
1008 { PPC_INS_VMULOUB, "vmuloub" },
1009 { PPC_INS_VMULOUH, "vmulouh" },
1010 { PPC_INS_VMULOUW, "vmulouw" },
1011 { PPC_INS_VMULUWM, "vmuluwm" },
1012 { PPC_INS_VNAND, "vnand" },
1013 { PPC_INS_VNMSUBFP, "vnmsubfp" },
1014 { PPC_INS_VNOR, "vnor" },
1015 { PPC_INS_VOR, "vor" },
1016 { PPC_INS_VORC, "vorc" },
1017 { PPC_INS_VPERM, "vperm" },
1018 { PPC_INS_VPKPX, "vpkpx" },
1019 { PPC_INS_VPKSHSS, "vpkshss" },
1020 { PPC_INS_VPKSHUS, "vpkshus" },
1021 { PPC_INS_VPKSWSS, "vpkswss" },
1022 { PPC_INS_VPKSWUS, "vpkswus" },
1023 { PPC_INS_VPKUHUM, "vpkuhum" },
1024 { PPC_INS_VPKUHUS, "vpkuhus" },
1025 { PPC_INS_VPKUWUM, "vpkuwum" },
1026 { PPC_INS_VPKUWUS, "vpkuwus" },
1027 { PPC_INS_VPOPCNTB, "vpopcntb" },
1028 { PPC_INS_VPOPCNTD, "vpopcntd" },
1029 { PPC_INS_VPOPCNTH, "vpopcnth" },
1030 { PPC_INS_VPOPCNTW, "vpopcntw" },
1031 { PPC_INS_VREFP, "vrefp" },
1032 { PPC_INS_VRFIM, "vrfim" },
1033 { PPC_INS_VRFIN, "vrfin" },
1034 { PPC_INS_VRFIP, "vrfip" },
1035 { PPC_INS_VRFIZ, "vrfiz" },
1036 { PPC_INS_VRLB, "vrlb" },
1037 { PPC_INS_VRLD, "vrld" },
1038 { PPC_INS_VRLH, "vrlh" },
1039 { PPC_INS_VRLW, "vrlw" },
1040 { PPC_INS_VRSQRTEFP, "vrsqrtefp" },
1041 { PPC_INS_VSEL, "vsel" },
1042 { PPC_INS_VSL, "vsl" },
1043 { PPC_INS_VSLB, "vslb" },
1044 { PPC_INS_VSLD, "vsld" },
1045 { PPC_INS_VSLDOI, "vsldoi" },
1046 { PPC_INS_VSLH, "vslh" },
1047 { PPC_INS_VSLO, "vslo" },
1048 { PPC_INS_VSLW, "vslw" },
1049 { PPC_INS_VSPLTB, "vspltb" },
1050 { PPC_INS_VSPLTH, "vsplth" },
1051 { PPC_INS_VSPLTISB, "vspltisb" },
1052 { PPC_INS_VSPLTISH, "vspltish" },
1053 { PPC_INS_VSPLTISW, "vspltisw" },
1054 { PPC_INS_VSPLTW, "vspltw" },
1055 { PPC_INS_VSR, "vsr" },
1056 { PPC_INS_VSRAB, "vsrab" },
1057 { PPC_INS_VSRAD, "vsrad" },
1058 { PPC_INS_VSRAH, "vsrah" },
1059 { PPC_INS_VSRAW, "vsraw" },
1060 { PPC_INS_VSRB, "vsrb" },
1061 { PPC_INS_VSRD, "vsrd" },
1062 { PPC_INS_VSRH, "vsrh" },
1063 { PPC_INS_VSRO, "vsro" },
1064 { PPC_INS_VSRW, "vsrw" },
1065 { PPC_INS_VSUBCUW, "vsubcuw" },
1066 { PPC_INS_VSUBFP, "vsubfp" },
1067 { PPC_INS_VSUBSBS, "vsubsbs" },
1068 { PPC_INS_VSUBSHS, "vsubshs" },
1069 { PPC_INS_VSUBSWS, "vsubsws" },
1070 { PPC_INS_VSUBUBM, "vsububm" },
1071 { PPC_INS_VSUBUBS, "vsububs" },
1072 { PPC_INS_VSUBUDM, "vsubudm" },
1073 { PPC_INS_VSUBUHM, "vsubuhm" },
1074 { PPC_INS_VSUBUHS, "vsubuhs" },
1075 { PPC_INS_VSUBUWM, "vsubuwm" },
1076 { PPC_INS_VSUBUWS, "vsubuws" },
1077 { PPC_INS_VSUM2SWS, "vsum2sws" },
1078 { PPC_INS_VSUM4SBS, "vsum4sbs" },
1079 { PPC_INS_VSUM4SHS, "vsum4shs" },
1080 { PPC_INS_VSUM4UBS, "vsum4ubs" },
1081 { PPC_INS_VSUMSWS, "vsumsws" },
1082 { PPC_INS_VUPKHPX, "vupkhpx" },
1083 { PPC_INS_VUPKHSB, "vupkhsb" },
1084 { PPC_INS_VUPKHSH, "vupkhsh" },
1085 { PPC_INS_VUPKLPX, "vupklpx" },
1086 { PPC_INS_VUPKLSB, "vupklsb" },
1087 { PPC_INS_VUPKLSH, "vupklsh" },
1088 { PPC_INS_VXOR, "vxor" },
1089 { PPC_INS_WAIT, "wait" },
1090 { PPC_INS_WRTEE, "wrtee" },
1091 { PPC_INS_WRTEEI, "wrteei" },
1092 { PPC_INS_XOR, "xor" },
1093 { PPC_INS_XORI, "xori" },
1094 { PPC_INS_XORIS, "xoris" },
1095 { PPC_INS_XSABSDP, "xsabsdp" },
1096 { PPC_INS_XSADDDP, "xsadddp" },
1097 { PPC_INS_XSCMPODP, "xscmpodp" },
1098 { PPC_INS_XSCMPUDP, "xscmpudp" },
1099 { PPC_INS_XSCPSGNDP, "xscpsgndp" },
1100 { PPC_INS_XSCVDPSP, "xscvdpsp" },
1101 { PPC_INS_XSCVDPSXDS, "xscvdpsxds" },
1102 { PPC_INS_XSCVDPSXWS, "xscvdpsxws" },
1103 { PPC_INS_XSCVDPUXDS, "xscvdpuxds" },
1104 { PPC_INS_XSCVDPUXWS, "xscvdpuxws" },
1105 { PPC_INS_XSCVSPDP, "xscvspdp" },
1106 { PPC_INS_XSCVSXDDP, "xscvsxddp" },
1107 { PPC_INS_XSCVUXDDP, "xscvuxddp" },
1108 { PPC_INS_XSDIVDP, "xsdivdp" },
1109 { PPC_INS_XSMADDADP, "xsmaddadp" },
1110 { PPC_INS_XSMADDMDP, "xsmaddmdp" },
1111 { PPC_INS_XSMAXDP, "xsmaxdp" },
1112 { PPC_INS_XSMINDP, "xsmindp" },
1113 { PPC_INS_XSMSUBADP, "xsmsubadp" },
1114 { PPC_INS_XSMSUBMDP, "xsmsubmdp" },
1115 { PPC_INS_XSMULDP, "xsmuldp" },
1116 { PPC_INS_XSNABSDP, "xsnabsdp" },
1117 { PPC_INS_XSNEGDP, "xsnegdp" },
1118 { PPC_INS_XSNMADDADP, "xsnmaddadp" },
1119 { PPC_INS_XSNMADDMDP, "xsnmaddmdp" },
1120 { PPC_INS_XSNMSUBADP, "xsnmsubadp" },
1121 { PPC_INS_XSNMSUBMDP, "xsnmsubmdp" },
1122 { PPC_INS_XSRDPI, "xsrdpi" },
1123 { PPC_INS_XSRDPIC, "xsrdpic" },
1124 { PPC_INS_XSRDPIM, "xsrdpim" },
1125 { PPC_INS_XSRDPIP, "xsrdpip" },
1126 { PPC_INS_XSRDPIZ, "xsrdpiz" },
1127 { PPC_INS_XSREDP, "xsredp" },
1128 { PPC_INS_XSRSQRTEDP, "xsrsqrtedp" },
1129 { PPC_INS_XSSQRTDP, "xssqrtdp" },
1130 { PPC_INS_XSSUBDP, "xssubdp" },
1131 { PPC_INS_XSTDIVDP, "xstdivdp" },
1132 { PPC_INS_XSTSQRTDP, "xstsqrtdp" },
1133 { PPC_INS_XVABSDP, "xvabsdp" },
1134 { PPC_INS_XVABSSP, "xvabssp" },
1135 { PPC_INS_XVADDDP, "xvadddp" },
1136 { PPC_INS_XVADDSP, "xvaddsp" },
1137 { PPC_INS_XVCMPEQDP, "xvcmpeqdp" },
1138 { PPC_INS_XVCMPEQSP, "xvcmpeqsp" },
1139 { PPC_INS_XVCMPGEDP, "xvcmpgedp" },
1140 { PPC_INS_XVCMPGESP, "xvcmpgesp" },
1141 { PPC_INS_XVCMPGTDP, "xvcmpgtdp" },
1142 { PPC_INS_XVCMPGTSP, "xvcmpgtsp" },
1143 { PPC_INS_XVCPSGNDP, "xvcpsgndp" },
1144 { PPC_INS_XVCPSGNSP, "xvcpsgnsp" },
1145 { PPC_INS_XVCVDPSP, "xvcvdpsp" },
1146 { PPC_INS_XVCVDPSXDS, "xvcvdpsxds" },
1147 { PPC_INS_XVCVDPSXWS, "xvcvdpsxws" },
1148 { PPC_INS_XVCVDPUXDS, "xvcvdpuxds" },
1149 { PPC_INS_XVCVDPUXWS, "xvcvdpuxws" },
1150 { PPC_INS_XVCVSPDP, "xvcvspdp" },
1151 { PPC_INS_XVCVSPSXDS, "xvcvspsxds" },
1152 { PPC_INS_XVCVSPSXWS, "xvcvspsxws" },
1153 { PPC_INS_XVCVSPUXDS, "xvcvspuxds" },
1154 { PPC_INS_XVCVSPUXWS, "xvcvspuxws" },
1155 { PPC_INS_XVCVSXDDP, "xvcvsxddp" },
1156 { PPC_INS_XVCVSXDSP, "xvcvsxdsp" },
1157 { PPC_INS_XVCVSXWDP, "xvcvsxwdp" },
1158 { PPC_INS_XVCVSXWSP, "xvcvsxwsp" },
1159 { PPC_INS_XVCVUXDDP, "xvcvuxddp" },
1160 { PPC_INS_XVCVUXDSP, "xvcvuxdsp" },
1161 { PPC_INS_XVCVUXWDP, "xvcvuxwdp" },
1162 { PPC_INS_XVCVUXWSP, "xvcvuxwsp" },
1163 { PPC_INS_XVDIVDP, "xvdivdp" },
1164 { PPC_INS_XVDIVSP, "xvdivsp" },
1165 { PPC_INS_XVMADDADP, "xvmaddadp" },
1166 { PPC_INS_XVMADDASP, "xvmaddasp" },
1167 { PPC_INS_XVMADDMDP, "xvmaddmdp" },
1168 { PPC_INS_XVMADDMSP, "xvmaddmsp" },
1169 { PPC_INS_XVMAXDP, "xvmaxdp" },
1170 { PPC_INS_XVMAXSP, "xvmaxsp" },
1171 { PPC_INS_XVMINDP, "xvmindp" },
1172 { PPC_INS_XVMINSP, "xvminsp" },
1173 { PPC_INS_XVMSUBADP, "xvmsubadp" },
1174 { PPC_INS_XVMSUBASP, "xvmsubasp" },
1175 { PPC_INS_XVMSUBMDP, "xvmsubmdp" },
1176 { PPC_INS_XVMSUBMSP, "xvmsubmsp" },
1177 { PPC_INS_XVMULDP, "xvmuldp" },
1178 { PPC_INS_XVMULSP, "xvmulsp" },
1179 { PPC_INS_XVNABSDP, "xvnabsdp" },
1180 { PPC_INS_XVNABSSP, "xvnabssp" },
1181 { PPC_INS_XVNEGDP, "xvnegdp" },
1182 { PPC_INS_XVNEGSP, "xvnegsp" },
1183 { PPC_INS_XVNMADDADP, "xvnmaddadp" },
1184 { PPC_INS_XVNMADDASP, "xvnmaddasp" },
1185 { PPC_INS_XVNMADDMDP, "xvnmaddmdp" },
1186 { PPC_INS_XVNMADDMSP, "xvnmaddmsp" },
1187 { PPC_INS_XVNMSUBADP, "xvnmsubadp" },
1188 { PPC_INS_XVNMSUBASP, "xvnmsubasp" },
1189 { PPC_INS_XVNMSUBMDP, "xvnmsubmdp" },
1190 { PPC_INS_XVNMSUBMSP, "xvnmsubmsp" },
1191 { PPC_INS_XVRDPI, "xvrdpi" },
1192 { PPC_INS_XVRDPIC, "xvrdpic" },
1193 { PPC_INS_XVRDPIM, "xvrdpim" },
1194 { PPC_INS_XVRDPIP, "xvrdpip" },
1195 { PPC_INS_XVRDPIZ, "xvrdpiz" },
1196 { PPC_INS_XVREDP, "xvredp" },
1197 { PPC_INS_XVRESP, "xvresp" },
1198 { PPC_INS_XVRSPI, "xvrspi" },
1199 { PPC_INS_XVRSPIC, "xvrspic" },
1200 { PPC_INS_XVRSPIM, "xvrspim" },
1201 { PPC_INS_XVRSPIP, "xvrspip" },
1202 { PPC_INS_XVRSPIZ, "xvrspiz" },
1203 { PPC_INS_XVRSQRTEDP, "xvrsqrtedp" },
1204 { PPC_INS_XVRSQRTESP, "xvrsqrtesp" },
1205 { PPC_INS_XVSQRTDP, "xvsqrtdp" },
1206 { PPC_INS_XVSQRTSP, "xvsqrtsp" },
1207 { PPC_INS_XVSUBDP, "xvsubdp" },
1208 { PPC_INS_XVSUBSP, "xvsubsp" },
1209 { PPC_INS_XVTDIVDP, "xvtdivdp" },
1210 { PPC_INS_XVTDIVSP, "xvtdivsp" },
1211 { PPC_INS_XVTSQRTDP, "xvtsqrtdp" },
1212 { PPC_INS_XVTSQRTSP, "xvtsqrtsp" },
1213 { PPC_INS_XXLAND, "xxland" },
1214 { PPC_INS_XXLANDC, "xxlandc" },
1215 { PPC_INS_XXLEQV, "xxleqv" },
1216 { PPC_INS_XXLNAND, "xxlnand" },
1217 { PPC_INS_XXLNOR, "xxlnor" },
1218 { PPC_INS_XXLOR, "xxlor" },
1219 { PPC_INS_XXLORC, "xxlorc" },
1220 { PPC_INS_XXLXOR, "xxlxor" },
1221 { PPC_INS_XXMRGHW, "xxmrghw" },
1222 { PPC_INS_XXMRGLW, "xxmrglw" },
1223 { PPC_INS_XXPERMDI, "xxpermdi" },
1224 { PPC_INS_XXSEL, "xxsel" },
1225 { PPC_INS_XXSLDWI, "xxsldwi" },
1226 { PPC_INS_XXSPLTW, "xxspltw" },
1227 { PPC_INS_BCA, "bca" },
1228 { PPC_INS_BCLA, "bcla" },
1229
1230 // extra & alias instructions
1231 { PPC_INS_SLWI, "slwi" },
1232 { PPC_INS_SRWI, "srwi" },
1233 { PPC_INS_SLDI, "sldi" },
1234 { PPC_INS_BTA, "bta" },
1235 { PPC_INS_CRSET, "crset" },
1236 { PPC_INS_CRNOT, "crnot" },
1237 { PPC_INS_CRMOVE, "crmove" },
1238 { PPC_INS_CRCLR, "crclr" },
1239 { PPC_INS_MFBR0, "mfbr0" },
1240 { PPC_INS_MFBR1, "mfbr1" },
1241 { PPC_INS_MFBR2, "mfbr2" },
1242 { PPC_INS_MFBR3, "mfbr3" },
1243 { PPC_INS_MFBR4, "mfbr4" },
1244 { PPC_INS_MFBR5, "mfbr5" },
1245 { PPC_INS_MFBR6, "mfbr6" },
1246 { PPC_INS_MFBR7, "mfbr7" },
1247 { PPC_INS_MFXER, "mfxer" },
1248 { PPC_INS_MFRTCU, "mfrtcu" },
1249 { PPC_INS_MFRTCL, "mfrtcl" },
1250 { PPC_INS_MFDSCR, "mfdscr" },
1251 { PPC_INS_MFDSISR, "mfdsisr" },
1252 { PPC_INS_MFDAR, "mfdar" },
1253 { PPC_INS_MFSRR2, "mfsrr2" },
1254 { PPC_INS_MFSRR3, "mfsrr3" },
1255 { PPC_INS_MFCFAR, "mfcfar" },
1256 { PPC_INS_MFAMR, "mfamr" },
1257 { PPC_INS_MFPID, "mfpid" },
1258 { PPC_INS_MFTBLO, "mftblo" },
1259 { PPC_INS_MFTBHI, "mftbhi" },
1260 { PPC_INS_MFDBATU, "mfdbatu" },
1261 { PPC_INS_MFDBATL, "mfdbatl" },
1262 { PPC_INS_MFIBATU, "mfibatu" },
1263 { PPC_INS_MFIBATL, "mfibatl" },
1264 { PPC_INS_MFDCCR, "mfdccr" },
1265 { PPC_INS_MFICCR, "mficcr" },
1266 { PPC_INS_MFDEAR, "mfdear" },
1267 { PPC_INS_MFESR, "mfesr" },
1268 { PPC_INS_MFSPEFSCR, "mfspefscr" },
1269 { PPC_INS_MFTCR, "mftcr" },
1270 { PPC_INS_MFASR, "mfasr" },
1271 { PPC_INS_MFPVR, "mfpvr" },
1272 { PPC_INS_MFTBU, "mftbu" },
1273 { PPC_INS_MTCR, "mtcr" },
1274 { PPC_INS_MTBR0, "mtbr0" },
1275 { PPC_INS_MTBR1, "mtbr1" },
1276 { PPC_INS_MTBR2, "mtbr2" },
1277 { PPC_INS_MTBR3, "mtbr3" },
1278 { PPC_INS_MTBR4, "mtbr4" },
1279 { PPC_INS_MTBR5, "mtbr5" },
1280 { PPC_INS_MTBR6, "mtbr6" },
1281 { PPC_INS_MTBR7, "mtbr7" },
1282 { PPC_INS_MTXER, "mtxer" },
1283 { PPC_INS_MTDSCR, "mtdscr" },
1284 { PPC_INS_MTDSISR, "mtdsisr" },
1285 { PPC_INS_MTDAR, "mtdar" },
1286 { PPC_INS_MTSRR2, "mtsrr2" },
1287 { PPC_INS_MTSRR3, "mtsrr3" },
1288 { PPC_INS_MTCFAR, "mtcfar" },
1289 { PPC_INS_MTAMR, "mtamr" },
1290 { PPC_INS_MTPID, "mtpid" },
1291 { PPC_INS_MTTBL, "mttbl" },
1292 { PPC_INS_MTTBU, "mttbu" },
1293 { PPC_INS_MTTBLO, "mttblo" },
1294 { PPC_INS_MTTBHI, "mttbhi" },
1295 { PPC_INS_MTDBATU, "mtdbatu" },
1296 { PPC_INS_MTDBATL, "mtdbatl" },
1297 { PPC_INS_MTIBATU, "mtibatu" },
1298 { PPC_INS_MTIBATL, "mtibatl" },
1299 { PPC_INS_MTDCCR, "mtdccr" },
1300 { PPC_INS_MTICCR, "mticcr" },
1301 { PPC_INS_MTDEAR, "mtdear" },
1302 { PPC_INS_MTESR, "mtesr" },
1303 { PPC_INS_MTSPEFSCR, "mtspefscr" },
1304 { PPC_INS_MTTCR, "mttcr" },
1305 { PPC_INS_NOT, "not" },
1306 { PPC_INS_MR, "mr" },
1307 { PPC_INS_ROTLD, "rotld" },
1308 { PPC_INS_ROTLDI, "rotldi" },
1309 { PPC_INS_CLRLDI, "clrldi" },
1310 { PPC_INS_ROTLWI, "rotlwi" },
1311 { PPC_INS_CLRLWI, "clrlwi" },
1312 { PPC_INS_ROTLW, "rotlw" },
1313 { PPC_INS_SUB, "sub" },
1314 { PPC_INS_SUBC, "subc" },
1315 { PPC_INS_LWSYNC, "lwsync" },
1316 { PPC_INS_PTESYNC, "ptesync" },
1317 { PPC_INS_TDLT, "tdlt" },
1318 { PPC_INS_TDEQ, "tdeq" },
1319 { PPC_INS_TDGT, "tdgt" },
1320 { PPC_INS_TDNE, "tdne" },
1321 { PPC_INS_TDLLT, "tdllt" },
1322 { PPC_INS_TDLGT, "tdlgt" },
1323 { PPC_INS_TDU, "tdu" },
1324 { PPC_INS_TDLTI, "tdlti" },
1325 { PPC_INS_TDEQI, "tdeqi" },
1326 { PPC_INS_TDGTI, "tdgti" },
1327 { PPC_INS_TDNEI, "tdnei" },
1328 { PPC_INS_TDLLTI, "tdllti" },
1329 { PPC_INS_TDLGTI, "tdlgti" },
1330 { PPC_INS_TDUI, "tdui" },
1331 { PPC_INS_TLBREHI, "tlbrehi" },
1332 { PPC_INS_TLBRELO, "tlbrelo" },
1333 { PPC_INS_TLBWEHI, "tlbwehi" },
1334 { PPC_INS_TLBWELO, "tlbwelo" },
1335 { PPC_INS_TWLT, "twlt" },
1336 { PPC_INS_TWEQ, "tweq" },
1337 { PPC_INS_TWGT, "twgt" },
1338 { PPC_INS_TWNE, "twne" },
1339 { PPC_INS_TWLLT, "twllt" },
1340 { PPC_INS_TWLGT, "twlgt" },
1341 { PPC_INS_TWU, "twu" },
1342 { PPC_INS_TWLTI, "twlti" },
1343 { PPC_INS_TWEQI, "tweqi" },
1344 { PPC_INS_TWGTI, "twgti" },
1345 { PPC_INS_TWNEI, "twnei" },
1346 { PPC_INS_TWLLTI, "twllti" },
1347 { PPC_INS_TWLGTI, "twlgti" },
1348 { PPC_INS_TWUI, "twui" },
1349 { PPC_INS_WAITRSV, "waitrsv" },
1350 { PPC_INS_WAITIMPL, "waitimpl" },
1351 { PPC_INS_XNOP, "xnop" },
1352 { PPC_INS_XVMOVDP, "xvmovdp" },
1353 { PPC_INS_XVMOVSP, "xvmovsp" },
1354 { PPC_INS_XXSPLTD, "xxspltd" },
1355 { PPC_INS_XXMRGHD, "xxmrghd" },
1356 { PPC_INS_XXMRGLD, "xxmrgld" },
1357 { PPC_INS_XXSWAPD, "xxswapd" },
1358 { PPC_INS_BT, "bt" },
1359 { PPC_INS_BF, "bf" },
1360 { PPC_INS_BDNZT, "bdnzt" },
1361 { PPC_INS_BDNZF, "bdnzf" },
1362 { PPC_INS_BDZF, "bdzf" },
1363 { PPC_INS_BDZT, "bdzt" },
1364 { PPC_INS_BFA, "bfa" },
1365 { PPC_INS_BDNZTA, "bdnzta" },
1366 { PPC_INS_BDNZFA, "bdnzfa" },
1367 { PPC_INS_BDZTA, "bdzta" },
1368 { PPC_INS_BDZFA, "bdzfa" },
1369 { PPC_INS_BTCTR, "btctr" },
1370 { PPC_INS_BFCTR, "bfctr" },
1371 { PPC_INS_BTCTRL, "btctrl" },
1372 { PPC_INS_BFCTRL, "bfctrl" },
1373 { PPC_INS_BTL, "btl" },
1374 { PPC_INS_BFL, "bfl" },
1375 { PPC_INS_BDNZTL, "bdnztl" },
1376 { PPC_INS_BDNZFL, "bdnzfl" },
1377 { PPC_INS_BDZTL, "bdztl" },
1378 { PPC_INS_BDZFL, "bdzfl" },
1379 { PPC_INS_BTLA, "btla" },
1380 { PPC_INS_BFLA, "bfla" },
1381 { PPC_INS_BDNZTLA, "bdnztla" },
1382 { PPC_INS_BDNZFLA, "bdnzfla" },
1383 { PPC_INS_BDZTLA, "bdztla" },
1384 { PPC_INS_BDZFLA, "bdzfla" },
1385 { PPC_INS_BTLR, "btlr" },
1386 { PPC_INS_BFLR, "bflr" },
1387 { PPC_INS_BDNZTLR, "bdnztlr" },
1388 { PPC_INS_BDZTLR, "bdztlr" },
1389 { PPC_INS_BDZFLR, "bdzflr" },
1390 { PPC_INS_BTLRL, "btlrl" },
1391 { PPC_INS_BFLRL, "bflrl" },
1392 { PPC_INS_BDNZTLRL, "bdnztlrl" },
1393 { PPC_INS_BDNZFLRL, "bdnzflrl" },
1394 { PPC_INS_BDZTLRL, "bdztlrl" },
1395 { PPC_INS_BDZFLRL, "bdzflrl" },
1396
1397 // QPX
1398 { PPC_INS_QVFAND, "qvfand" },
1399 { PPC_INS_QVFCLR, "qvfclr" },
1400 { PPC_INS_QVFANDC, "qvfandc" },
1401 { PPC_INS_QVFCTFB, "qvfctfb" },
1402 { PPC_INS_QVFXOR, "qvfxor" },
1403 { PPC_INS_QVFOR, "qvfor" },
1404 { PPC_INS_QVFNOR, "qvfnor" },
1405 { PPC_INS_QVFEQU, "qvfequ" },
1406 { PPC_INS_QVFNOT, "qvfnot" },
1407 { PPC_INS_QVFORC, "qvforc" },
1408 { PPC_INS_QVFNAND, "qvfnand" },
1409 { PPC_INS_QVFSET, "qvfset" },
1410 };
1411
1412 // special alias insn
1413 static const name_map alias_insn_names[] = {
1414 { 0, NULL }
1415 };
1416 #endif
1417
PPC_insn_name(csh handle,unsigned int id)1418 const char *PPC_insn_name(csh handle, unsigned int id)
1419 {
1420 #ifndef CAPSTONE_DIET
1421 unsigned int i;
1422
1423 if (id >= PPC_INS_ENDING)
1424 return NULL;
1425
1426 // handle special alias first
1427 for (i = 0; i < ARR_SIZE(alias_insn_names); i++) {
1428 if (alias_insn_names[i].id == id)
1429 return alias_insn_names[i].name;
1430 }
1431
1432 return insn_name_maps[id].name;
1433 #else
1434 return NULL;
1435 #endif
1436 }
1437
1438 #ifndef CAPSTONE_DIET
1439 static const name_map group_name_maps[] = {
1440 // generic groups
1441 { PPC_GRP_INVALID, NULL },
1442 { PPC_GRP_JUMP, "jump" },
1443
1444 // architecture-specific groups
1445 { PPC_GRP_ALTIVEC, "altivec" },
1446 { PPC_GRP_MODE32, "mode32" },
1447 { PPC_GRP_MODE64, "mode64" },
1448 { PPC_GRP_BOOKE, "booke" },
1449 { PPC_GRP_NOTBOOKE, "notbooke" },
1450 { PPC_GRP_SPE, "spe" },
1451 { PPC_GRP_VSX, "vsx" },
1452 { PPC_GRP_E500, "e500" },
1453 { PPC_GRP_PPC4XX, "ppc4xx" },
1454 { PPC_GRP_PPC6XX, "ppc6xx" },
1455 { PPC_GRP_ICBT, "icbt" },
1456 { PPC_GRP_P8ALTIVEC, "p8altivec" },
1457 { PPC_GRP_P8VECTOR, "p8vector" },
1458 { PPC_GRP_QPX, "qpx" },
1459 };
1460 #endif
1461
PPC_group_name(csh handle,unsigned int id)1462 const char *PPC_group_name(csh handle, unsigned int id)
1463 {
1464 #ifndef CAPSTONE_DIET
1465 return id2name(group_name_maps, ARR_SIZE(group_name_maps), id);
1466 #else
1467 return NULL;
1468 #endif
1469 }
1470
1471 // map internal raw register to 'public' register
PPC_map_register(unsigned int r)1472 ppc_reg PPC_map_register(unsigned int r)
1473 {
1474 static unsigned int map[] = { 0,
1475 0, PPC_REG_CARRY, PPC_REG_CTR, 0, PPC_REG_LR,
1476 0, PPC_REG_VRSAVE, PPC_REG_R0, 0, PPC_REG_CR0,
1477 PPC_REG_CR1, PPC_REG_CR2, PPC_REG_CR3, PPC_REG_CR4, PPC_REG_CR5,
1478 PPC_REG_CR6, PPC_REG_CR7, PPC_REG_CTR, PPC_REG_F0, PPC_REG_F1,
1479 PPC_REG_F2, PPC_REG_F3, PPC_REG_F4, PPC_REG_F5, PPC_REG_F6,
1480 PPC_REG_F7, PPC_REG_F8, PPC_REG_F9, PPC_REG_F10, PPC_REG_F11,
1481 PPC_REG_F12, PPC_REG_F13, PPC_REG_F14, PPC_REG_F15, PPC_REG_F16,
1482 PPC_REG_F17, PPC_REG_F18, PPC_REG_F19, PPC_REG_F20, PPC_REG_F21,
1483 PPC_REG_F22, PPC_REG_F23, PPC_REG_F24, PPC_REG_F25, PPC_REG_F26,
1484 PPC_REG_F27, PPC_REG_F28, PPC_REG_F29, PPC_REG_F30, PPC_REG_F31,
1485 0, PPC_REG_LR, PPC_REG_Q0, PPC_REG_Q1, PPC_REG_Q2,
1486 PPC_REG_Q3, PPC_REG_Q4, PPC_REG_Q5, PPC_REG_Q6, PPC_REG_Q7,
1487 PPC_REG_Q8, PPC_REG_Q9, PPC_REG_Q10, PPC_REG_Q11, PPC_REG_Q12,
1488 PPC_REG_Q13, PPC_REG_Q14, PPC_REG_Q15, PPC_REG_Q16, PPC_REG_Q17,
1489 PPC_REG_Q18, PPC_REG_Q19, PPC_REG_Q20, PPC_REG_Q21, PPC_REG_Q22,
1490 PPC_REG_Q23, PPC_REG_Q24, PPC_REG_Q25, PPC_REG_Q26, PPC_REG_Q27,
1491 PPC_REG_Q28, PPC_REG_Q29, PPC_REG_Q30, PPC_REG_Q31, PPC_REG_R0,
1492 PPC_REG_R1, PPC_REG_R2, PPC_REG_R3, PPC_REG_R4, PPC_REG_R5,
1493 PPC_REG_R6, PPC_REG_R7, PPC_REG_R8, PPC_REG_R9, PPC_REG_R10,
1494 PPC_REG_R11, PPC_REG_R12, PPC_REG_R13, PPC_REG_R14, PPC_REG_R15,
1495 PPC_REG_R16, PPC_REG_R17, PPC_REG_R18, PPC_REG_R19, PPC_REG_R20,
1496 PPC_REG_R21, PPC_REG_R22, PPC_REG_R23, PPC_REG_R24, PPC_REG_R25,
1497 PPC_REG_R26, PPC_REG_R27, PPC_REG_R28, PPC_REG_R29, PPC_REG_R30,
1498 PPC_REG_R31, PPC_REG_V0, PPC_REG_V1, PPC_REG_V2, PPC_REG_V3,
1499 PPC_REG_V4, PPC_REG_V5, PPC_REG_V6, PPC_REG_V7, PPC_REG_V8,
1500 PPC_REG_V9, PPC_REG_V10, PPC_REG_V11, PPC_REG_V12, PPC_REG_V13,
1501 PPC_REG_V14, PPC_REG_V15, PPC_REG_V16, PPC_REG_V17, PPC_REG_V18,
1502 PPC_REG_V19, PPC_REG_V20, PPC_REG_V21, PPC_REG_V22, PPC_REG_V23,
1503 PPC_REG_V24, PPC_REG_V25, PPC_REG_V26, PPC_REG_V27, PPC_REG_V28,
1504 PPC_REG_V29, PPC_REG_V30, PPC_REG_V31, PPC_REG_VS32, PPC_REG_VS33,
1505 PPC_REG_VS34, PPC_REG_VS35, PPC_REG_VS36, PPC_REG_VS37, PPC_REG_VS38,
1506 PPC_REG_VS39, PPC_REG_VS40, PPC_REG_VS41, PPC_REG_VS42, PPC_REG_VS43,
1507 PPC_REG_VS44, PPC_REG_VS45, PPC_REG_VS46, PPC_REG_VS47, PPC_REG_VS48,
1508 PPC_REG_VS49, PPC_REG_VS50, PPC_REG_VS51, PPC_REG_VS52, PPC_REG_VS53,
1509 PPC_REG_VS54, PPC_REG_VS55, PPC_REG_VS56, PPC_REG_VS57, PPC_REG_VS58,
1510 PPC_REG_VS59, PPC_REG_VS60, PPC_REG_VS61, PPC_REG_VS62, PPC_REG_VS63,
1511 PPC_REG_VS32, PPC_REG_VS33, PPC_REG_VS34, PPC_REG_VS35, PPC_REG_VS36,
1512 PPC_REG_VS37, PPC_REG_VS38, PPC_REG_VS39, PPC_REG_VS40, PPC_REG_VS41,
1513 PPC_REG_VS42, PPC_REG_VS43, PPC_REG_VS44, PPC_REG_VS45, PPC_REG_VS46,
1514 PPC_REG_VS47, PPC_REG_VS48, PPC_REG_VS49, PPC_REG_VS50, PPC_REG_VS51,
1515 PPC_REG_VS52, PPC_REG_VS53, PPC_REG_VS54, PPC_REG_VS55, PPC_REG_VS56,
1516 PPC_REG_VS57, PPC_REG_VS58, PPC_REG_VS59, PPC_REG_VS60, PPC_REG_VS61,
1517 PPC_REG_VS62, PPC_REG_VS63, PPC_REG_VS0, PPC_REG_VS1, PPC_REG_VS2,
1518 PPC_REG_VS3, PPC_REG_VS4, PPC_REG_VS5, PPC_REG_VS6, PPC_REG_VS7,
1519 PPC_REG_VS8, PPC_REG_VS9, PPC_REG_VS10, PPC_REG_VS11, PPC_REG_VS12,
1520 PPC_REG_VS13, PPC_REG_VS14, PPC_REG_VS15, PPC_REG_VS16, PPC_REG_VS17,
1521 PPC_REG_VS18, PPC_REG_VS19, PPC_REG_VS20, PPC_REG_VS21, PPC_REG_VS22,
1522 PPC_REG_VS23, PPC_REG_VS24, PPC_REG_VS25, PPC_REG_VS26, PPC_REG_VS27,
1523 PPC_REG_VS28, PPC_REG_VS29, PPC_REG_VS30, PPC_REG_VS31, PPC_REG_R0,
1524 PPC_REG_R1, PPC_REG_R2, PPC_REG_R3, PPC_REG_R4, PPC_REG_R5,
1525 PPC_REG_R6, PPC_REG_R7, PPC_REG_R8, PPC_REG_R9, PPC_REG_R10,
1526 PPC_REG_R11, PPC_REG_R12, PPC_REG_R13, PPC_REG_R14, PPC_REG_R15,
1527 PPC_REG_R16, PPC_REG_R17, PPC_REG_R18, PPC_REG_R19, PPC_REG_R20,
1528 PPC_REG_R21, PPC_REG_R22, PPC_REG_R23, PPC_REG_R24, PPC_REG_R25,
1529 PPC_REG_R26, PPC_REG_R27, PPC_REG_R28, PPC_REG_R29, PPC_REG_R30,
1530 PPC_REG_R31, PPC_REG_R0, PPC_REG_R2, PPC_REG_R6, PPC_REG_R10,
1531 PPC_REG_R14, PPC_REG_R18, PPC_REG_R22, PPC_REG_R26, PPC_REG_R30,
1532 PPC_REG_R1, PPC_REG_R5, PPC_REG_R9, PPC_REG_R13, PPC_REG_R17,
1533 PPC_REG_R21, PPC_REG_R25, PPC_REG_R29, PPC_REG_R0, PPC_REG_R4,
1534 PPC_REG_R8, PPC_REG_R12, PPC_REG_R16, PPC_REG_R20, PPC_REG_R24,
1535 PPC_REG_R28, PPC_REG_R3, PPC_REG_R7, PPC_REG_R11, PPC_REG_R15,
1536 PPC_REG_R19, PPC_REG_R23, PPC_REG_R27, PPC_REG_R31 };
1537
1538 if (r < ARR_SIZE(map))
1539 return map[r];
1540
1541 // cannot find this register
1542 return 0;
1543 }
1544
1545 static const struct ppc_alias alias_insn_name_maps[] = {
1546 //{ PPC_INS_BTA, "bta" },
1547 { PPC_INS_B, PPC_BC_LT, "blt" },
1548 { PPC_INS_B, PPC_BC_LE, "ble" },
1549 { PPC_INS_B, PPC_BC_EQ, "beq" },
1550 { PPC_INS_B, PPC_BC_GE, "bge" },
1551 { PPC_INS_B, PPC_BC_GT, "bgt" },
1552 { PPC_INS_B, PPC_BC_NE, "bne" },
1553 { PPC_INS_B, PPC_BC_UN, "bun" },
1554 { PPC_INS_B, PPC_BC_NU, "bnu" },
1555 { PPC_INS_B, PPC_BC_SO, "bso" },
1556 { PPC_INS_B, PPC_BC_NS, "bns" },
1557
1558 { PPC_INS_BA, PPC_BC_LT, "blta" },
1559 { PPC_INS_BA, PPC_BC_LE, "blea" },
1560 { PPC_INS_BA, PPC_BC_EQ, "beqa" },
1561 { PPC_INS_BA, PPC_BC_GE, "bgea" },
1562 { PPC_INS_BA, PPC_BC_GT, "bgta" },
1563 { PPC_INS_BA, PPC_BC_NE, "bnea" },
1564 { PPC_INS_BA, PPC_BC_UN, "buna" },
1565 { PPC_INS_BA, PPC_BC_NU, "bnua" },
1566 { PPC_INS_BA, PPC_BC_SO, "bsoa" },
1567 { PPC_INS_BA, PPC_BC_NS, "bnsa" },
1568
1569 { PPC_INS_BCTR, PPC_BC_LT, "bltctr" },
1570 { PPC_INS_BCTR, PPC_BC_LE, "blectr" },
1571 { PPC_INS_BCTR, PPC_BC_EQ, "beqctr" },
1572 { PPC_INS_BCTR, PPC_BC_GE, "bgectr" },
1573 { PPC_INS_BCTR, PPC_BC_GT, "bgtctr" },
1574 { PPC_INS_BCTR, PPC_BC_NE, "bnectr" },
1575 { PPC_INS_BCTR, PPC_BC_UN, "bunctr" },
1576 { PPC_INS_BCTR, PPC_BC_NU, "bnuctr" },
1577 { PPC_INS_BCTR, PPC_BC_SO, "bsoctr" },
1578 { PPC_INS_BCTR, PPC_BC_NS, "bnsctr" },
1579
1580 { PPC_INS_BCTRL, PPC_BC_LT, "bltctrl" },
1581 { PPC_INS_BCTRL, PPC_BC_LE, "blectrl" },
1582 { PPC_INS_BCTRL, PPC_BC_EQ, "beqctrl" },
1583 { PPC_INS_BCTRL, PPC_BC_GE, "bgectrl" },
1584 { PPC_INS_BCTRL, PPC_BC_GT, "bgtctrl" },
1585 { PPC_INS_BCTRL, PPC_BC_NE, "bnectrl" },
1586 { PPC_INS_BCTRL, PPC_BC_UN, "bunctrl" },
1587 { PPC_INS_BCTRL, PPC_BC_NU, "bnuctrl" },
1588 { PPC_INS_BCTRL, PPC_BC_SO, "bsoctrl" },
1589 { PPC_INS_BCTRL, PPC_BC_NS, "bnsctrl" },
1590
1591 { PPC_INS_BL, PPC_BC_LT, "bltl" },
1592 { PPC_INS_BL, PPC_BC_LE, "blel" },
1593 { PPC_INS_BL, PPC_BC_EQ, "beql" },
1594 { PPC_INS_BL, PPC_BC_GE, "bgel" },
1595 { PPC_INS_BL, PPC_BC_GT, "bgtl" },
1596 { PPC_INS_BL, PPC_BC_NE, "bnel" },
1597 { PPC_INS_BL, PPC_BC_UN, "bunl" },
1598 { PPC_INS_BL, PPC_BC_NU, "bnul" },
1599 { PPC_INS_BL, PPC_BC_SO, "bsol" },
1600 { PPC_INS_BL, PPC_BC_NS, "bnsl" },
1601
1602 { PPC_INS_BLA, PPC_BC_LT, "bltla" },
1603 { PPC_INS_BLA, PPC_BC_LE, "blela" },
1604 { PPC_INS_BLA, PPC_BC_EQ, "beqla" },
1605 { PPC_INS_BLA, PPC_BC_GE, "bgela" },
1606 { PPC_INS_BLA, PPC_BC_GT, "bgtla" },
1607 { PPC_INS_BLA, PPC_BC_NE, "bnela" },
1608 { PPC_INS_BLA, PPC_BC_UN, "bunla" },
1609 { PPC_INS_BLA, PPC_BC_NU, "bnula" },
1610 { PPC_INS_BLA, PPC_BC_SO, "bsola" },
1611 { PPC_INS_BLA, PPC_BC_NS, "bnsla" },
1612
1613 { PPC_INS_BLR, PPC_BC_LT, "bltlr" },
1614 { PPC_INS_BLR, PPC_BC_LE, "blelr" },
1615 { PPC_INS_BLR, PPC_BC_EQ, "beqlr" },
1616 { PPC_INS_BLR, PPC_BC_GE, "bgelr" },
1617 { PPC_INS_BLR, PPC_BC_GT, "bgtlr" },
1618 { PPC_INS_BLR, PPC_BC_NE, "bnelr" },
1619 { PPC_INS_BLR, PPC_BC_UN, "bunlr" },
1620 { PPC_INS_BLR, PPC_BC_NU, "bnulr" },
1621 { PPC_INS_BLR, PPC_BC_SO, "bsolr" },
1622 { PPC_INS_BLR, PPC_BC_NS, "bnslr" },
1623
1624 { PPC_INS_BLRL, PPC_BC_LT, "bltlrl" },
1625 { PPC_INS_BLRL, PPC_BC_LE, "blelrl" },
1626 { PPC_INS_BLRL, PPC_BC_EQ, "beqlrl" },
1627 { PPC_INS_BLRL, PPC_BC_GE, "bgelrl" },
1628 { PPC_INS_BLRL, PPC_BC_GT, "bgtlrl" },
1629 { PPC_INS_BLRL, PPC_BC_NE, "bnelrl" },
1630 { PPC_INS_BLRL, PPC_BC_UN, "bunlrl" },
1631 { PPC_INS_BLRL, PPC_BC_NU, "bnulrl" },
1632 { PPC_INS_BLRL, PPC_BC_SO, "bsolrl" },
1633 { PPC_INS_BLRL, PPC_BC_NS, "bnslrl" },
1634 };
1635
1636 // given alias mnemonic, return instruction ID & CC
PPC_alias_insn(const char * name,struct ppc_alias * alias)1637 bool PPC_alias_insn(const char *name, struct ppc_alias *alias)
1638 {
1639 size_t i;
1640 #ifndef CAPSTONE_DIET
1641 int x;
1642 #endif
1643
1644 for(i = 0; i < ARR_SIZE(alias_insn_name_maps); i++) {
1645 if (!strcmp(name, alias_insn_name_maps[i].mnem)) {
1646 alias->id = alias_insn_name_maps[i].id;
1647 alias->cc = alias_insn_name_maps[i].cc;
1648 return true;
1649 }
1650 }
1651
1652 #ifndef CAPSTONE_DIET
1653 // not really an alias insn
1654 x = name2id(&insn_name_maps[1], ARR_SIZE(insn_name_maps) - 1, name);
1655 if (x != -1) {
1656 alias->id = insn_name_maps[x].id;
1657 alias->cc = PPC_BC_INVALID;
1658 return true;
1659 }
1660 #endif
1661
1662 // not found
1663 return false;
1664 }
1665
1666 // list all relative branch instructions
1667 static const unsigned int insn_abs[] = {
1668 PPC_BA,
1669 PPC_BCCA,
1670 PPC_BCCLA,
1671 PPC_BDNZA,
1672 PPC_BDNZAm,
1673 PPC_BDNZAp,
1674 PPC_BDNZLA,
1675 PPC_BDNZLAm,
1676 PPC_BDNZLAp,
1677 PPC_BDZA,
1678 PPC_BDZAm,
1679 PPC_BDZAp,
1680 PPC_BDZLAm,
1681 PPC_BDZLAp,
1682 PPC_BLA,
1683 PPC_gBCA,
1684 PPC_gBCLA,
1685 0
1686 };
1687
1688 // check if this insn is relative branch
PPC_abs_branch(cs_struct * h,unsigned int id)1689 bool PPC_abs_branch(cs_struct *h, unsigned int id)
1690 {
1691 int i;
1692
1693 for (i = 0; insn_abs[i]; i++) {
1694 if (id == insn_abs[i]) {
1695 return true;
1696 }
1697 }
1698
1699 // not found
1700 return false;
1701 }
1702
1703 #endif
1704