Coverage Report

Created: 2026-08-31 06:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/capstonenext/arch/PowerPC/PPCDisassembler.c
Line
Count
Source
1
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
2
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2022, */
3
/*    Rot127 <unisono@quyllur.org> 2022-2023 */
4
/* Automatically translated source file from LLVM. */
5
6
/* LLVM-commit: <commit> */
7
/* LLVM-tag: <tag> */
8
9
/* Only small edits allowed. */
10
/* For multiple similar edits, please create a Patch for the translator. */
11
12
/* Capstone's C++ file translator: */
13
/* https://github.com/capstone-engine/capstone/tree/next/suite/auto-sync */
14
15
//===------ PPCDisassembler.cpp - Disassembler for PowerPC ------*- C++ -*-===//
16
//
17
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
18
// See https://llvm.org/LICENSE.txt for license information.
19
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
20
//
21
//===----------------------------------------------------------------------===//
22
23
#include <capstone/platform.h>
24
#include <stdio.h>
25
#include <stdlib.h>
26
#include <string.h>
27
28
#include "../../LEB128.h"
29
#include "../../MCDisassembler.h"
30
#include "../../MCFixedLenDisassembler.h"
31
#include "../../MCInst.h"
32
#include "../../MCInstPrinter.h"
33
#include "../../MCInstrDesc.h"
34
#include "../../MCRegisterInfo.h"
35
#include "../../SStream.h"
36
#include "../../utils.h"
37
#include "PPCLinkage.h"
38
#include "PPCMapping.h"
39
#include "PPCMCTargetDesc.h"
40
#include "PPCPredicates.h"
41
42
#define CONCAT(a, b) CONCAT_(a, b)
43
#define CONCAT_(a, b) a##_##b
44
45
DEFINE_PPC_REGCLASSES
46
47
#define DEBUG_TYPE "ppc-disassembler"
48
49
DecodeStatus getInstruction(csh ud, const uint8_t *Bytes, size_t BytesLen,
50
          MCInst *MI, uint16_t *Size, uint64_t Address,
51
          void *Info);
52
// end anonymous namespace
53
54
static DecodeStatus decodeCondBrTarget(MCInst *Inst, unsigned Imm,
55
               uint64_t Address, const void *Decoder)
56
11.3k
{
57
11.3k
  MCOperand_CreateImm0(Inst, (SignExtend32((Imm), 14)));
58
11.3k
  return MCDisassembler_Success;
59
11.3k
}
60
61
static DecodeStatus decodeDirectBrTarget(MCInst *Inst, unsigned Imm,
62
           uint64_t Address, const void *Decoder)
63
1.07k
{
64
1.07k
  int32_t Offset = SignExtend32((Imm), 24);
65
1.07k
  MCOperand_CreateImm0(Inst, (Offset));
66
1.07k
  return MCDisassembler_Success;
67
1.07k
}
68
69
// FIXME: These can be generated by TableGen from the existing register
70
// encoding values!
71
72
static DecodeStatus decodeRegisterClass(MCInst *Inst, uint64_t RegNo,
73
          const MCPhysReg *Regs)
74
198k
{
75
198k
  MCOperand_CreateReg0(Inst, (Regs[RegNo]));
76
198k
  return MCDisassembler_Success;
77
198k
}
78
79
static DecodeStatus DecodeCRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
80
              uint64_t Address,
81
              const void *Decoder)
82
4.81k
{
83
4.81k
  return decodeRegisterClass(Inst, RegNo, CRRegs);
84
4.81k
}
85
86
static DecodeStatus DecodeCRBITRCRegisterClass(MCInst *Inst, uint64_t RegNo,
87
                 uint64_t Address,
88
                 const void *Decoder)
89
12.1k
{
90
12.1k
  return decodeRegisterClass(Inst, RegNo, CRBITRegs);
91
12.1k
}
92
93
static DecodeStatus DecodeF4RCRegisterClass(MCInst *Inst, uint64_t RegNo,
94
              uint64_t Address,
95
              const void *Decoder)
96
6.16k
{
97
6.16k
  return decodeRegisterClass(Inst, RegNo, FRegs);
98
6.16k
}
99
100
static DecodeStatus DecodeF8RCRegisterClass(MCInst *Inst, uint64_t RegNo,
101
              uint64_t Address,
102
              const void *Decoder)
