Coverage Report

Created: 2025-10-28 07:02

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
7.64k
{
57
7.64k
  MCOperand_CreateImm0(Inst, (SignExtend32((Imm), 14)));
58
7.64k
  return MCDisassembler_Success;
59
7.64k
}
60
61
static DecodeStatus decodeDirectBrTarget(MCInst *Inst, unsigned Imm,
62
           uint64_t Address, const void *Decoder)
63
549
{
64
549
  int32_t Offset = SignExtend32((Imm), 24);
65
549
  MCOperand_CreateImm0(Inst, (Offset));
66
549
  return MCDisassembler_Success;
67
549
}
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
149k
{
75
149k
  MCOperand_CreateReg0(Inst, (Regs[RegNo]));
76
149k
  return MCDisassembler_Success;
77
149k
}
78
79
static DecodeStatus DecodeCRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
80
              uint64_t Address,
81
              const void *Decoder)
82
9.39k
{
83
9.39k
  return decodeRegisterClass(Inst, RegNo, CRRegs);
84
9.39k
}
85
86
static DecodeStatus DecodeCRBITRCRegisterClass(MCInst *Inst, uint64_t RegNo,
87
                 uint64_t Address,
88
                 const void *Decoder)
89
22.8k
{
90
22.8k
  return decodeRegisterClass(Inst, RegNo, CRBITRegs);
91
22.8k
}
92
93
static DecodeStatus DecodeF4RCRegisterClass(MCInst *Inst, uint64_t RegNo,
94
              uint64_t Address,
95
              const void *Decoder)
96
9.95k
{
97
9.95k
  return decodeRegisterClass(Inst, RegNo, FRegs);
98
9.95k
}
99
100
static DecodeStatus DecodeF8RCRegisterClass(MCInst *Inst, uint64_t RegNo,
101
              uint64_t Address,
102
              const void *Decoder)
103
17.0k
{
104
17.0k
  return decodeRegisterClass(Inst, RegNo, FRegs);
105
17.0k
}
106
107
static DecodeStatus DecodeFpRCRegisterClass(MCInst *Inst, uint64_t RegNo,
108
              uint64_t Address,
109
              const void *Decoder)
110
3.13k
{
111
3.13k
  if (RegNo > 30 || (RegNo & 1))
112
66
    return MCDisassembler_Fail;
113
3.06k
  return decodeRegisterClass(Inst, RegNo >> 1, FpRegs);
114
3.13k
}
115
116
static DecodeStatus DecodeVFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
117
              uint64_t Address,
118
              const void *Decoder)
119
932
{
120
932
  return decodeRegisterClass(Inst, RegNo, VFRegs);
121
932
}
122
123
static DecodeStatus DecodeVRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
124
              uint64_t Address,
125
              const void *Decoder)
126
27.3k
{
127
27.3k
  return decodeRegisterClass(Inst, RegNo, VRegs);
128
27.3k
}
129
130
static DecodeStatus DecodeVSRCRegisterClass(MCInst *Inst, uint64_t RegNo,
131
              uint64_t Address,
132
              const void *Decoder)
133
32.2k
{
134
32.2k
  return decodeRegisterClass(Inst, RegNo, VSRegs);
135
32.2k
}
136
137
static DecodeStatus DecodeVSFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
138
               uint64_t Address,
139
               const void *Decoder)
140
9.15k
{
141
9.15k
  return decodeRegisterClass(Inst, RegNo, VSFRegs);
142
9.15k
}
143
144
static DecodeStatus DecodeVSSRCRegisterClass(MCInst *Inst, uint64_t RegNo,
145
               uint64_t Address,
146
               const void *Decoder)
147
6.40k
{
148
6.40k
  return decodeRegisterClass(Inst, RegNo, VSSRegs);
149
6.40k
}
150
151
static DecodeStatus DecodeGPRCRegisterClass(MCInst *Inst, uint64_t RegNo,
152
              uint64_t Address,
153
              const void *Decoder)
