1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* * XCore Disassembler *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9
10#include "llvm/MC/MCInst.h"
11#include "llvm/MC/MCSubtargetInfo.h"
12#include "llvm/Support/DataTypes.h"
13#include "llvm/Support/Debug.h"
14#include "llvm/Support/LEB128.h"
15#include "llvm/Support/raw_ostream.h"
16#include "llvm/TargetParser/SubtargetFeature.h"
17#include <assert.h>
18
19namespace {
20
21// Helper functions for extracting fields from encoded instructions.
22// InsnType must either be integral or an APInt-like object that must:
23// * be default-constructible and copy-constructible
24// * be constructible from an APInt (this can be private)
25// * Support insertBits(bits, startBit, numBits)
26// * Support extractBitsAsZExtValue(numBits, startBit)
27// * Support the ~, &, ==, and != operators with other objects of the same type
28// * Support the != and bitwise & with uint64_t
29// * Support put (<<) to raw_ostream&
30template <typename InsnType>
31#if defined(_MSC_VER) && !defined(__clang__)
32__declspec(noinline)
33#endif
34static std::enable_if_t<std::is_integral<InsnType>::value, InsnType>
35fieldFromInstruction(const InsnType &insn, unsigned startBit,
36 unsigned numBits) {
37 assert(startBit + numBits <= 64 && "Cannot support >64-bit extractions!");
38 assert(startBit + numBits <= (sizeof(InsnType) * 8) &&
39 "Instruction field out of bounds!");
40 InsnType fieldMask;
41 if (numBits == sizeof(InsnType) * 8)
42 fieldMask = (InsnType)(-1LL);
43 else
44 fieldMask = (((InsnType)1 << numBits) - 1) << startBit;
45 return (insn & fieldMask) >> startBit;
46}
47
48template <typename InsnType>
49static std::enable_if_t<!std::is_integral<InsnType>::value, uint64_t>
50fieldFromInstruction(const InsnType &insn, unsigned startBit,
51 unsigned numBits) {
52 return insn.extractBitsAsZExtValue(numBits, startBit);
53}
54
55// Helper function for inserting bits extracted from an encoded instruction into
56// a field.
57template <typename InsnType>
58static void insertBits(InsnType &field, InsnType bits, unsigned startBit,
59 unsigned numBits) {
60 if constexpr (std::is_integral<InsnType>::value) {
61 assert(startBit + numBits <= sizeof field * 8);
62 (void)numBits;
63 field |= (InsnType)bits << startBit;
64 } else {
65 field.insertBits(bits, startBit, numBits);
66 }
67}
68
69static bool Check(DecodeStatus &Out, DecodeStatus In) {
70 Out = static_cast<DecodeStatus>(Out & In);
71 return Out != MCDisassembler::Fail;
72}
73
74static const uint8_t DecoderTable16[] = {
75/* 0 */ MCD::OPC_ExtractField, 11, 5, // Inst{15-11} ...
76/* 3 */ MCD::OPC_FilterValue, 0, 117, 0, // Skip to: 124
77/* 7 */ MCD::OPC_ExtractField, 0, 11, // Inst{10-0} ...
78/* 10 */ MCD::OPC_FilterValue, 236, 15, 4, 0, // Skip to: 19
79/* 15 */ MCD::OPC_Decode, 146, 4, 0, // Opcode: WAITEU_0R, DecodeIdx: 0
80/* 19 */ MCD::OPC_FilterValue, 237, 15, 4, 0, // Skip to: 28
81/* 24 */ MCD::OPC_Decode, 225, 2, 0, // Opcode: CLRE_0R, DecodeIdx: 0
82/* 28 */ MCD::OPC_FilterValue, 238, 15, 4, 0, // Skip to: 37
83/* 33 */ MCD::OPC_Decode, 250, 3, 0, // Opcode: SSYNC_0r, DecodeIdx: 0
84/* 37 */ MCD::OPC_FilterValue, 239, 15, 4, 0, // Skip to: 46
85/* 42 */ MCD::OPC_Decode, 129, 3, 0, // Opcode: FREET_0R, DecodeIdx: 0
86/* 46 */ MCD::OPC_FilterValue, 252, 15, 4, 0, // Skip to: 55
87/* 51 */ MCD::OPC_Decode, 234, 2, 0, // Opcode: DCALL_0R, DecodeIdx: 0
88/* 55 */ MCD::OPC_FilterValue, 253, 15, 4, 0, // Skip to: 64
89/* 60 */ MCD::OPC_Decode, 160, 3, 0, // Opcode: KRET_0R, DecodeIdx: 0
90/* 64 */ MCD::OPC_FilterValue, 254, 15, 4, 0, // Skip to: 73
91/* 69 */ MCD::OPC_Decode, 240, 2, 0, // Opcode: DRET_0R, DecodeIdx: 0
92/* 73 */ MCD::OPC_FilterValue, 255, 15, 4, 0, // Skip to: 82
93/* 78 */ MCD::OPC_Decode, 231, 3, 0, // Opcode: SETKEP_0R, DecodeIdx: 0
94/* 82 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
95/* 85 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 93
96/* 89 */ MCD::OPC_Decode, 243, 2, 1, // Opcode: EDU_1r, DecodeIdx: 1
97/* 93 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 101
98/* 97 */ MCD::OPC_Decode, 246, 2, 1, // Opcode: EEU_1r, DecodeIdx: 1
99/* 101 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
100/* 104 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 112
101/* 108 */ MCD::OPC_Decode, 147, 3, 2, // Opcode: INITPC_2r, DecodeIdx: 2
102/* 112 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 120
103/* 116 */ MCD::OPC_Decode, 141, 3, 2, // Opcode: GETST_2r, DecodeIdx: 2
104/* 120 */ MCD::OPC_Decode, 133, 4, 3, // Opcode: STW_2rus, DecodeIdx: 3
105/* 124 */ MCD::OPC_FilterValue, 1, 117, 0, // Skip to: 245
106/* 128 */ MCD::OPC_ExtractField, 0, 11, // Inst{10-0} ...
107/* 131 */ MCD::OPC_FilterValue, 236, 15, 4, 0, // Skip to: 140
108/* 136 */ MCD::OPC_Decode, 186, 3, 0, // Opcode: LDSPC_0R, DecodeIdx: 0
109/* 140 */ MCD::OPC_FilterValue, 237, 15, 4, 0, // Skip to: 149
110/* 145 */ MCD::OPC_Decode, 255, 3, 0, // Opcode: STSPC_0R, DecodeIdx: 0
111/* 149 */ MCD::OPC_FilterValue, 238, 15, 4, 0, // Skip to: 158
112/* 154 */ MCD::OPC_Decode, 187, 3, 0, // Opcode: LDSSR_0R, DecodeIdx: 0
113/* 158 */ MCD::OPC_FilterValue, 239, 15, 4, 0, // Skip to: 167
114/* 163 */ MCD::OPC_Decode, 128, 4, 0, // Opcode: STSSR_0R, DecodeIdx: 0
115/* 167 */ MCD::OPC_FilterValue, 252, 15, 4, 0, // Skip to: 176
116/* 172 */ MCD::OPC_Decode, 254, 3, 0, // Opcode: STSED_0R, DecodeIdx: 0
117/* 176 */ MCD::OPC_FilterValue, 253, 15, 4, 0, // Skip to: 185
118/* 181 */ MCD::OPC_Decode, 253, 3, 0, // Opcode: STET_0R, DecodeIdx: 0
119/* 185 */ MCD::OPC_FilterValue, 254, 15, 4, 0, // Skip to: 194
120/* 190 */ MCD::OPC_Decode, 131, 3, 0, // Opcode: GETED_0R, DecodeIdx: 0
121/* 194 */ MCD::OPC_FilterValue, 255, 15, 4, 0, // Skip to: 203
122/* 199 */ MCD::OPC_Decode, 132, 3, 0, // Opcode: GETET_0R, DecodeIdx: 0
123/* 203 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
124/* 206 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 214
125/* 210 */ MCD::OPC_Decode, 145, 4, 1, // Opcode: WAITET_1R, DecodeIdx: 1
126/* 214 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 222
127/* 218 */ MCD::OPC_Decode, 144, 4, 1, // Opcode: WAITEF_1R, DecodeIdx: 1
128/* 222 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
129/* 225 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 233
130/* 229 */ MCD::OPC_Decode, 145, 3, 2, // Opcode: INITDP_2r, DecodeIdx: 2
131/* 233 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 241
132/* 237 */ MCD::OPC_Decode, 216, 3, 4, // Opcode: OUTT_2r, DecodeIdx: 4
133/* 241 */ MCD::OPC_Decode, 196, 3, 3, // Opcode: LDW_2rus, DecodeIdx: 3
134/* 245 */ MCD::OPC_FilterValue, 2, 108, 0, // Skip to: 357
135/* 249 */ MCD::OPC_ExtractField, 0, 11, // Inst{10-0} ...
136/* 252 */ MCD::OPC_FilterValue, 236, 15, 4, 0, // Skip to: 261
137/* 257 */ MCD::OPC_Decode, 235, 2, 0, // Opcode: DENTSP_0R, DecodeIdx: 0
138/* 261 */ MCD::OPC_FilterValue, 237, 15, 4, 0, // Skip to: 270
139/* 266 */ MCD::OPC_Decode, 239, 2, 0, // Opcode: DRESTSP_0R, DecodeIdx: 0
140/* 270 */ MCD::OPC_FilterValue, 238, 15, 4, 0, // Skip to: 279
141/* 275 */ MCD::OPC_Decode, 133, 3, 0, // Opcode: GETID_0R, DecodeIdx: 0
142/* 279 */ MCD::OPC_FilterValue, 239, 15, 4, 0, // Skip to: 288
143/* 284 */ MCD::OPC_Decode, 134, 3, 0, // Opcode: GETKEP_0R, DecodeIdx: 0
144/* 288 */ MCD::OPC_FilterValue, 252, 15, 4, 0, // Skip to: 297
145/* 293 */ MCD::OPC_Decode, 135, 3, 0, // Opcode: GETKSP_0R, DecodeIdx: 0
146/* 297 */ MCD::OPC_FilterValue, 253, 15, 4, 0, // Skip to: 306
147/* 302 */ MCD::OPC_Decode, 185, 3, 0, // Opcode: LDSED_0R, DecodeIdx: 0
148/* 306 */ MCD::OPC_FilterValue, 254, 15, 4, 0, // Skip to: 315
149/* 311 */ MCD::OPC_Decode, 183, 3, 0, // Opcode: LDET_0R, DecodeIdx: 0
150/* 315 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
151/* 318 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 326
152/* 322 */ MCD::OPC_Decode, 128, 3, 1, // Opcode: FREER_1r, DecodeIdx: 1
153/* 326 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 334
154/* 330 */ MCD::OPC_Decode, 204, 3, 1, // Opcode: MJOIN_1r, DecodeIdx: 1
155/* 334 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
156/* 337 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 345
157/* 341 */ MCD::OPC_Decode, 148, 3, 2, // Opcode: INITSP_2r, DecodeIdx: 2
158/* 345 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 353
159/* 349 */ MCD::OPC_Decode, 229, 3, 4, // Opcode: SETD_2r, DecodeIdx: 4
160/* 353 */ MCD::OPC_Decode, 193, 2, 5, // Opcode: ADD_3r, DecodeIdx: 5
161/* 357 */ MCD::OPC_FilterValue, 3, 42, 0, // Skip to: 403
162/* 361 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
163/* 364 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 372
164/* 368 */ MCD::OPC_Decode, 143, 4, 1, // Opcode: TSTART_1R, DecodeIdx: 1
165/* 372 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 380
166/* 376 */ MCD::OPC_Decode, 207, 3, 1, // Opcode: MSYNC_1r, DecodeIdx: 1
167/* 380 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
168/* 383 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 391
169/* 387 */ MCD::OPC_Decode, 144, 3, 2, // Opcode: INITCP_2r, DecodeIdx: 2
170/* 391 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 399
171/* 395 */ MCD::OPC_Decode, 141, 4, 6, // Opcode: TSETMR_2r, DecodeIdx: 6
172/* 399 */ MCD::OPC_Decode, 136, 4, 5, // Opcode: SUB_3r, DecodeIdx: 5
173/* 403 */ MCD::OPC_FilterValue, 4, 33, 0, // Skip to: 440
174/* 407 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
175/* 410 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 418
176/* 414 */ MCD::OPC_Decode, 204, 2, 1, // Opcode: BLA_1r, DecodeIdx: 1
177/* 418 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 426
178/* 422 */ MCD::OPC_Decode, 198, 2, 1, // Opcode: BAU_1r, DecodeIdx: 1
179/* 426 */ MCD::OPC_CheckField, 4, 1, 1, 4, 0, // Skip to: 436
180/* 432 */ MCD::OPC_Decode, 245, 2, 2, // Opcode: EET_2r, DecodeIdx: 2
181/* 436 */ MCD::OPC_Decode, 247, 3, 5, // Opcode: SHL_3r, DecodeIdx: 5
182/* 440 */ MCD::OPC_FilterValue, 5, 42, 0, // Skip to: 486
183/* 444 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
184/* 447 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 455
185/* 451 */ MCD::OPC_Decode, 221, 2, 1, // Opcode: BRU_1r, DecodeIdx: 1
186/* 455 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 463
187/* 459 */ MCD::OPC_Decode, 237, 3, 1, // Opcode: SETSP_1r, DecodeIdx: 1
188/* 463 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
189/* 466 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 474
190/* 470 */ MCD::OPC_Decode, 194, 2, 7, // Opcode: ANDNOT_2r, DecodeIdx: 7
191/* 474 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 482
192/* 478 */ MCD::OPC_Decode, 244, 2, 2, // Opcode: EEF_2r, DecodeIdx: 2
193/* 482 */ MCD::OPC_Decode, 249, 3, 5, // Opcode: SHR_3r, DecodeIdx: 5
194/* 486 */ MCD::OPC_FilterValue, 6, 42, 0, // Skip to: 532
195/* 490 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
196/* 493 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 501
197/* 497 */ MCD::OPC_Decode, 228, 3, 1, // Opcode: SETDP_1r, DecodeIdx: 1
198/* 501 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 509
199/* 505 */ MCD::OPC_Decode, 224, 3, 1, // Opcode: SETCP_1r, DecodeIdx: 1
200/* 509 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
201/* 512 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 520
202/* 516 */ MCD::OPC_Decode, 244, 3, 7, // Opcode: SEXT_2r, DecodeIdx: 7
203/* 520 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 528
204/* 524 */ MCD::OPC_Decode, 245, 3, 8, // Opcode: SEXT_rus, DecodeIdx: 8
205/* 528 */ MCD::OPC_Decode, 251, 2, 5, // Opcode: EQ_3r, DecodeIdx: 5
206/* 532 */ MCD::OPC_FilterValue, 7, 42, 0, // Skip to: 578
207/* 536 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
208/* 539 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 547
209/* 543 */ MCD::OPC_Decode, 236, 2, 1, // Opcode: DGETREG_1r, DecodeIdx: 1
210/* 547 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 555
211/* 551 */ MCD::OPC_Decode, 230, 3, 1, // Opcode: SETEV_1r, DecodeIdx: 1
212/* 555 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
213/* 558 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 566
214/* 562 */ MCD::OPC_Decode, 142, 3, 2, // Opcode: GETTS_2r, DecodeIdx: 2
215/* 566 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 574
216/* 570 */ MCD::OPC_Decode, 235, 3, 4, // Opcode: SETPT_2r, DecodeIdx: 4
217/* 574 */ MCD::OPC_Decode, 195, 2, 5, // Opcode: AND_3r, DecodeIdx: 5
218/* 578 */ MCD::OPC_FilterValue, 8, 42, 0, // Skip to: 624
219/* 582 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
220/* 585 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 593
221/* 589 */ MCD::OPC_Decode, 153, 3, 1, // Opcode: KCALL_1r, DecodeIdx: 1
222/* 593 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 601
223/* 597 */ MCD::OPC_Decode, 243, 3, 1, // Opcode: SETV_1r, DecodeIdx: 1
224/* 601 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
225/* 604 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 612
226/* 608 */ MCD::OPC_Decode, 148, 4, 7, // Opcode: ZEXT_2r, DecodeIdx: 7
227/* 612 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 620
228/* 616 */ MCD::OPC_Decode, 149, 4, 8, // Opcode: ZEXT_rus, DecodeIdx: 8
229/* 620 */ MCD::OPC_Decode, 211, 3, 5, // Opcode: OR_3r, DecodeIdx: 5
230/* 624 */ MCD::OPC_FilterValue, 9, 42, 0, // Skip to: 670
231/* 628 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
232/* 631 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 639
233/* 635 */ MCD::OPC_Decode, 241, 2, 1, // Opcode: ECALLF_1r, DecodeIdx: 1
234/* 639 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 647
235/* 643 */ MCD::OPC_Decode, 242, 2, 1, // Opcode: ECALLT_1r, DecodeIdx: 1
236/* 647 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
237/* 650 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 658
238/* 654 */ MCD::OPC_Decode, 212, 3, 2, // Opcode: OUTCT_2r, DecodeIdx: 2
239/* 658 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 666
240/* 662 */ MCD::OPC_Decode, 213, 3, 9, // Opcode: OUTCT_rus, DecodeIdx: 9
241/* 666 */ MCD::OPC_Decode, 197, 3, 5, // Opcode: LDW_3r, DecodeIdx: 5
242/* 670 */ MCD::OPC_FilterValue, 10, 17, 0, // Skip to: 691
243/* 674 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
244/* 677 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 685
245/* 681 */ MCD::OPC_Decode, 130, 4, 10, // Opcode: STWDP_ru6, DecodeIdx: 10
246/* 685 */ MCD::OPC_FilterValueOrFail, 1,
247/* 687 */ MCD::OPC_Decode, 132, 4, 10, // Opcode: STWSP_ru6, DecodeIdx: 10
248/* 691 */ MCD::OPC_FilterValue, 11, 17, 0, // Skip to: 712
249/* 695 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
250/* 698 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 706
251/* 702 */ MCD::OPC_Decode, 193, 3, 10, // Opcode: LDWDP_ru6, DecodeIdx: 10
252/* 706 */ MCD::OPC_FilterValueOrFail, 1,
253/* 708 */ MCD::OPC_Decode, 195, 3, 10, // Opcode: LDWSP_ru6, DecodeIdx: 10
254/* 712 */ MCD::OPC_FilterValue, 12, 17, 0, // Skip to: 733
255/* 716 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
256/* 719 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 727
257/* 723 */ MCD::OPC_Decode, 176, 3, 10, // Opcode: LDAWDP_ru6, DecodeIdx: 10
258/* 727 */ MCD::OPC_FilterValueOrFail, 1,
259/* 729 */ MCD::OPC_Decode, 180, 3, 10, // Opcode: LDAWSP_ru6, DecodeIdx: 10
260/* 733 */ MCD::OPC_FilterValue, 13, 17, 0, // Skip to: 754
261/* 737 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
262/* 740 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 748
263/* 744 */ MCD::OPC_Decode, 182, 3, 10, // Opcode: LDC_ru6, DecodeIdx: 10
264/* 748 */ MCD::OPC_FilterValueOrFail, 1,
265/* 750 */ MCD::OPC_Decode, 190, 3, 10, // Opcode: LDWCP_ru6, DecodeIdx: 10
266/* 754 */ MCD::OPC_FilterValue, 14, 87, 0, // Skip to: 845
267/* 758 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
268/* 761 */ MCD::OPC_FilterValue, 0, 39, 0, // Skip to: 804
269/* 765 */ MCD::OPC_ExtractField, 6, 4, // Inst{9-6} ...
270/* 768 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 776
271/* 772 */ MCD::OPC_Decode, 220, 2, 11, // Opcode: BRFU_u6, DecodeIdx: 11
272/* 776 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 784
273/* 780 */ MCD::OPC_Decode, 203, 2, 11, // Opcode: BLAT_u6, DecodeIdx: 11
274/* 784 */ MCD::OPC_FilterValue, 14, 4, 0, // Skip to: 792
275/* 788 */ MCD::OPC_Decode, 253, 2, 11, // Opcode: EXTDP_u6, DecodeIdx: 11
276/* 792 */ MCD::OPC_FilterValue, 15, 4, 0, // Skip to: 800
277/* 796 */ MCD::OPC_Decode, 155, 3, 11, // Opcode: KCALL_u6, DecodeIdx: 11
278/* 800 */ MCD::OPC_Decode, 218, 2, 12, // Opcode: BRFT_ru6, DecodeIdx: 12
279/* 804 */ MCD::OPC_FilterValueOrFail, 1,
280/* 806 */ MCD::OPC_ExtractField, 6, 4, // Inst{9-6} ...
281/* 809 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 817
282/* 813 */ MCD::OPC_Decode, 214, 2, 13, // Opcode: BRBU_u6, DecodeIdx: 13
283/* 817 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 825
284/* 821 */ MCD::OPC_Decode, 249, 2, 11, // Opcode: ENTSP_u6, DecodeIdx: 11
285/* 825 */ MCD::OPC_FilterValue, 14, 4, 0, // Skip to: 833
286/* 829 */ MCD::OPC_Decode, 255, 2, 11, // Opcode: EXTSP_u6, DecodeIdx: 11
287/* 833 */ MCD::OPC_FilterValue, 15, 4, 0, // Skip to: 841
288/* 837 */ MCD::OPC_Decode, 222, 3, 11, // Opcode: RETSP_u6, DecodeIdx: 11
289/* 841 */ MCD::OPC_Decode, 212, 2, 14, // Opcode: BRBT_ru6, DecodeIdx: 14
290/* 845 */ MCD::OPC_FilterValue, 15, 71, 0, // Skip to: 920
291/* 849 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
292/* 852 */ MCD::OPC_FilterValue, 0, 39, 0, // Skip to: 895
293/* 856 */ MCD::OPC_ExtractField, 6, 4, // Inst{9-6} ...
294/* 859 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 867
295/* 863 */ MCD::OPC_Decode, 230, 2, 11, // Opcode: CLRSR_u6, DecodeIdx: 11
296/* 867 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 875
297/* 871 */ MCD::OPC_Decode, 241, 3, 11, // Opcode: SETSR_u6, DecodeIdx: 11
298/* 875 */ MCD::OPC_FilterValue, 14, 4, 0, // Skip to: 883
299/* 879 */ MCD::OPC_Decode, 157, 3, 11, // Opcode: KENTSP_u6, DecodeIdx: 11
300/* 883 */ MCD::OPC_FilterValue, 15, 4, 0, // Skip to: 891
301/* 887 */ MCD::OPC_Decode, 159, 3, 11, // Opcode: KRESTSP_u6, DecodeIdx: 11
302/* 891 */ MCD::OPC_Decode, 216, 2, 12, // Opcode: BRFF_ru6, DecodeIdx: 12
303/* 895 */ MCD::OPC_FilterValueOrFail, 1,
304/* 897 */ MCD::OPC_ExtractField, 6, 4, // Inst{9-6} ...
305/* 900 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 908
306/* 904 */ MCD::OPC_Decode, 140, 3, 11, // Opcode: GETSR_u6, DecodeIdx: 11
307/* 908 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 916
308/* 912 */ MCD::OPC_Decode, 174, 3, 11, // Opcode: LDAWCP_u6, DecodeIdx: 11
309/* 916 */ MCD::OPC_Decode, 210, 2, 14, // Opcode: BRBF_ru6, DecodeIdx: 14
310/* 920 */ MCD::OPC_FilterValue, 16, 42, 0, // Skip to: 966
311/* 924 */ MCD::OPC_ExtractField, 4, 7, // Inst{10-4} ...
312/* 927 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 935
313/* 931 */ MCD::OPC_Decode, 226, 2, 1, // Opcode: CLRPT_1R, DecodeIdx: 1
314/* 935 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 943
315/* 939 */ MCD::OPC_Decode, 137, 4, 1, // Opcode: SYNCR_1r, DecodeIdx: 1
316/* 943 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
317/* 946 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 954
318/* 950 */ MCD::OPC_Decode, 138, 3, 9, // Opcode: GETR_rus, DecodeIdx: 9
319/* 954 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 962
320/* 958 */ MCD::OPC_Decode, 143, 3, 2, // Opcode: INCT_2r, DecodeIdx: 2
321/* 962 */ MCD::OPC_Decode, 162, 3, 5, // Opcode: LD16S_3r, DecodeIdx: 5
322/* 966 */ MCD::OPC_FilterValue, 17, 23, 0, // Skip to: 993
323/* 970 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
324/* 973 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 981
325/* 977 */ MCD::OPC_Decode, 210, 3, 2, // Opcode: NOT, DecodeIdx: 2
326/* 981 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 989
327/* 985 */ MCD::OPC_Decode, 151, 3, 2, // Opcode: INT_2r, DecodeIdx: 2
328/* 989 */ MCD::OPC_Decode, 163, 3, 5, // Opcode: LD8U_3r, DecodeIdx: 5
329/* 993 */ MCD::OPC_FilterValue, 18, 23, 0, // Skip to: 1020
330/* 997 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
331/* 1000 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1008
332/* 1004 */ MCD::OPC_Decode, 209, 3, 2, // Opcode: NEG, DecodeIdx: 2
333/* 1008 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1016
334/* 1012 */ MCD::OPC_Decode, 247, 2, 2, // Opcode: ENDIN_2r, DecodeIdx: 2
335/* 1016 */ MCD::OPC_Decode, 192, 2, 3, // Opcode: ADD_2rus, DecodeIdx: 3
336/* 1020 */ MCD::OPC_FilterValue, 19, 4, 0, // Skip to: 1028
337/* 1024 */ MCD::OPC_Decode, 135, 4, 3, // Opcode: SUB_2rus, DecodeIdx: 3
338/* 1028 */ MCD::OPC_FilterValue, 20, 23, 0, // Skip to: 1055
339/* 1032 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
340/* 1035 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1043
341/* 1039 */ MCD::OPC_Decode, 205, 3, 2, // Opcode: MKMSK_2r, DecodeIdx: 2
342/* 1043 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1051
343/* 1047 */ MCD::OPC_Decode, 206, 3, 15, // Opcode: MKMSK_rus, DecodeIdx: 15
344/* 1051 */ MCD::OPC_Decode, 246, 3, 16, // Opcode: SHL_2rus, DecodeIdx: 16
345/* 1055 */ MCD::OPC_FilterValue, 21, 23, 0, // Skip to: 1082
346/* 1059 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
347/* 1062 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1070
348/* 1066 */ MCD::OPC_Decode, 217, 3, 4, // Opcode: OUT_2r, DecodeIdx: 4
349/* 1070 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1078
350/* 1074 */ MCD::OPC_Decode, 215, 3, 7, // Opcode: OUTSHR_2r, DecodeIdx: 7
351/* 1078 */ MCD::OPC_Decode, 248, 3, 16, // Opcode: SHR_2rus, DecodeIdx: 16
352/* 1082 */ MCD::OPC_FilterValue, 22, 23, 0, // Skip to: 1109
353/* 1086 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
354/* 1089 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1097
355/* 1093 */ MCD::OPC_Decode, 152, 3, 2, // Opcode: IN_2r, DecodeIdx: 2
356/* 1097 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1105
357/* 1101 */ MCD::OPC_Decode, 150, 3, 7, // Opcode: INSHR_2r, DecodeIdx: 7
358/* 1105 */ MCD::OPC_Decode, 250, 2, 3, // Opcode: EQ_2rus, DecodeIdx: 3
359/* 1109 */ MCD::OPC_FilterValue, 23, 23, 0, // Skip to: 1136
360/* 1113 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
361/* 1116 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1124
362/* 1120 */ MCD::OPC_Decode, 218, 3, 2, // Opcode: PEEK_2r, DecodeIdx: 2
363/* 1124 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1132
364/* 1128 */ MCD::OPC_Decode, 138, 4, 2, // Opcode: TESTCT_2r, DecodeIdx: 2
365/* 1132 */ MCD::OPC_Decode, 142, 4, 17, // Opcode: TSETR_3r, DecodeIdx: 17
366/* 1136 */ MCD::OPC_FilterValue, 24, 23, 0, // Skip to: 1163
367/* 1140 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
368/* 1143 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1151
369/* 1147 */ MCD::OPC_Decode, 233, 3, 4, // Opcode: SETPSC_2r, DecodeIdx: 4
370/* 1151 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1159
371/* 1155 */ MCD::OPC_Decode, 140, 4, 2, // Opcode: TESTWCT_2r, DecodeIdx: 2
372/* 1159 */ MCD::OPC_Decode, 199, 3, 5, // Opcode: LSS_3r, DecodeIdx: 5
373/* 1163 */ MCD::OPC_FilterValue, 25, 23, 0, // Skip to: 1190
374/* 1167 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
375/* 1170 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1178
376/* 1174 */ MCD::OPC_Decode, 223, 2, 2, // Opcode: CHKCT_2r, DecodeIdx: 2
377/* 1178 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 1186
378/* 1182 */ MCD::OPC_Decode, 224, 2, 15, // Opcode: CHKCT_rus, DecodeIdx: 15
379/* 1186 */ MCD::OPC_Decode, 201, 3, 5, // Opcode: LSU_3r, DecodeIdx: 5
380/* 1190 */ MCD::OPC_FilterValue, 26, 17, 0, // Skip to: 1211
381/* 1194 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
382/* 1197 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1205
383/* 1201 */ MCD::OPC_Decode, 208, 2, 18, // Opcode: BLRF_u10, DecodeIdx: 18
384/* 1205 */ MCD::OPC_FilterValueOrFail, 1,
385/* 1207 */ MCD::OPC_Decode, 206, 2, 19, // Opcode: BLRB_u10, DecodeIdx: 19
386/* 1211 */ MCD::OPC_FilterValue, 27, 17, 0, // Skip to: 1232
387/* 1215 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
388/* 1218 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1226
389/* 1222 */ MCD::OPC_Decode, 170, 3, 18, // Opcode: LDAPF_u10, DecodeIdx: 18
390/* 1226 */ MCD::OPC_FilterValueOrFail, 1,
391/* 1228 */ MCD::OPC_Decode, 167, 3, 19, // Opcode: LDAPB_u10, DecodeIdx: 19
392/* 1232 */ MCD::OPC_FilterValue, 28, 17, 0, // Skip to: 1253
393/* 1236 */ MCD::OPC_ExtractField, 10, 1, // Inst{10} ...
394/* 1239 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 1247
395/* 1243 */ MCD::OPC_Decode, 201, 2, 18, // Opcode: BLACP_u10, DecodeIdx: 18
396/* 1247 */ MCD::OPC_FilterValueOrFail, 1,
397/* 1249 */ MCD::OPC_Decode, 191, 3, 18, // Opcode: LDWCP_u10, DecodeIdx: 18
398/* 1253 */ MCD::OPC_FilterValueOrFail, 29,
399/* 1255 */ MCD::OPC_CheckFieldOrFail, 10, 1, 0,
400/* 1259 */ MCD::OPC_Decode, 227, 3, 12, // Opcode: SETC_ru6, DecodeIdx: 12
401/* 1263 */ MCD::OPC_Fail,
402 0
403};
404
405static const uint8_t DecoderTable32[] = {
406/* 0 */ MCD::OPC_ExtractField, 27, 5, // Inst{31-27} ...
407/* 3 */ MCD::OPC_FilterValue, 0, 91, 0, // Skip to: 98
408/* 7 */ MCD::OPC_ExtractField, 11, 5, // Inst{15-11} ...
409/* 10 */ MCD::OPC_FilterValueOrFail, 31,
410/* 12 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
411/* 15 */ MCD::OPC_FilterValue, 0, 11, 0, // Skip to: 30
412/* 19 */ MCD::OPC_CheckField, 16, 11, 236, 15, 19, 0, // Skip to: 45
413/* 26 */ MCD::OPC_Decode, 199, 2, 20, // Opcode: BITREV_l2r, DecodeIdx: 20
414/* 30 */ MCD::OPC_FilterValue, 1, 11, 0, // Skip to: 45
415/* 34 */ MCD::OPC_CheckField, 16, 11, 236, 15, 4, 0, // Skip to: 45
416/* 41 */ MCD::OPC_Decode, 222, 2, 20, // Opcode: BYTEREV_l2r, DecodeIdx: 20
417/* 45 */ MCD::OPC_CheckField, 16, 11, 236, 15, 4, 0, // Skip to: 56
418/* 52 */ MCD::OPC_Decode, 134, 4, 21, // Opcode: STW_l3r, DecodeIdx: 21
419/* 56 */ MCD::OPC_ExtractField, 20, 7, // Inst{26-20} ...
420/* 59 */ MCD::OPC_FilterValue, 126, 4, 0, // Skip to: 67
421/* 63 */ MCD::OPC_Decode, 232, 2, 22, // Opcode: CRC8_l4r, DecodeIdx: 22
422/* 67 */ MCD::OPC_FilterValue, 127, 4, 0, // Skip to: 75
423/* 71 */ MCD::OPC_Decode, 203, 3, 23, // Opcode: MACCU_l4r, DecodeIdx: 23
424/* 75 */ MCD::OPC_ExtractField, 20, 1, // Inst{20} ...
425/* 78 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 86
426/* 82 */ MCD::OPC_Decode, 184, 3, 24, // Opcode: LDIVU_l5r, DecodeIdx: 24
427/* 86 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 94
428/* 90 */ MCD::OPC_Decode, 161, 3, 24, // Opcode: LADD_l5r, DecodeIdx: 24
429/* 94 */ MCD::OPC_Decode, 198, 3, 25, // Opcode: LMUL_l6r, DecodeIdx: 25
430/* 98 */ MCD::OPC_FilterValue, 1, 83, 0, // Skip to: 185
431/* 102 */ MCD::OPC_ExtractField, 11, 5, // Inst{15-11} ...
432/* 105 */ MCD::OPC_FilterValueOrFail, 31,
433/* 107 */ MCD::OPC_ExtractField, 20, 1, // Inst{20} ...
434/* 110 */ MCD::OPC_FilterValueOrFail, 0,
435/* 112 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
436/* 115 */ MCD::OPC_FilterValue, 0, 16, 0, // Skip to: 135
437/* 119 */ MCD::OPC_CheckField, 21, 6, 63, 30, 0, // Skip to: 155
438/* 125 */ MCD::OPC_CheckField, 16, 4, 12, 24, 0, // Skip to: 155
439/* 131 */ MCD::OPC_Decode, 231, 2, 20, // Opcode: CLZ_l2r, DecodeIdx: 20
440/* 135 */ MCD::OPC_FilterValue, 1, 16, 0, // Skip to: 155
441/* 139 */ MCD::OPC_CheckField, 21, 6, 63, 10, 0, // Skip to: 155
442/* 145 */ MCD::OPC_CheckField, 16, 4, 12, 4, 0, // Skip to: 155
443/* 151 */ MCD::OPC_Decode, 223, 3, 26, // Opcode: SETCLK_l2r, DecodeIdx: 26
444/* 155 */ MCD::OPC_CheckField, 21, 6, 63, 10, 0, // Skip to: 171
445/* 161 */ MCD::OPC_CheckField, 16, 4, 12, 4, 0, // Skip to: 171
446/* 167 */ MCD::OPC_Decode, 147, 4, 21, // Opcode: XOR_l3r, DecodeIdx: 21
447/* 171 */ MCD::OPC_CheckField, 21, 6, 63, 4, 0, // Skip to: 181
448/* 177 */ MCD::OPC_Decode, 202, 3, 23, // Opcode: MACCS_l4r, DecodeIdx: 23
449/* 181 */ MCD::OPC_Decode, 200, 3, 24, // Opcode: LSUB_l5r, DecodeIdx: 24
450/* 185 */ MCD::OPC_FilterValue, 2, 30, 0, // Skip to: 219
451/* 189 */ MCD::OPC_ExtractField, 11, 16, // Inst{26-11} ...
452/* 192 */ MCD::OPC_FilterValueOrFail, 159, 251, 3,
453/* 196 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
454/* 199 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 207
455/* 203 */ MCD::OPC_Decode, 146, 3, 20, // Opcode: INITLR_l2r, DecodeIdx: 20
456/* 207 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 215
457/* 211 */ MCD::OPC_Decode, 137, 3, 20, // Opcode: GETPS_l2r, DecodeIdx: 20
458/* 215 */ MCD::OPC_Decode, 197, 2, 21, // Opcode: ASHR_l3r, DecodeIdx: 21
459/* 219 */ MCD::OPC_FilterValue, 3, 30, 0, // Skip to: 253
460/* 223 */ MCD::OPC_ExtractField, 11, 16, // Inst{26-11} ...
461/* 226 */ MCD::OPC_FilterValueOrFail, 159, 251, 3,
462/* 230 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
463/* 233 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 241
464/* 237 */ MCD::OPC_Decode, 234, 3, 26, // Opcode: SETPS_l2r, DecodeIdx: 26
465/* 241 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 249
466/* 245 */ MCD::OPC_Decode, 130, 3, 20, // Opcode: GETD_l2r, DecodeIdx: 20
467/* 249 */ MCD::OPC_Decode, 178, 3, 21, // Opcode: LDAWF_l3r, DecodeIdx: 21
468/* 253 */ MCD::OPC_FilterValue, 4, 30, 0, // Skip to: 287
469/* 257 */ MCD::OPC_ExtractField, 11, 16, // Inst{26-11} ...
470/* 260 */ MCD::OPC_FilterValueOrFail, 159, 251, 3,
471/* 264 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
472/* 267 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 275
473/* 271 */ MCD::OPC_Decode, 139, 4, 20, // Opcode: TESTLCL_l2r, DecodeIdx: 20
474/* 275 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 283
475/* 279 */ MCD::OPC_Decode, 242, 3, 26, // Opcode: SETTW_l2r, DecodeIdx: 26
476/* 283 */ MCD::OPC_Decode, 172, 3, 21, // Opcode: LDAWB_l3r, DecodeIdx: 21
477/* 287 */ MCD::OPC_FilterValue, 5, 30, 0, // Skip to: 321
478/* 291 */ MCD::OPC_ExtractField, 11, 16, // Inst{26-11} ...
479/* 294 */ MCD::OPC_FilterValueOrFail, 159, 251, 3,
480/* 298 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
481/* 301 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 309
482/* 305 */ MCD::OPC_Decode, 236, 3, 26, // Opcode: SETRDY_l2r, DecodeIdx: 26
483/* 309 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 317
484/* 313 */ MCD::OPC_Decode, 225, 3, 20, // Opcode: SETC_l2r, DecodeIdx: 20
485/* 317 */ MCD::OPC_Decode, 165, 3, 21, // Opcode: LDA16F_l3r, DecodeIdx: 21
486/* 321 */ MCD::OPC_FilterValue, 6, 30, 0, // Skip to: 355
487/* 325 */ MCD::OPC_ExtractField, 11, 16, // Inst{26-11} ...
488/* 328 */ MCD::OPC_FilterValueOrFail, 159, 251, 3,
489/* 332 */ MCD::OPC_ExtractField, 4, 1, // Inst{4} ...
490/* 335 */ MCD::OPC_FilterValue, 0, 4, 0, // Skip to: 343
491/* 339 */ MCD::OPC_Decode, 232, 3, 26, // Opcode: SETN_l2r, DecodeIdx: 26
492/* 343 */ MCD::OPC_FilterValue, 1, 4, 0, // Skip to: 351
493/* 347 */ MCD::OPC_Decode, 136, 3, 20, // Opcode: GETN_l2r, DecodeIdx: 20
494/* 351 */ MCD::OPC_Decode, 164, 3, 21, // Opcode: LDA16B_l3r, DecodeIdx: 21
495/* 355 */ MCD::OPC_FilterValue, 7, 10, 0, // Skip to: 369
496/* 359 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
497/* 365 */ MCD::OPC_Decode, 208, 3, 21, // Opcode: MUL_l3r, DecodeIdx: 21
498/* 369 */ MCD::OPC_FilterValue, 8, 10, 0, // Skip to: 383
499/* 373 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
500/* 379 */ MCD::OPC_Decode, 237, 2, 21, // Opcode: DIVS_l3r, DecodeIdx: 21
501/* 383 */ MCD::OPC_FilterValue, 9, 10, 0, // Skip to: 397
502/* 387 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
503/* 393 */ MCD::OPC_Decode, 238, 2, 21, // Opcode: DIVU_l3r, DecodeIdx: 21
504/* 397 */ MCD::OPC_FilterValue, 10, 25, 0, // Skip to: 426
505/* 401 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
506/* 404 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 416
507/* 408 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
508/* 412 */ MCD::OPC_Decode, 129, 4, 27, // Opcode: STWDP_lru6, DecodeIdx: 27
509/* 416 */ MCD::OPC_FilterValueOrFail, 1,
510/* 418 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
511/* 422 */ MCD::OPC_Decode, 131, 4, 27, // Opcode: STWSP_lru6, DecodeIdx: 27
512/* 426 */ MCD::OPC_FilterValue, 11, 25, 0, // Skip to: 455
513/* 430 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
514/* 433 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 445
515/* 437 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
516/* 441 */ MCD::OPC_Decode, 192, 3, 27, // Opcode: LDWDP_lru6, DecodeIdx: 27
517/* 445 */ MCD::OPC_FilterValueOrFail, 1,
518/* 447 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
519/* 451 */ MCD::OPC_Decode, 194, 3, 27, // Opcode: LDWSP_lru6, DecodeIdx: 27
520/* 455 */ MCD::OPC_FilterValue, 12, 25, 0, // Skip to: 484
521/* 459 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
522/* 462 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 474
523/* 466 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
524/* 470 */ MCD::OPC_Decode, 175, 3, 27, // Opcode: LDAWDP_lru6, DecodeIdx: 27
525/* 474 */ MCD::OPC_FilterValueOrFail, 1,
526/* 476 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
527/* 480 */ MCD::OPC_Decode, 179, 3, 27, // Opcode: LDAWSP_lru6, DecodeIdx: 27
528/* 484 */ MCD::OPC_FilterValue, 13, 25, 0, // Skip to: 513
529/* 488 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
530/* 491 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 503
531/* 495 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
532/* 499 */ MCD::OPC_Decode, 181, 3, 27, // Opcode: LDC_lru6, DecodeIdx: 27
533/* 503 */ MCD::OPC_FilterValueOrFail, 1,
534/* 505 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
535/* 509 */ MCD::OPC_Decode, 188, 3, 27, // Opcode: LDWCP_lru6, DecodeIdx: 27
536/* 513 */ MCD::OPC_FilterValue, 14, 97, 0, // Skip to: 614
537/* 517 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
538/* 520 */ MCD::OPC_FilterValue, 0, 44, 0, // Skip to: 568
539/* 524 */ MCD::OPC_ExtractField, 10, 6, // Inst{15-10} ...
540/* 527 */ MCD::OPC_FilterValueOrFail, 60,
541/* 529 */ MCD::OPC_ExtractField, 22, 4, // Inst{25-22} ...
542/* 532 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 540
543/* 536 */ MCD::OPC_Decode, 219, 2, 28, // Opcode: BRFU_lu6, DecodeIdx: 28
544/* 540 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 548
545/* 544 */ MCD::OPC_Decode, 202, 2, 28, // Opcode: BLAT_lu6, DecodeIdx: 28
546/* 548 */ MCD::OPC_FilterValue, 14, 4, 0, // Skip to: 556
547/* 552 */ MCD::OPC_Decode, 252, 2, 28, // Opcode: EXTDP_lu6, DecodeIdx: 28
548/* 556 */ MCD::OPC_FilterValue, 15, 4, 0, // Skip to: 564
549/* 560 */ MCD::OPC_Decode, 154, 3, 28, // Opcode: KCALL_lu6, DecodeIdx: 28
550/* 564 */ MCD::OPC_Decode, 217, 2, 29, // Opcode: BRFT_lru6, DecodeIdx: 29
551/* 568 */ MCD::OPC_FilterValueOrFail, 1,
552/* 570 */ MCD::OPC_ExtractField, 10, 6, // Inst{15-10} ...
553/* 573 */ MCD::OPC_FilterValueOrFail, 60,
554/* 575 */ MCD::OPC_ExtractField, 22, 4, // Inst{25-22} ...
555/* 578 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 586
556/* 582 */ MCD::OPC_Decode, 213, 2, 30, // Opcode: BRBU_lu6, DecodeIdx: 30
557/* 586 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 594
558/* 590 */ MCD::OPC_Decode, 248, 2, 28, // Opcode: ENTSP_lu6, DecodeIdx: 28
559/* 594 */ MCD::OPC_FilterValue, 14, 4, 0, // Skip to: 602
560/* 598 */ MCD::OPC_Decode, 254, 2, 28, // Opcode: EXTSP_lu6, DecodeIdx: 28
561/* 602 */ MCD::OPC_FilterValue, 15, 4, 0, // Skip to: 610
562/* 606 */ MCD::OPC_Decode, 221, 3, 28, // Opcode: RETSP_lu6, DecodeIdx: 28
563/* 610 */ MCD::OPC_Decode, 211, 2, 31, // Opcode: BRBT_lru6, DecodeIdx: 31
564/* 614 */ MCD::OPC_FilterValue, 15, 81, 0, // Skip to: 699
565/* 618 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
566/* 621 */ MCD::OPC_FilterValue, 0, 44, 0, // Skip to: 669
567/* 625 */ MCD::OPC_ExtractField, 10, 6, // Inst{15-10} ...
568/* 628 */ MCD::OPC_FilterValueOrFail, 60,
569/* 630 */ MCD::OPC_ExtractField, 22, 4, // Inst{25-22} ...
570/* 633 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 641
571/* 637 */ MCD::OPC_Decode, 229, 2, 28, // Opcode: CLRSR_lu6, DecodeIdx: 28
572/* 641 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 649
573/* 645 */ MCD::OPC_Decode, 240, 3, 28, // Opcode: SETSR_lu6, DecodeIdx: 28
574/* 649 */ MCD::OPC_FilterValue, 14, 4, 0, // Skip to: 657
575/* 653 */ MCD::OPC_Decode, 156, 3, 28, // Opcode: KENTSP_lu6, DecodeIdx: 28
576/* 657 */ MCD::OPC_FilterValue, 15, 4, 0, // Skip to: 665
577/* 661 */ MCD::OPC_Decode, 158, 3, 28, // Opcode: KRESTSP_lu6, DecodeIdx: 28
578/* 665 */ MCD::OPC_Decode, 215, 2, 29, // Opcode: BRFF_lru6, DecodeIdx: 29
579/* 669 */ MCD::OPC_FilterValueOrFail, 1,
580/* 671 */ MCD::OPC_ExtractField, 10, 6, // Inst{15-10} ...
581/* 674 */ MCD::OPC_FilterValueOrFail, 60,
582/* 676 */ MCD::OPC_ExtractField, 22, 4, // Inst{25-22} ...
583/* 679 */ MCD::OPC_FilterValue, 12, 4, 0, // Skip to: 687
584/* 683 */ MCD::OPC_Decode, 139, 3, 28, // Opcode: GETSR_lu6, DecodeIdx: 28
585/* 687 */ MCD::OPC_FilterValue, 13, 4, 0, // Skip to: 695
586/* 691 */ MCD::OPC_Decode, 173, 3, 28, // Opcode: LDAWCP_lu6, DecodeIdx: 28
587/* 695 */ MCD::OPC_Decode, 209, 2, 31, // Opcode: BRBF_lru6, DecodeIdx: 31
588/* 699 */ MCD::OPC_FilterValue, 16, 10, 0, // Skip to: 713
589/* 703 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
590/* 709 */ MCD::OPC_Decode, 251, 3, 21, // Opcode: ST16_l3r, DecodeIdx: 21
591/* 713 */ MCD::OPC_FilterValue, 17, 10, 0, // Skip to: 727
592/* 717 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
593/* 723 */ MCD::OPC_Decode, 252, 3, 21, // Opcode: ST8_l3r, DecodeIdx: 21
594/* 727 */ MCD::OPC_FilterValue, 18, 31, 0, // Skip to: 762
595/* 731 */ MCD::OPC_ExtractField, 11, 16, // Inst{26-11} ...
596/* 734 */ MCD::OPC_FilterValue, 159, 251, 3, 4, 0, // Skip to: 744
597/* 740 */ MCD::OPC_Decode, 196, 2, 32, // Opcode: ASHR_l2rus, DecodeIdx: 32
598/* 744 */ MCD::OPC_FilterValue, 191, 251, 3, 4, 0, // Skip to: 754
599/* 750 */ MCD::OPC_Decode, 214, 3, 32, // Opcode: OUTPW_l2rus, DecodeIdx: 32
600/* 754 */ MCD::OPC_FilterValueOrFail, 223, 251, 3,
601/* 758 */ MCD::OPC_Decode, 149, 3, 32, // Opcode: INPW_l2rus, DecodeIdx: 32
602/* 762 */ MCD::OPC_FilterValue, 19, 10, 0, // Skip to: 776
603/* 766 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
604/* 772 */ MCD::OPC_Decode, 177, 3, 33, // Opcode: LDAWF_l2rus, DecodeIdx: 33
605/* 776 */ MCD::OPC_FilterValue, 20, 10, 0, // Skip to: 790
606/* 780 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
607/* 786 */ MCD::OPC_Decode, 171, 3, 33, // Opcode: LDAWB_l2rus, DecodeIdx: 33
608/* 790 */ MCD::OPC_FilterValue, 21, 10, 0, // Skip to: 804
609/* 794 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
610/* 800 */ MCD::OPC_Decode, 233, 2, 34, // Opcode: CRC_l3r, DecodeIdx: 34
611/* 804 */ MCD::OPC_FilterValue, 24, 10, 0, // Skip to: 818
612/* 808 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
613/* 814 */ MCD::OPC_Decode, 219, 3, 21, // Opcode: REMS_l3r, DecodeIdx: 21
614/* 818 */ MCD::OPC_FilterValue, 25, 10, 0, // Skip to: 832
615/* 822 */ MCD::OPC_CheckFieldOrFail, 11, 16, 159, 251, 3,
616/* 828 */ MCD::OPC_Decode, 220, 3, 21, // Opcode: REMU_l3r, DecodeIdx: 21
617/* 832 */ MCD::OPC_FilterValue, 26, 25, 0, // Skip to: 861
618/* 836 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
619/* 839 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 851
620/* 843 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
621/* 847 */ MCD::OPC_Decode, 207, 2, 35, // Opcode: BLRF_lu10, DecodeIdx: 35
622/* 851 */ MCD::OPC_FilterValueOrFail, 1,
623/* 853 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
624/* 857 */ MCD::OPC_Decode, 205, 2, 36, // Opcode: BLRB_lu10, DecodeIdx: 36
625/* 861 */ MCD::OPC_FilterValue, 27, 25, 0, // Skip to: 890
626/* 865 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
627/* 868 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 880
628/* 872 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
629/* 876 */ MCD::OPC_Decode, 168, 3, 35, // Opcode: LDAPF_lu10, DecodeIdx: 35
630/* 880 */ MCD::OPC_FilterValueOrFail, 1,
631/* 882 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
632/* 886 */ MCD::OPC_Decode, 166, 3, 36, // Opcode: LDAPB_lu10, DecodeIdx: 36
633/* 890 */ MCD::OPC_FilterValue, 28, 25, 0, // Skip to: 919
634/* 894 */ MCD::OPC_ExtractField, 26, 1, // Inst{26} ...
635/* 897 */ MCD::OPC_FilterValue, 0, 8, 0, // Skip to: 909
636/* 901 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
637/* 905 */ MCD::OPC_Decode, 200, 2, 35, // Opcode: BLACP_lu10, DecodeIdx: 35
638/* 909 */ MCD::OPC_FilterValueOrFail, 1,
639/* 911 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
640/* 915 */ MCD::OPC_Decode, 189, 3, 35, // Opcode: LDWCP_lu10, DecodeIdx: 35
641/* 919 */ MCD::OPC_FilterValueOrFail, 29,
642/* 921 */ MCD::OPC_CheckFieldOrFail, 26, 1, 0,
643/* 925 */ MCD::OPC_CheckFieldOrFail, 10, 6, 60,
644/* 929 */ MCD::OPC_Decode, 226, 3, 29, // Opcode: SETC_lru6, DecodeIdx: 29
645/* 933 */ MCD::OPC_Fail,
646 0
647};
648
649// Handling 37 cases.
650template <typename InsnType>
651static DecodeStatus decodeToMCInst(unsigned Idx, DecodeStatus S, InsnType insn, MCInst &MI, uint64_t Address, const MCDisassembler *Decoder, bool &DecodeComplete) {
652 DecodeComplete = true;
653 using TmpType = std::conditional_t<std::is_integral<InsnType>::value, InsnType, uint64_t>;
654 TmpType tmp;
655 switch (Idx) {
656 default: llvm_unreachable("Invalid index!");
657 case 0:
658 return S;
659 case 1:
660 tmp = fieldFromInstruction(insn, 0, 4);
661 if (!Check(S, DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
662 return S;
663 case 2:
664 if (!Check(S, Decode2RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
665 return S;
666 case 3:
667 if (!Check(S, Decode2RUSInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
668 return S;
669 case 4:
670 if (!Check(S, DecodeR2RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
671 return S;
672 case 5:
673 if (!Check(S, Decode3RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
674 return S;
675 case 6:
676 if (!Check(S, Decode2RImmInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
677 return S;
678 case 7:
679 if (!Check(S, Decode2RSrcDstInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
680 return S;
681 case 8:
682 if (!Check(S, DecodeRUSSrcDstBitpInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
683 return S;
684 case 9:
685 if (!Check(S, DecodeRUSInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
686 return S;
687 case 10:
688 tmp = fieldFromInstruction(insn, 6, 4);
689 if (!Check(S, DecodeRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
690 tmp = fieldFromInstruction(insn, 0, 6);
691 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
692 return S;
693 case 11:
694 tmp = fieldFromInstruction(insn, 0, 6);
695 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
696 return S;
697 case 12:
698 tmp = fieldFromInstruction(insn, 6, 4);
699 if (!Check(S, DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
700 tmp = fieldFromInstruction(insn, 0, 6);
701 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
702 return S;
703 case 13:
704 tmp = fieldFromInstruction(insn, 0, 6);
705 if (!Check(S, DecodeNegImmOperand(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
706 return S;
707 case 14:
708 tmp = fieldFromInstruction(insn, 6, 4);
709 if (!Check(S, DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
710 tmp = fieldFromInstruction(insn, 0, 6);
711 if (!Check(S, DecodeNegImmOperand(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
712 return S;
713 case 15:
714 if (!Check(S, DecodeRUSBitpInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
715 return S;
716 case 16:
717 if (!Check(S, Decode2RUSBitpInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
718 return S;
719 case 17:
720 if (!Check(S, Decode3RImmInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
721 return S;
722 case 18:
723 tmp = fieldFromInstruction(insn, 0, 10);
724 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
725 return S;
726 case 19:
727 tmp = fieldFromInstruction(insn, 0, 10);
728 if (!Check(S, DecodeNegImmOperand(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
729 return S;
730 case 20:
731 if (!Check(S, DecodeL2RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
732 return S;
733 case 21:
734 if (!Check(S, DecodeL3RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
735 return S;
736 case 22:
737 if (!Check(S, DecodeL4RSrcDstInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
738 return S;
739 case 23:
740 if (!Check(S, DecodeL4RSrcDstSrcDstInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
741 return S;
742 case 24:
743 if (!Check(S, DecodeL5RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
744 return S;
745 case 25:
746 if (!Check(S, DecodeL6RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
747 return S;
748 case 26:
749 if (!Check(S, DecodeLR2RInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
750 return S;
751 case 27:
752 tmp = fieldFromInstruction(insn, 22, 4);
753 if (!Check(S, DecodeRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
754 tmp = 0x0;
755 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 6, 10);
756 insertBits(tmp, fieldFromInstruction(insn, 16, 6), 0, 6);
757 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
758 return S;
759 case 28:
760 tmp = 0x0;
761 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 6, 10);
762 insertBits(tmp, fieldFromInstruction(insn, 16, 6), 0, 6);
763 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
764 return S;
765 case 29:
766 tmp = fieldFromInstruction(insn, 22, 4);
767 if (!Check(S, DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
768 tmp = 0x0;
769 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 6, 10);
770 insertBits(tmp, fieldFromInstruction(insn, 16, 6), 0, 6);
771 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
772 return S;
773 case 30:
774 tmp = 0x0;
775 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 6, 10);
776 insertBits(tmp, fieldFromInstruction(insn, 16, 6), 0, 6);
777 if (!Check(S, DecodeNegImmOperand(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
778 return S;
779 case 31:
780 tmp = fieldFromInstruction(insn, 22, 4);
781 if (!Check(S, DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
782 tmp = 0x0;
783 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 6, 10);
784 insertBits(tmp, fieldFromInstruction(insn, 16, 6), 0, 6);
785 if (!Check(S, DecodeNegImmOperand(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
786 return S;
787 case 32:
788 if (!Check(S, DecodeL2RUSBitpInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
789 return S;
790 case 33:
791 if (!Check(S, DecodeL2RUSInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
792 return S;
793 case 34:
794 if (!Check(S, DecodeL3RSrcDstInstruction(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; }
795 return S;
796 case 35:
797 tmp = 0x0;
798 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 10, 10);
799 insertBits(tmp, fieldFromInstruction(insn, 16, 10), 0, 10);
800 MI.addOperand(Op: MCOperand::createImm(Val: tmp));
801 return S;
802 case 36:
803 tmp = 0x0;
804 insertBits(tmp, fieldFromInstruction(insn, 0, 10), 10, 10);
805 insertBits(tmp, fieldFromInstruction(insn, 16, 10), 0, 10);
806 if (!Check(S, DecodeNegImmOperand(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; }
807 return S;
808 }
809}
810
811static unsigned decodeNumToSkip(const uint8_t *&Ptr) {
812 unsigned NumToSkip = *Ptr++;
813 NumToSkip |= (*Ptr++) << 8;
814 return NumToSkip;
815}
816
817template <typename InsnType>
818static DecodeStatus decodeInstruction(const uint8_t DecodeTable[], MCInst &MI,
819 InsnType insn, uint64_t Address,
820 const MCDisassembler *DisAsm,
821 const MCSubtargetInfo &STI) {
822
823 const uint8_t *Ptr = DecodeTable;
824 uint64_t CurFieldValue = 0;
825 DecodeStatus S = MCDisassembler::Success;
826 while (true) {
827 ptrdiff_t Loc = Ptr - DecodeTable;
828 const uint8_t DecoderOp = *Ptr++;
829 switch (DecoderOp) {
830 default:
831 errs() << Loc << ": Unexpected decode table opcode: "
832 << (int)DecoderOp << '\n';
833 return MCDisassembler::Fail;
834 case MCD::OPC_ExtractField: {
835 // Decode the start value.
836 unsigned Start = decodeULEB128AndIncUnsafe(p&: Ptr);
837 unsigned Len = *Ptr++;
838 CurFieldValue = fieldFromInstruction(insn, Start, Len);
839 LLVM_DEBUG(dbgs() << Loc << ": OPC_ExtractField(" << Start << ", "
840 << Len << "): " << CurFieldValue << "\n");
841 break;
842 }
843 case MCD::OPC_FilterValue:
844 case MCD::OPC_FilterValueOrFail: {
845 bool IsFail = DecoderOp == MCD::OPC_FilterValueOrFail;
846 // Decode the field value.
847 uint64_t Val = decodeULEB128AndIncUnsafe(p&: Ptr);
848 bool Failed = Val != CurFieldValue;
849 unsigned NumToSkip = IsFail ? 0 : decodeNumToSkip(Ptr);
850
851 // Note: Print NumToSkip even for OPC_FilterValueOrFail to simplify debug
852 // prints.
853 LLVM_DEBUG({
854 StringRef OpName = IsFail ? "OPC_FilterValueOrFail" : "OPC_FilterValue";
855 dbgs() << Loc << ": " << OpName << '(' << Val << ", " << NumToSkip
856 << ") " << (Failed ? "FAIL:" : "PASS:")
857 << " continuing at " << (Ptr - DecodeTable) << '\n';
858 });
859
860 // Perform the filter operation.
861 if (Failed) {
862 if (IsFail)
863 return MCDisassembler::Fail;
864 Ptr += NumToSkip;
865 }
866 break;
867 }
868 case MCD::OPC_CheckField:
869 case MCD::OPC_CheckFieldOrFail: {
870 bool IsFail = DecoderOp == MCD::OPC_CheckFieldOrFail;
871 // Decode the start value.
872 unsigned Start = decodeULEB128AndIncUnsafe(p&: Ptr);
873 unsigned Len = *Ptr;
874 uint64_t FieldValue = fieldFromInstruction(insn, Start, Len);
875 // Decode the field value.
876 unsigned PtrLen = 0;
877 uint64_t ExpectedValue = decodeULEB128(p: ++Ptr, n: &PtrLen);
878 Ptr += PtrLen;
879 bool Failed = ExpectedValue != FieldValue;
880 unsigned NumToSkip = IsFail ? 0 : decodeNumToSkip(Ptr);
881
882 LLVM_DEBUG({
883 StringRef OpName = IsFail ? "OPC_CheckFieldOrFail" : "OPC_CheckField";
884 dbgs() << Loc << ": " << OpName << '(' << Start << ", " << Len << ", "
885 << ExpectedValue << ", " << NumToSkip << "): FieldValue = "
886 << FieldValue << ", ExpectedValue = " << ExpectedValue << ": "
887 << (Failed ? "FAIL\n" : "PASS\n");
888 });
889
890 // If the actual and expected values don't match, skip or fail.
891 if (Failed) {
892 if (IsFail)
893 return MCDisassembler::Fail;
894 Ptr += NumToSkip;
895 }
896 break;
897 }
898 case MCD::OPC_Decode: {
899 // Decode the Opcode value.
900 unsigned Opc = decodeULEB128AndIncUnsafe(p&: Ptr);
901 unsigned DecodeIdx = decodeULEB128AndIncUnsafe(p&: Ptr);
902
903 MI.clear();
904 MI.setOpcode(Opc);
905 bool DecodeComplete;
906 S = decodeToMCInst(DecodeIdx, S, insn, MI, Address, DisAsm, DecodeComplete);
907 assert(DecodeComplete);
908
909 LLVM_DEBUG(dbgs() << Loc << ": OPC_Decode: opcode " << Opc
910 << ", using decoder " << DecodeIdx << ": "
911 << (S != MCDisassembler::Fail ? "PASS\n" : "FAIL\n"));
912 return S;
913 }
914 case MCD::OPC_Fail: {
915 LLVM_DEBUG(dbgs() << Loc << ": OPC_Fail\n");
916 return MCDisassembler::Fail;
917 }
918 }
919 }
920 llvm_unreachable("bogosity detected in disassembler state machine!");
921}
922
923
924} // namespace
925