Coverage Report

Created: 2025-07-04 06:11

/src/capstonenext/arch/PowerPC/PPCDisassembler.c
Line
Count
Source (jump to first uncovered line)
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
6.76k
{
57
6.76k
  MCOperand_CreateImm0(Inst, (SignExtend32((Imm), 14)));
58
6.76k
  return MCDisassembler_Success;
59
6.76k
}
60
61
static DecodeStatus decodeDirectBrTarget(MCInst *Inst, unsigned Imm,
62
           uint64_t Address, const void *Decoder)
63
825
{
64
825
  int32_t Offset = SignExtend32((Imm), 24);
65
825
  MCOperand_CreateImm0(Inst, (Offset));
66
825
  return MCDisassembler_Success;
67
825
}
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
101k
{
75
101k
  MCOperand_CreateReg0(Inst, (Regs[RegNo]));
76
101k
  return MCDisassembler_Success;
77
101k
}
78
79
static DecodeStatus DecodeCRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
80
              uint64_t Address,
81
              const void *Decoder)
82
8.11k
{
83
8.11k
  return decodeRegisterClass(Inst, RegNo, CRRegs);
84
8.11k
}
85
86
static DecodeStatus DecodeCRBITRCRegisterClass(MCInst *Inst, uint64_t RegNo,
87
                 uint64_t Address,
88
                 const void *Decoder)
89
17.1k
{
90
17.1k
  return decodeRegisterClass(Inst, RegNo, CRBITRegs);
91
17.1k
}
92
93
static DecodeStatus DecodeF4RCRegisterClass(MCInst *Inst, uint64_t RegNo,
94
              uint64_t Address,
95
              const void *Decoder)
96
6.77k
{
97
6.77k
  return decodeRegisterClass(Inst, RegNo, FRegs);
98
6.77k
}
99
100
static DecodeStatus DecodeF8RCRegisterClass(MCInst *Inst, uint64_t RegNo,
101
              uint64_t Address,
102
              const void *Decoder)
103
14.9k
{
104
14.9k
  return decodeRegisterClass(Inst, RegNo, FRegs);
105
14.9k
}
106
107
static DecodeStatus DecodeFpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
108
              uint64_t Address, const void *Decoder)
109
1.84k
{
110
1.84k
  if (RegNo > 30 || (RegNo & 1))
111
64
    return MCDisassembler_Fail;
112
1.78k
  return decodeRegisterClass(Inst, RegNo >> 1, FpRegs);
113
1.84k
}
114
115
static DecodeStatus DecodeVFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
116
              uint64_t Address,
117
              const void *Decoder)
118
574
{
119
574
  return decodeRegisterClass(Inst, RegNo, VFRegs);
120
574
}
121
122
static DecodeStatus DecodeVRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
123
              uint64_t Address,
124
              const void *Decoder)
125
17.8k
{
126
17.8k
  return decodeRegisterClass(Inst, RegNo, VRegs);
127
17.8k
}
128
129
static DecodeStatus DecodeVSRCRegisterClass(MCInst *Inst, uint64_t RegNo,
130
              uint64_t Address,
131
              const void *Decoder)
132
19.1k
{
133
19.1k
  return decodeRegisterClass(Inst, RegNo, VSRegs);
134
19.1k
}
135
136
static DecodeStatus DecodeVSFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
137
               uint64_t Address,
138
               const void *Decoder)
139
6.59k
{
140
6.59k
  return decodeRegisterClass(Inst, RegNo, VSFRegs);
141
6.59k
}
142
143
static DecodeStatus DecodeVSSRCRegisterClass(MCInst *Inst, uint64_t RegNo,
144
               uint64_t Address,
145
               const void *Decoder)
146
3.42k
{
147
3.42k
  return decodeRegisterClass(Inst, RegNo, VSSRegs);
148
3.42k
}
149
150
static DecodeStatus DecodeGPRCRegisterClass(MCInst *Inst, uint64_t RegNo,
151
              uint64_t Address,
152
              const void *Decoder)