103
13.9k
{
104
13.9k
  return decodeRegisterClass(Inst, RegNo, FRegs);
105
13.9k
}
106
107
static DecodeStatus DecodeFpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
108
              uint64_t Address,
109
              const void *Decoder)
110
3.05k
{
111
3.05k
  if (RegNo > 30 || (RegNo & 1))
112
80
    return MCDisassembler_Fail;
113
2.97k
  return decodeRegisterClass(Inst, RegNo >> 1, FpRegs);
114
3.05k
}
115
116
static DecodeStatus DecodeVFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
117
              uint64_t Address,
118
              const void *Decoder)
119
526
{
120
526
  return decodeRegisterClass(Inst, RegNo, VFRegs);
121
526
}
122
123
static DecodeStatus DecodeVRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
124
              uint64_t Address,
125
              const void *Decoder)
126
18.2k
{
127
18.2k
  return decodeRegisterClass(Inst, RegNo, VRegs);
128
18.2k
}
129
130
static DecodeStatus DecodeVSRCRegisterClass(MCInst *Inst, uint64_t RegNo,
131
              uint64_t Address,
132
              const void *Decoder)
133
12.2k
{
134
12.2k
  return decodeRegisterClass(Inst, RegNo, VSRegs);
135
12.2k
}
136
137
static DecodeStatus DecodeVSFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
138
               uint64_t Address,
139
               const void *Decoder)
140
4.41k
{
141
4.41k
  return decodeRegisterClass(Inst, RegNo, VSFRegs);
142
4.41k
}
143
144
static DecodeStatus DecodeVSSRCRegisterClass(MCInst *Inst, uint64_t RegNo,
145
               uint64_t Address,
146
               const void *Decoder)
147
2.95k
{
148
2.95k
  return decodeRegisterClass(Inst, RegNo, VSSRegs);
149
2.95k
}
150
151
static DecodeStatus DecodeGPRCRegisterClass(MCInst *Inst, uint64_t RegNo,
152
              uint64_t Address,
153
              const void *Decoder)
154
58.5k
{
155
58.5k
  return decodeRegisterClass(Inst, RegNo, RRegs);
156
58.5k
}
157
158
static DecodeStatus DecodeGPRC_NOR0RegisterClass(MCInst *Inst, uint64_t RegNo,
159
             uint64_t Address,
160
             const void *Decoder)
161
37.4k
{
162
37.4k
  return decodeRegisterClass(Inst, RegNo, RRegsNoR0);
163
37.4k
}
164
165
static DecodeStatus DecodeG8RCRegisterClass(MCInst *Inst, uint64_t RegNo,
166
              uint64_t Address,
167
              const void *Decoder)
168
13.4k
{
169
13.4k
  return decodeRegisterClass(Inst, RegNo, XRegs);
170
13.4k
}
171
172
static DecodeStatus DecodeG8pRCRegisterClass(MCInst *Inst, uint64_t RegNo,
173
               uint64_t Address,
174
               const void *Decoder)
175
788
{
176
788
  return decodeRegisterClass(Inst, RegNo, XRegs);
177
788
}
178
179
static DecodeStatus DecodeG8RC_NOX0RegisterClass(MCInst *Inst, uint64_t RegNo,
180
             uint64_t Address,
181
             const void *Decoder)
182
19
{
183
19
  return decodeRegisterClass(Inst, RegNo, XRegsNoX0);
184
19
}
185
186
4.93k
#define DecodePointerLikeRegClass0 DecodeGPRCRegisterClass
187
34.7k
#define DecodePointerLikeRegClass1 DecodeGPRC_NOR0RegisterClass
188
189
static DecodeStatus DecodeSPERCRegisterClass(MCInst *Inst, uint64_t RegNo,
190
               uint64_t Address,
191
               const void *Decoder)
192
0
{
193
0
  return decodeRegisterClass(Inst, RegNo, SPERegs);
194
0
}
195
196
static DecodeStatus DecodeACCRCRegisterClass(MCInst *Inst, uint64_t RegNo,
197
               uint64_t Address,
198
               const void *Decoder)
