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