153
112k
{
154
112k
  return decodeRegisterClass(Inst, RegNo, RRegs);
155
112k
}
156
157
static DecodeStatus DecodeGPRC_NOR0RegisterClass(MCInst *Inst, uint64_t RegNo,
158
             uint64_t Address,
159
             const void *Decoder)
160
26.0k
{
161
26.0k
  return decodeRegisterClass(Inst, RegNo, RRegsNoR0);
162
26.0k
}
163
164
static DecodeStatus DecodeG8RCRegisterClass(MCInst *Inst, uint64_t RegNo,
165
              uint64_t Address,
166
              const void *Decoder)
167
30.9k
{
168
30.9k
  return decodeRegisterClass(Inst, RegNo, XRegs);
169
30.9k
}
170
171
static DecodeStatus DecodeG8pRCRegisterClass(MCInst *Inst, uint64_t RegNo,
172
               uint64_t Address,
173
               const void *Decoder)
174
497
{
175
497
  return decodeRegisterClass(Inst, RegNo, XRegs);
176
497
}
177
178
static DecodeStatus DecodeG8RC_NOX0RegisterClass(MCInst *Inst, uint64_t RegNo,
179
             uint64_t Address,
180
             const void *Decoder)
181
122
{
182
122
  return decodeRegisterClass(Inst, RegNo, XRegsNoX0);
183
122
}
184
185
3.16k
#define DecodePointerLikeRegClass0 DecodeGPRCRegisterClass
186
17.6k
#define DecodePointerLikeRegClass1 DecodeGPRC_NOR0RegisterClass
187
188
static DecodeStatus DecodeSPERCRegisterClass(MCInst *Inst, uint64_t RegNo,
189
               uint64_t Address,
190
               const void *Decoder)
191
0
{
192
0
  return decodeRegisterClass(Inst, RegNo, SPERegs);
193
0
}
194
195
static DecodeStatus DecodeACCRCRegisterClass(MCInst *Inst, uint64_t RegNo,
196
               uint64_t Address,
197
               const void *Decoder)
198
0
{
199
0
  return decodeRegisterClass(Inst, RegNo, ACCRegs);
200
0
}
201
202
static DecodeStatus DecodeWACCRCRegisterClass(MCInst *Inst, uint64_t RegNo,
203
                uint64_t Address,
204
                const void *Decoder)
205
364
{
206
364
  return decodeRegisterClass(Inst, RegNo, WACCRegs);
207
364
}
208
209
static DecodeStatus DecodeWACC_HIRCRegisterClass(MCInst *Inst, uint64_t RegNo,
210
             uint64_t Address,
211
             const void *Decoder)
212
34
{
213
34
  return decodeRegisterClass(Inst, RegNo, WACC_HIRegs);
214
34
}
215
216
// TODO: Make this function static when the register class is used by a new
217
//       instruction.
218
DecodeStatus DecodeDMRROWRCRegisterClass(MCInst *Inst, uint64_t RegNo,
219
           uint64_t Address, const void *Decoder)
220
0
{
221
0
  return decodeRegisterClass(Inst, RegNo, DMRROWRegs);
222
0
}
223
224
static DecodeStatus DecodeDMRROWpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
225
             uint64_t Address,
226
             const void *Decoder)
227
44
{
228
44
  return decodeRegisterClass(Inst, RegNo, DMRROWpRegs);
229
44
}
230
231
static DecodeStatus DecodeDMRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
232
               uint64_t Address,
233
               const void *Decoder)
234
84
{
235
84
  return decodeRegisterClass(Inst, RegNo, DMRRegs);
236
84
}
237
238
// TODO: Make this function static when the register class is used by a new
239
//       instruction.
240
DecodeStatus DecodeDMRpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
241
               uint64_t Address, const void *Decoder)