154
132k
{
155
132k
  return decodeRegisterClass(Inst, RegNo, RRegs);
156
132k
}
157
158
static DecodeStatus DecodeGPRC_NOR0RegisterClass(MCInst *Inst, uint64_t RegNo,
159
             uint64_t Address,
160
             const void *Decoder)
161
32.2k
{
162
32.2k
  return decodeRegisterClass(Inst, RegNo, RRegsNoR0);
163
32.2k
}
164
165
static DecodeStatus DecodeG8RCRegisterClass(MCInst *Inst, uint64_t RegNo,
166
              uint64_t Address,
167
              const void *Decoder)
168
35.1k
{
169
35.1k
  return decodeRegisterClass(Inst, RegNo, XRegs);
170
35.1k
}
171
172
static DecodeStatus DecodeG8pRCRegisterClass(MCInst *Inst, uint64_t RegNo,
173
               uint64_t Address,
174
               const void *Decoder)
175
552
{
176
552
  return decodeRegisterClass(Inst, RegNo, XRegs);
177
552
}
178
179
static DecodeStatus DecodeG8RC_NOX0RegisterClass(MCInst *Inst, uint64_t RegNo,
180
             uint64_t Address,
181
             const void *Decoder)
182
169
{
183
169
  return decodeRegisterClass(Inst, RegNo, XRegsNoX0);
184
169
}
185
186
3.89k
#define DecodePointerLikeRegClass0 DecodeGPRCRegisterClass
187
22.1k
#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
404
{
207
404
  return decodeRegisterClass(Inst, RegNo, WACCRegs);
208
404
}
209
210
static DecodeStatus DecodeWACC_HIRCRegisterClass(MCInst *Inst, uint64_t RegNo,
211
             uint64_t Address,
212
             const void *Decoder)
213
241
{
214
241
  return decodeRegisterClass(Inst, RegNo, WACC_HIRegs);
215
241
}
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
262
{
229
262
  return decodeRegisterClass(Inst, RegNo, DMRROWpRegs);
230
262
}
231
232
static DecodeStatus DecodeDMRRCRegisterClass(MCInst *Inst, uint64_t RegNo,
233
               uint64_t Address,
234
               const void *Decoder)
235
165
{
236
165
  return decodeRegisterClass(Inst, RegNo, DMRRegs);
237
165
}
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
2.81k
{
251
2.81k
  return decodeRegisterClass(Inst, RegNo, VSRpRegs);
252
2.81k
}
253
254
2.37k
#define DecodeQSRCRegisterClass DecodeQFRCRegisterClass
255
2.63k
#define DecodeQBRCRegisterClass DecodeQFRCRegisterClass
256
257
static DecodeStatus DecodeQFRCRegisterClass(MCInst *Inst, uint64_t RegNo,
258
              uint64_t Address,
259
              const void *Decoder)
260
29.8k
{
261
29.8k
  return decodeRegisterClass(Inst, RegNo, QFRegs);
262
29.8k
}
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
35.9k
  { \
269
35.9k
    if (!isUIntN(N, Imm)) \
270
35.9k
      return MCDisassembler_Fail; \
271
35.9k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
35.9k
    return MCDisassembler_Success; \
273
35.9k
  }
PPCDisassembler.c:decodeUImmOperand_5
Line
Count
Source
268
18.8k
  { \
269
18.8k
    if (!isUIntN(N, Imm)) \
270
18.8k
      return MCDisassembler_Fail; \
271
18.8k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
18.8k
    return MCDisassembler_Success; \
273
18.8k
  }
PPCDisassembler.c:decodeUImmOperand_1
Line
Count
Source
268
3.30k
  { \
269
3.30k
    if (!isUIntN(N, Imm)) \
270
3.30k
      return MCDisassembler_Fail; \
271
3.30k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
3.30k
    return MCDisassembler_Success; \
273
3.30k
  }
PPCDisassembler.c:decodeUImmOperand_4
Line
Count
Source
268
1.93k
  { \
269
1.93k
    if (!isUIntN(N, Imm)) \
270
1.93k
      return MCDisassembler_Fail; \
271
1.93k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
1.92k
    return MCDisassembler_Success; \
273
1.93k
  }