199
0
{
200
0
  return decodeRegisterClass(Inst, RegNo, ACCRegs);
201
0
}
202
203
static DecodeStatus DecodeWACCRCRegisterClass(MCInst *Inst, uint64_t RegNo,
204
                uint64_t Address,
205
                const void *Decoder)
206
259
{
207
259
  return decodeRegisterClass(Inst, RegNo, WACCRegs);
208
259
}
209
210
static DecodeStatus DecodeWACC_HIRCRegisterClass(MCInst *Inst, uint64_t RegNo,
211
             uint64_t Address,
212
             const void *Decoder)
213
204
{
214
204
  return decodeRegisterClass(Inst, RegNo, WACC_HIRegs);
215
204
}
216
217
// TODO: Make this function static when the register class is used by a new
218
//       instruction.
219
DecodeStatus DecodeDMRROWRCRegisterClass(MCInst *Inst, uint64_t RegNo,
220
           uint64_t Address, const void *Decoder)
221
0
{
222
0
  return decodeRegisterClass(Inst, RegNo, DMRROWRegs);
223
0
}
224
225
static DecodeStatus DecodeDMRROWpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
226
             uint64_t Address,
227
             const void *Decoder)
228
143
{
229
143
  return decodeRegisterClass(Inst, RegNo, DMRROWpRegs);
230
143
}
231
232
static DecodeStatus DecodeDMRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
233
               uint64_t Address,
234
               const void *Decoder)
235
377
{
236
377
  return decodeRegisterClass(Inst, RegNo, DMRRegs);
237
377
}
238
239
// TODO: Make this function static when the register class is used by a new
240
//       instruction.
241
DecodeStatus DecodeDMRpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
242
               uint64_t Address, const void *Decoder)
243
0
{
244
0
  return decodeRegisterClass(Inst, RegNo, DMRpRegs);
245
0
}
246
247
static DecodeStatus DecodeVSRpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
248
                uint64_t Address,
249
                const void *Decoder)
250
1.61k
{
251
1.61k
  return decodeRegisterClass(Inst, RegNo, VSRpRegs);
252
1.61k
}
253
254
1.44k
#define DecodeQSRCRegisterClass DecodeQFRCRegisterClass
255
878
#define DecodeQBRCRegisterClass DecodeQFRCRegisterClass
256
257
static DecodeStatus DecodeQFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
258
              uint64_t Address,
259
              const void *Decoder)
260
7.43k
{
261
7.43k
  return decodeRegisterClass(Inst, RegNo, QFRegs);
262
7.43k
}
263
264
#define DEFINE_decodeUImmOperand(N) \
265
  static DecodeStatus CONCAT(decodeUImmOperand, \
266
           N)(MCInst * Inst, uint64_t Imm, \
267
              int64_t Address, const void *Decoder) \
268
50.6k
  { \
269
50.6k
    if (!isUIntN(N, Imm)) \
270
50.6k
      return MCDisassembler_Fail; \
271
50.6k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
50.6k
    return MCDisassembler_Success; \
273
50.6k
  }
PPCDisassembler.c:decodeUImmOperand_5
Line
Count
Source
268
24.5k
  { \
269
24.5k
    if (!isUIntN(N, Imm)) \
270
24.5k
      return MCDisassembler_Fail; \
271
24.5k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
24.5k
    return MCDisassembler_Success; \
273
24.5k
  }
PPCDisassembler.c:decodeUImmOperand_1
Line
Count
Source
268
3.66k
  { \
269
3.66k
    if (!isUIntN(N, Imm)) \
270
3.66k
      return MCDisassembler_Fail; \
271
3.66k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
3.66k
    return MCDisassembler_Success; \
273
3.66k
  }
PPCDisassembler.c:decodeUImmOperand_4
Line
Count
Source
268
1.58k
  { \
269
1.58k
    if (!isUIntN(N, Imm)) \
270
1.58k
      return MCDisassembler_Fail; \
271
1.58k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
1.57k
    return MCDisassembler_Success; \
273
1.58k
  }
PPCDisassembler.c:decodeUImmOperand_3
Line
Count
Source
268
4.42k
  { \
269
4.42k
    if (!isUIntN(N, Imm)) \
270
4.42k
      return MCDisassembler_Fail; \
271
4.42k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
4.41k
    return MCDisassembler_Success; \
273
4.42k
  }