242
0
{
243
0
  return decodeRegisterClass(Inst, RegNo, DMRpRegs);
244
0
}
245
246
static DecodeStatus DecodeVSRpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
247
                uint64_t Address,
248
                const void *Decoder)
249
1.39k
{
250
1.39k
  return decodeRegisterClass(Inst, RegNo, VSRpRegs);
251
1.39k
}
252
253
832
#define DecodeQSRCRegisterClass DecodeQFRCRegisterClass
254
995
#define DecodeQBRCRegisterClass DecodeQFRCRegisterClass
255
256
static DecodeStatus DecodeQFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
257
              uint64_t Address,
258
              const void *Decoder)
259
25.4k
{
260
25.4k
  return decodeRegisterClass(Inst, RegNo, QFRegs);
261
25.4k
}
262
263
#define DEFINE_decodeUImmOperand(N) \
264
  static DecodeStatus CONCAT(decodeUImmOperand, \
265
           N)(MCInst * Inst, uint64_t Imm, \
266
              int64_t Address, const void *Decoder) \
267
28.4k
  { \
268
28.4k
    if (!isUIntN(N, Imm)) \
269
28.4k
      return MCDisassembler_Fail; \
270
28.4k
    MCOperand_CreateImm0(Inst, (Imm)); \
271
28.4k
    return MCDisassembler_Success; \
272
28.4k
  }
PPCDisassembler.c:decodeUImmOperand_5
Line
Count
Source
267
17.5k
  { \
268
17.5k
    if (!isUIntN(N, Imm)) \
269
17.5k
      return MCDisassembler_Fail; \
270
17.5k
    MCOperand_CreateImm0(Inst, (Imm)); \
271
17.5k
    return MCDisassembler_Success; \
272
17.5k
  }
PPCDisassembler.c:decodeUImmOperand_1
Line
Count
Source
267
2.28k
  { \
268
2.28k
    if (!isUIntN(N, Imm)) \
269
2.28k
      return MCDisassembler_Fail; \
270
2.28k
    MCOperand_CreateImm0(Inst, (Imm)); \
271
2.28k
    return MCDisassembler_Success; \
272
2.28k
  }
PPCDisassembler.c:decodeUImmOperand_4
Line
Count
Source
267
697
  { \
268
697
    if (!isUIntN(N, Imm)) \
269
697
      return MCDisassembler_Fail; \
270
697
    MCOperand_CreateImm0(Inst, (Imm)); \
271
691
    return MCDisassembler_Success; \
272
697
  }
PPCDisassembler.c:decodeUImmOperand_3
Line
Count
Source
267
1.68k
  { \
268
1.68k
    if (!isUIntN(N, Imm)) \
269
1.68k
      return MCDisassembler_Fail; \
270
1.68k
    MCOperand_CreateImm0(Inst, (Imm)); \
271
1.67k
    return MCDisassembler_Success; \
272
1.68k
  }
PPCDisassembler.c:decodeUImmOperand_16
Line
Count
Source
267
2.61k
  { \
268
2.61k
    if (!isUIntN(N, Imm)) \
269
2.61k
      return MCDisassembler_Fail; \
270
2.61k
    MCOperand_CreateImm0(Inst, (Imm)); \
271
2.61k
    return MCDisassembler_Success; \
272
2.61k
  }
PPCDisassembler.c:decodeUImmOperand_6
Line
Count
Source
267
2.23k
  { \
268
2.23k
    if (!isUIntN(N, Imm)) \
269
2.23k
      return MCDisassembler_Fail; \
270
2.23k
    MCOperand_CreateImm0(Inst, (Imm)); \
271
2.23k
    return MCDisassembler_Success; \
272
2.23k
  }