PPCDisassembler.c:decodeUImmOperand_3
Line
Count
Source
268
2.43k
  { \
269
2.43k
    if (!isUIntN(N, Imm)) \
270
2.43k
      return MCDisassembler_Fail; \
271
2.43k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
2.43k
    return MCDisassembler_Success; \
273
2.43k
  }
PPCDisassembler.c:decodeUImmOperand_16
Line
Count
Source
268
3.05k
  { \
269
3.05k
    if (!isUIntN(N, Imm)) \
270
3.05k
      return MCDisassembler_Fail; \
271
3.05k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
3.05k
    return MCDisassembler_Success; \
273
3.05k
  }
PPCDisassembler.c:decodeUImmOperand_6
Line
Count
Source
268
2.96k
  { \
269
2.96k
    if (!isUIntN(N, Imm)) \
270
2.96k
      return MCDisassembler_Fail; \
271
2.96k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
2.96k
    return MCDisassembler_Success; \
273
2.96k
  }
PPCDisassembler.c:decodeUImmOperand_2
Line
Count
Source
268
2.28k
  { \
269
2.28k
    if (!isUIntN(N, Imm)) \
270
2.28k
      return MCDisassembler_Fail; \
271
2.28k
    MCOperand_CreateImm0(Inst, (Imm)); \
272
2.28k
    return MCDisassembler_Success; \
273
2.28k
  }
PPCDisassembler.c:decodeUImmOperand_10
Line
Count
Source
268
34
  { \
269
34
    if (!isUIntN(N, Imm)) \
270
34
      return MCDisassembler_Fail; \
271
34
    MCOperand_CreateImm0(Inst, (Imm)); \
272
34
    return MCDisassembler_Success; \
273
34
  }
PPCDisassembler.c:decodeUImmOperand_8
Line
Count
Source
268
188
  { \
269
188
    if (!isUIntN(N, Imm)) \
270
188
      return MCDisassembler_Fail; \
271
188
    MCOperand_CreateImm0(Inst, (Imm)); \
272
188
    return MCDisassembler_Success; \
273
188
  }
PPCDisassembler.c:decodeUImmOperand_7
Line
Count
Source
268
258
  { \
269
258
    if (!isUIntN(N, Imm)) \
270
258
      return MCDisassembler_Fail; \
271
258
    MCOperand_CreateImm0(Inst, (Imm)); \
272
258
    return MCDisassembler_Success; \
273
258
  }
PPCDisassembler.c:decodeUImmOperand_12
Line
Count
Source
268
682
  { \
269
682
    if (!isUIntN(N, Imm)) \
270
682
      return MCDisassembler_Fail; \
271
682
    MCOperand_CreateImm0(Inst, (Imm)); \
272
682
    return MCDisassembler_Success; \
273
682
  }
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
6.31k
  { \
291
6.31k
    if (!isUIntN(N, Imm)) \
292
6.31k
      return MCDisassembler_Fail; \
293
6.31k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
6.31k
    return MCDisassembler_Success; \
295
6.31k
  }
PPCDisassembler.c:decodeSImmOperand_16
Line
Count
Source
290
5.17k
  { \
291
5.17k
    if (!isUIntN(N, Imm)) \
292
5.17k
      return MCDisassembler_Fail; \
293
5.17k
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
5.17k
    return MCDisassembler_Success; \
295
5.17k
  }
PPCDisassembler.c:decodeSImmOperand_5
Line
Count
Source
290
384
  { \
291
384
    if (!isUIntN(N, Imm)) \
292
384
      return MCDisassembler_Fail; \
293
384
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
384
    return MCDisassembler_Success; \
295
384
  }