PPCDisassembler.c:decodeUImmOperand_16
Line
Count
Source
268
9.27k
  { \
269
9.27k
    if (!isUIntN(N, Imm)) \
270
9.27k
      return MCDisassembler_Fail; \
271
9.27k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
9.27k
    return MCDisassembler_Success; \
273
9.27k
  }
PPCDisassembler.c:decodeUImmOperand_6
Line
Count
Source
268
3.83k
  { \
269
3.83k
    if (!isUIntN(N, Imm)) \
270
3.83k
      return MCDisassembler_Fail; \
271
3.83k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
3.83k
    return MCDisassembler_Success; \
273
3.83k
  }
PPCDisassembler.c:decodeUImmOperand_2
Line
Count
Source
268
2.40k
  { \
269
2.40k
    if (!isUIntN(N, Imm)) \
270
2.40k
      return MCDisassembler_Fail; \
271
2.40k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
2.40k
    return MCDisassembler_Success; \
273
2.40k
  }
PPCDisassembler.c:decodeUImmOperand_10
Line
Count
Source
268
208
  { \
269
208
    if (!isUIntN(N, Imm)) \
270
208
      return MCDisassembler_Fail; \
271
208
    MCOperand_CreateImm0(Inst, (Imm)); \
272
208
    return MCDisassembler_Success; \
273
208
  }
PPCDisassembler.c:decodeUImmOperand_8
Line
Count
Source
268
120
  { \
269
120
    if (!isUIntN(N, Imm)) \
270
120
      return MCDisassembler_Fail; \
271
120
    MCOperand_CreateImm0(Inst, (Imm)); \
272
120
    return MCDisassembler_Success; \
273
120
  }
PPCDisassembler.c:decodeUImmOperand_7
Line
Count
Source
268
187
  { \
269
187
    if (!isUIntN(N, Imm)) \
270
187
      return MCDisassembler_Fail; \
271
187
    MCOperand_CreateImm0(Inst, (Imm)); \
272
187
    return MCDisassembler_Success; \
273
187
  }
PPCDisassembler.c:decodeUImmOperand_12
Line
Count
Source
268
416
  { \
269
416
    if (!isUIntN(N, Imm)) \
270
416
      return MCDisassembler_Fail; \
271
416
    MCOperand_CreateImm0(Inst, (Imm)); \
272
416
    return MCDisassembler_Success; \
273
416
  }
274
DEFINE_decodeUImmOperand(1);
275
DEFINE_decodeUImmOperand(2);
276
DEFINE_decodeUImmOperand(3);
277
DEFINE_decodeUImmOperand(4);
278
DEFINE_decodeUImmOperand(5);
279
DEFINE_decodeUImmOperand(6);
280
DEFINE_decodeUImmOperand(7);
281
DEFINE_decodeUImmOperand(8);
282
DEFINE_decodeUImmOperand(10);
283
DEFINE_decodeUImmOperand(12);
284
DEFINE_decodeUImmOperand(16);
285
286
#define DEFINE_decodeSImmOperand(N) \
287
  static DecodeStatus CONCAT(decodeSImmOperand, \
288
           N)(MCInst * Inst, uint64_t Imm, \
289
              int64_t Address, const void *Decoder) \
290
10.6k
  { \
291
10.6k
    if (!isUIntN(N, Imm)) \
292
10.6k
      return MCDisassembler_Fail; \
293
10.6k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
10.6k
    return MCDisassembler_Success; \
295
10.6k
  }
PPCDisassembler.c:decodeSImmOperand_16
Line
Count
Source
290
9.34k
  { \
291
9.34k
    if (!isUIntN(N, Imm)) \
292
9.34k
      return MCDisassembler_Fail; \
293
9.34k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
9.34k
    return MCDisassembler_Success; \
295
9.34k
  }
PPCDisassembler.c:decodeSImmOperand_5
Line
Count
Source
290
240
  { \
291
240
    if (!isUIntN(N, Imm)) \
292
240
      return MCDisassembler_Fail; \
293
240
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
240
    return MCDisassembler_Success; \
295
240
  }