PPCDisassembler.c:decodeUImmOperand_2
Line
Count
Source
267
740
  { \
268
740
    if (!isUIntN(N, Imm)) \
269
740
      return MCDisassembler_Fail; \
270
740
    MCOperand_CreateImm0(Inst, (Imm)); \
271
740
    return MCDisassembler_Success; \
272
740
  }
PPCDisassembler.c:decodeUImmOperand_10
Line
Count
Source
267
26
  { \
268
26
    if (!isUIntN(N, Imm)) \
269
26
      return MCDisassembler_Fail; \
270
26
    MCOperand_CreateImm0(Inst, (Imm)); \
271
26
    return MCDisassembler_Success; \
272
26
  }
PPCDisassembler.c:decodeUImmOperand_8
Line
Count
Source
267
78
  { \
268
78
    if (!isUIntN(N, Imm)) \
269
78
      return MCDisassembler_Fail; \
270
78
    MCOperand_CreateImm0(Inst, (Imm)); \
271
78
    return MCDisassembler_Success; \
272
78
  }
PPCDisassembler.c:decodeUImmOperand_7
Line
Count
Source
267
76
  { \
268
76
    if (!isUIntN(N, Imm)) \
269
76
      return MCDisassembler_Fail; \
270
76
    MCOperand_CreateImm0(Inst, (Imm)); \
271
76
    return MCDisassembler_Success; \
272
76
  }
PPCDisassembler.c:decodeUImmOperand_12
Line
Count
Source
267
502
  { \
268
502
    if (!isUIntN(N, Imm)) \
269
502
      return MCDisassembler_Fail; \
270
502
    MCOperand_CreateImm0(Inst, (Imm)); \
271
502
    return MCDisassembler_Success; \
272
502
  }
273
DEFINE_decodeUImmOperand(1);
274
DEFINE_decodeUImmOperand(2);
275
DEFINE_decodeUImmOperand(3);
276
DEFINE_decodeUImmOperand(4);
277
DEFINE_decodeUImmOperand(5);
278
DEFINE_decodeUImmOperand(6);
279
DEFINE_decodeUImmOperand(7);
280
DEFINE_decodeUImmOperand(8);
281
DEFINE_decodeUImmOperand(10);
282
DEFINE_decodeUImmOperand(12);
283
DEFINE_decodeUImmOperand(16);
284
285
#define DEFINE_decodeSImmOperand(N) \
286
  static DecodeStatus CONCAT(decodeSImmOperand, \
287
           N)(MCInst * Inst, uint64_t Imm, \
288
              int64_t Address, const void *Decoder) \
289
5.21k
  { \
290
5.21k
    if (!isUIntN(N, Imm)) \
291
5.21k
      return MCDisassembler_Fail; \
292
5.21k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
293
5.21k
    return MCDisassembler_Success; \
294
5.21k
  }
PPCDisassembler.c:decodeSImmOperand_16
Line
Count
Source
289
4.60k
  { \
290
4.60k
    if (!isUIntN(N, Imm)) \
291
4.60k
      return MCDisassembler_Fail; \
292
4.60k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
293
4.60k
    return MCDisassembler_Success; \
294
4.60k
  }
PPCDisassembler.c:decodeSImmOperand_5
Line
Count
Source
289
181
  { \
290
181
    if (!isUIntN(N, Imm)) \
291
181
      return MCDisassembler_Fail; \
292
181
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
293
181
    return MCDisassembler_Success; \
294
181
  }
PPCDisassembler.c:decodeSImmOperand_34
Line
Count
Source
289
424
  { \
290
424
    if (!isUIntN(N, Imm)) \
291
424
      return MCDisassembler_Fail; \
292
424
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
293
424
    return MCDisassembler_Success; \
294
424
  }
295
DEFINE_decodeSImmOperand(16);
296
DEFINE_decodeSImmOperand(5);
297
DEFINE_decodeSImmOperand(34);
298
299
static DecodeStatus decodeImmZeroOperand(MCInst *Inst, uint64_t Imm,
300
           int64_t Address, const void *Decoder)