PPCDisassembler.c:decodeSImmOperand_34
Line
Count
Source
290
757
  { \
291
757
    if (!isUIntN(N, Imm)) \
292
757
      return MCDisassembler_Fail; \
293
757
    MCOperand_CreateImm0(Inst, (SignExtend64((Imm), N))); \
294
757
    return MCDisassembler_Success; \
295
757
  }
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
320
{
303
320
  if (Imm != 0)
304
8
    return MCDisassembler_Fail;
305
312
  MCOperand_CreateImm0(Inst, (Imm));
306
312
  return MCDisassembler_Success;
307
320
}
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
1.60k
{
354
  // The rix displacement is an immediate shifted by 2
355
1.60k
  MCOperand_CreateImm0(Inst, (SignExtend64((Imm << 2), 16)));
356
1.60k
  return MCDisassembler_Success;
357
1.60k
}
358
359
static DecodeStatus decodeDispRIX16Operand(MCInst *Inst, uint64_t Imm,
360
             int64_t Address, const void *Decoder)
361
695
{
362
  // The rix16 displacement has 12-bits which are shifted by 4.
363
695
  MCOperand_CreateImm0(Inst, (SignExtend64((Imm << 4), 16)));
364
695
  return MCDisassembler_Success;
365
695
}
366
367
static DecodeStatus decodeDispRIHashOperand(MCInst *Inst, uint64_t Imm,
368
              int64_t Address,
369
              const void *Decoder)
370
295
{
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
295
  const int64_t Disp = SignExtend64(((Imm & 0x3F) + 64), 7) * 8;
376
377
295
  MCOperand_CreateImm0(Inst, (Disp));
378
295
  return MCDisassembler_Success;
379
295
}
380
381
static DecodeStatus decodeCRBitMOperand(MCInst *Inst, uint64_t Imm,
382
          int64_t Address, const void *Decoder)
383
1.70k
{
384
  // The cr bit encoding is 0x80 >> cr_reg_num.
385
386
1.70k
  unsigned Zeros = CountTrailingZeros_32(Imm);
387
1.70k
  if (Zeros >= 8)
388
4
    return MCDisassembler_Fail;
389
390
1.69k
  MCOperand_CreateReg0(Inst, (CRRegs[7 - Zeros]));
391
1.69k
  return MCDisassembler_Success;
392
1.70k
}
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
69.3k
{
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
69.3k
  if (PPC_getFeatureBits(MI->csh->mode, PPC_FeaturePrefixInstrs) &&
410
69.3k
      BytesLen >= 8) {
411
66.1k
    uint32_t Prefix = readBytes32(MI, Bytes);
412
66.1k
    uint32_t BaseInst = readBytes32(MI, Bytes + 4);
413
66.1k
    uint64_t Inst = BaseInst | (uint64_t)Prefix << 32;
414
66.1k
    DecodeStatus result = decodeInstruction_4(DecoderTable64, MI,
415
66.1k
                Inst, Address, NULL);
416
66.1k
    if (result != MCDisassembler_Fail) {
417
995
      *Size = 8;
418
995
      return result;
419
995
    }
420
66.1k
  }
421
422
  // Get the four bytes of the instruction.
423
68.3k
  *Size = 4;
424
68.3k
  if (BytesLen < 4) {
425
900
    *Size = 0;
426
900
    return MCDisassembler_Fail;
427
900
  }
428
429
  // Read the instruction in the proper endianness.
430
67.4k
  uint64_t Inst = readBytes32(MI, Bytes);
431
432
67.4k
  if (PPC_getFeatureBits(MI->csh->mode, PPC_FeatureQPX)) {
433
32.0k
    DecodeStatus result = decodeInstruction_4(DecoderTableQPX32, MI,
434
32.0k
                Inst, Address, NULL);
435
32.0k
    if (result != MCDisassembler_Fail)
436
3.86k
      return result;
437
35.4k
  } 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
35.4k
  } else if (PPC_getFeatureBits(MI->csh->mode, PPC_FeaturePS)) {
443
12.4k
    DecodeStatus result = decodeInstruction_4(DecoderTablePS32, MI,
444
12.4k
                Inst, Address, NULL);
445
12.4k
    if (result != MCDisassembler_Fail)
446
1.24k
      return result;
447
12.4k
  }
448
449
62.3k
  return decodeInstruction_4(DecoderTable32, MI, Inst, Address, NULL);
450
67.4k
}
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
69.3k
{
457
69.3k
  return getInstruction(handle, Bytes, BytesLen, MI, Size, Address, Info);
458
69.3k
}