PPCDisassembler.c:decodeSImmOperand_34
Line
Count
Source
290
1.04k
  { \
291
1.04k
    if (!isUIntN(N, Imm)) \
292
1.04k
      return MCDisassembler_Fail; \
293
1.04k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
1.04k
    return MCDisassembler_Success; \
295
1.04k
  }
296
DEFINE_decodeSImmOperand(16);
297
DEFINE_decodeSImmOperand(5);
298
DEFINE_decodeSImmOperand(34);
299
300
static DecodeStatus decodeImmZeroOperand(MCInst *Inst, uint64_t Imm,
301
           int64_t Address, const void *Decoder)
302
285
{
303
285
  if (Imm != 0)
304
9
    return MCDisassembler_Fail;
305
276
  MCOperand_CreateImm0(Inst, (Imm));
306
276
  return MCDisassembler_Success;
307
285
}
308
309
static DecodeStatus decodeVSRpEvenOperands(MCInst *Inst, uint64_t RegNo,
310
             uint64_t Address,
311
             const void *Decoder)
312
0
{
313
0
  if (RegNo & 1)
314
0
    return MCDisassembler_Fail;
315
0
  MCOperand_CreateReg0(Inst, (VSRpRegs[RegNo >> 1]));
316
0
  return MCDisassembler_Success;
317
0
}
318
319
static DecodeStatus decodeDispSPE8Operand(MCInst *Inst, uint64_t Imm,
320
            int64_t Address, const void *Decoder)
321
0
{
322
  // Decode the dispSPE8 field, which has 5-bits, 8-byte aligned.
323
324
0
  uint64_t Disp = Imm & 0x1F;
325
326
0
  MCOperand_CreateImm0(Inst, (Disp << 3));
327
0
  return MCDisassembler_Success;
328
0
}
329
330
static DecodeStatus decodeDispSPE4Operand(MCInst *Inst, uint64_t Imm,
331
            int64_t Address, const void *Decoder)
332
0
{
333
  // Decode the dispSPE8 field, which has 5-bits, 4-byte aligned.
334
335
0
  uint64_t Disp = Imm & 0x1F;
336
337
0
  MCOperand_CreateImm0(Inst, (Disp << 2));
338
0
  return MCDisassembler_Success;
339
0
}
340
341
static DecodeStatus decodeDispSPE2Operand(MCInst *Inst, uint64_t Imm,
342
            int64_t Address, const void *Decoder)
343
0
{
344
  // Decode the dispSPE8 field, which has 5-bits, 2-byte aligned.
345
346
0
  uint64_t Disp = Imm & 0x1F;
347
0
  MCOperand_CreateImm0(Inst, (Disp << 1));
348
0
  return MCDisassembler_Success;
349
0
}
350
351
static DecodeStatus decodeDispRIXOperand(MCInst *Inst, uint64_t Imm,
352
           int64_t Address, const void *Decoder)
353
3.56k
{
354
  // The rix displacement is an immediate shifted by 2
355
3.56k
  MCOperand_CreateImm0(Inst, (SignExtend64((Imm << 2), 16)));
356
3.56k
  return MCDisassembler_Success;
357
3.56k
}
358
359
static DecodeStatus decodeDispRIX16Operand(MCInst *Inst, uint64_t Imm,
360
             int64_t Address, const void *Decoder)
361
882
{
362
  // The rix16 displacement has 12-bits which are shifted by 4.
363
882
  MCOperand_CreateImm0(Inst, (SignExtend64((Imm << 4), 16)));
364
882
  return MCDisassembler_Success;
365
882
}
366
367
static DecodeStatus decodeDispRIHashOperand(MCInst *Inst, uint64_t Imm,
368
              int64_t Address,
369
              const void *Decoder)
370
41
{
371
  // Decode the disp field for a hash store or hash check operation.
372
  // The field is composed of an immediate value that is 6 bits
373
  // and covers the range -8 to -512. The immediate is always negative and 2s
374
  // complement which is why we sign extend a 7 bit value.
375
41
  const int64_t Disp = SignExtend64(((Imm & 0x3F) + 64), 7) * 8;
376
377
41
  MCOperand_CreateImm0(Inst, (Disp));
378
41
  return MCDisassembler_Success;
379
41
}
380
381
static DecodeStatus decodeCRBitMOperand(MCInst *Inst, uint64_t Imm,
382
          int64_t Address, const void *Decoder)