301
101
{
302
101
  if (Imm != 0)
303
7
    return MCDisassembler_Fail;
304
94
  MCOperand_CreateImm0(Inst, (Imm));
305
94
  return MCDisassembler_Success;
306
101
}
307
308
static DecodeStatus decodeVSRpEvenOperands(MCInst *Inst, uint64_t RegNo,
309
             uint64_t Address,
310
             const void *Decoder)
311
0
{
312
0
  if (RegNo & 1)
313
0
    return MCDisassembler_Fail;
314
0
  MCOperand_CreateReg0(Inst, (VSRpRegs[RegNo >> 1]));
315
0
  return MCDisassembler_Success;
316
0
}
317
318
static DecodeStatus decodeDispSPE8Operand(MCInst *Inst, uint64_t Imm,
319
            int64_t Address, const void *Decoder)
320
0
{
321
  // Decode the dispSPE8 field, which has 5-bits, 8-byte aligned.
322
323
0
  uint64_t Disp = Imm & 0x1F;
324
325
0
  MCOperand_CreateImm0(Inst, (Disp << 3));
326
0
  return MCDisassembler_Success;
327
0
}
328
329
static DecodeStatus decodeDispSPE4Operand(MCInst *Inst, uint64_t Imm,
330
            int64_t Address, const void *Decoder)
331
0
{
332
  // Decode the dispSPE8 field, which has 5-bits, 4-byte aligned.
333
334
0
  uint64_t Disp = Imm & 0x1F;
335
336
0
  MCOperand_CreateImm0(Inst, (Disp << 2));
337
0
  return MCDisassembler_Success;
338
0
}
339
340
static DecodeStatus decodeDispSPE2Operand(MCInst *Inst, uint64_t Imm,
341
            int64_t Address, const void *Decoder)
342
0
{
343
  // Decode the dispSPE8 field, which has 5-bits, 2-byte aligned.
344
345
0
  uint64_t Disp = Imm & 0x1F;
346
0
  MCOperand_CreateImm0(Inst, (Disp << 1));
347
0
  return MCDisassembler_Success;
348
0
}
349
350
static DecodeStatus decodeDispRIXOperand(MCInst *Inst, uint64_t Imm,
351
           int64_t Address, const void *Decoder)
352
1.57k
{
353
  // The rix displacement is an immediate shifted by 2
354
1.57k
  MCOperand_CreateImm0(Inst, (SignExtend64((Imm << 2), 16)));
355
1.57k
  return MCDisassembler_Success;
356
1.57k
}
357
358
static DecodeStatus decodeDispRIX16Operand(MCInst *Inst, uint64_t Imm,
359
             int64_t Address, const void *Decoder)
360
665
{
361
  // The rix16 displacement has 12-bits which are shifted by 4.
362
665
  MCOperand_CreateImm0(Inst, (SignExtend64((Imm << 4), 16)));
363
665
  return MCDisassembler_Success;
364
665
}
365
366
static DecodeStatus decodeDispRIHashOperand(MCInst *Inst, uint64_t Imm,
367
              int64_t Address,
368
              const void *Decoder)
369
41
{
370
  // Decode the disp field for a hash store or hash check operation.
371
  // The field is composed of an immediate value that is 6 bits
372
  // and covers the range -8 to -512. The immediate is always negative and 2s
373
  // complement which is why we sign extend a 7 bit value.
374
41
  const int64_t Disp = SignExtend64(((Imm & 0x3F) + 64), 7) * 8;
375
376
41
  MCOperand_CreateImm0(Inst, (Disp));
377
41
  return MCDisassembler_Success;
378
41
}
379
380
static DecodeStatus decodeCRBitMOperand(MCInst *Inst, uint64_t Imm,
381
          int64_t Address, const void *Decoder)
382
687
{
383
  // The cr bit encoding is 0x80 >> cr_reg_num.
384
385
687
  unsigned Zeros = CountTrailingZeros_32(Imm);
386
687
  if (Zeros >= 8)
387
5
    return MCDisassembler_Fail;
388
389
682
  MCOperand_CreateReg0(Inst, (CRRegs[7 - Zeros]));
390
682
  return MCDisassembler_Success;
391
687
}
392
393
#include "PPCGenDisassemblerTables.inc"
394
395
DecodeStatus getInstruction(csh ud, const uint8_t *Bytes, size_t BytesLen,
396
          MCInst *MI, uint16_t *Size, uint64_t Address,
397
          void *Info)
398
48.9k
{
399
  // If this is an 8-byte prefixed instruction, handle it here.
400
  // Note: prefixed instructions aren't technically 8-byte entities - the
401
  // prefix
402
  //       appears in memory at an address 4 bytes prior to that of the base
403
  //       instruction regardless of endianness. So we read the two pieces and
404
  //       rebuild the 8-byte instruction.
405
  // TODO: In this function we call decodeInstruction several times with
406
  //       different decoder tables. It may be possible to only call once by
407
  //       looking at the top 6 bits of the instruction.
408
48.9k
  if (PPC_getFeatureBits(MI->csh->mode, PPC_FeaturePrefixInstrs) &&
409
48.9k
      BytesLen >= 8) {
410
46.2k
    uint32_t Prefix = readBytes32(MI, Bytes);
411
46.2k
    uint32_t BaseInst = readBytes32(MI, Bytes + 4);
412
46.2k
    uint64_t Inst = BaseInst | (uint64_t)Prefix << 32;
413
46.2k
    DecodeStatus result =
414
46.2k
      decodeInstruction_4(DecoderTable64, MI, Inst, Address, NULL);
415
46.2k
    if (result != MCDisassembler_Fail) {
416
513
      *Size = 8;
417
513
      return result;
418
513
    }
419
46.2k
  }
420
421
  // Get the four bytes of the instruction.
422
48.4k
  *Size = 4;
423
48.4k
  if (BytesLen < 4) {
424
748
    *Size = 0;
425
748
    return MCDisassembler_Fail;
426
748
  }
427
428
  // Read the instruction in the proper endianness.
429
47.6k
  uint64_t Inst = readBytes32(MI, Bytes);
430
431
47.6k
  if (PPC_getFeatureBits(MI->csh->mode, PPC_FeatureQPX)) {
432
20.9k
    DecodeStatus result = decodeInstruction_4(DecoderTableQPX32, MI,
433
20.9k
                Inst, Address, NULL);
434
20.9k
    if (result != MCDisassembler_Fail)
435
1.97k
      return result;
436
26.6k
  } else if (PPC_getFeatureBits(MI->csh->mode, PPC_FeatureSPE)) {
437
0
    DecodeStatus result = decodeInstruction_4(DecoderTableSPE32, MI,
438
0
                Inst, Address, NULL);
439
0
    if (result != MCDisassembler_Fail)
440
0
      return result;
441
26.6k
  } else if (PPC_getFeatureBits(MI->csh->mode, PPC_FeaturePS)) {
442
8.76k
    DecodeStatus result = decodeInstruction_4(DecoderTablePS32, MI,
443
8.76k
                Inst, Address, NULL);
444
8.76k
    if (result != MCDisassembler_Fail)
445
886
      return result;
446
8.76k
  }
447
448
44.8k
  return decodeInstruction_4(DecoderTable32, MI, Inst, Address, NULL);
449
47.6k
}
450
451
DecodeStatus PPC_LLVM_getInstruction(csh handle, const uint8_t *Bytes,
452
             size_t BytesLen, MCInst *MI,
453
             uint16_t *Size, uint64_t Address,
454
             void *Info)
455
48.9k
{
456
48.9k
  return getInstruction(handle, Bytes, BytesLen, MI, Size, Address, Info);
457
48.9k
}