383
301
{
384
  // The cr bit encoding is 0x80 >> cr_reg_num.
385
386
301
  unsigned Zeros = CountTrailingZeros_32(Imm);
387
301
  if (Zeros >= 8)
388
3
    return MCDisassembler_Fail;
389
390
298
  MCOperand_CreateReg0(Inst, (CRRegs[7 - Zeros]));
391
298
  return MCDisassembler_Success;
392
301
}
393
394
#include "PPCGenDisassemblerTables.inc"
395
396
DecodeStatus getInstruction(csh ud, const uint8_t *Bytes, size_t BytesLen,
397
          MCInst *MI, uint16_t *Size, uint64_t Address,
398
          void *Info)
399
93.9k
{
400
  // If this is an 8-byte prefixed instruction, handle it here.
401
  // Note: prefixed instructions aren't technically 8-byte entities - the
402
  // prefix
403
  //       appears in memory at an address 4 bytes prior to that of the base
404
  //       instruction regardless of endianness. So we read the two pieces and
405
  //       rebuild the 8-byte instruction.
406
  // TODO: In this function we call decodeInstruction several times with
407
  //       different decoder tables. It may be possible to only call once by
408
  //       looking at the top 6 bits of the instruction.
409
93.9k
  if (PPC_getFeatureBits(MI->csh->mode, PPC_FeaturePrefixInstrs) &&
410
93.9k
      BytesLen >= 8) {
411
91.4k
    uint32_t Prefix = readBytes32(MI, Bytes);
412
91.4k
    uint32_t BaseInst = readBytes32(MI, Bytes + 4);
413
91.4k
    uint64_t Inst = BaseInst | (uint64_t)Prefix << 32;
414
91.4k
    DecodeStatus result = decodeInstruction_4(DecoderTable64, MI,
415
91.4k
                Inst, Address, NULL);
416
91.4k
    if (result != MCDisassembler_Fail) {
417
1.34k
      *Size = 8;
418
1.34k
      return result;
419
1.34k
    }
420
91.4k
  }
421
422
  // Get the four bytes of the instruction.
423
92.6k
  *Size = 4;
424
92.6k
  if (BytesLen < 4) {
425
865
    *Size = 0;
426
865
    return MCDisassembler_Fail;
427
865
  }
428
429
  // Read the instruction in the proper endianness.
430
91.7k
  uint64_t Inst = readBytes32(MI, Bytes);
431
432
91.7k
  if (PPC_getFeatureBits(MI->csh->mode, PPC_FeatureQPX)) {
433
26.7k
    DecodeStatus result = decodeInstruction_4(DecoderTableQPX32, MI,
434
26.7k
                Inst, Address, NULL);
435
26.7k
    if (result != MCDisassembler_Fail)
436
2.44k
      return result;
437
65.0k
  } else if (PPC_getFeatureBits(MI->csh->mode, PPC_FeatureSPE)) {
438
0
    DecodeStatus result = decodeInstruction_4(DecoderTableSPE32, MI,
439
0
                Inst, Address, NULL);
440
0
    if (result != MCDisassembler_Fail)
441
0
      return result;
442
65.0k
  } else if (PPC_getFeatureBits(MI->csh->mode, PPC_FeaturePS)) {
443
16.2k
    DecodeStatus result = decodeInstruction_4(DecoderTablePS32, MI,
444
16.2k
                Inst, Address, NULL);
445
16.2k
    if (result != MCDisassembler_Fail)
446
2.02k
      return result;
447
16.2k
  }
448
449
87.2k
  return decodeInstruction_4(DecoderTable32, MI, Inst, Address, NULL);
450
91.7k
}
451
452
DecodeStatus PPC_LLVM_getInstruction(csh handle, const uint8_t *Bytes,
453
             size_t BytesLen, MCInst *MI,
454
             uint16_t *Size, uint64_t Address,
455
             void *Info)
456
93.9k
{
457
93.9k
  return getInstruction(handle, Bytes, BytesLen, MI, Size, Address, Info);
458
93.9k
}