1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
2 | |* *| |
3 | |* Assembly Writer Source Fragment *| |
4 | |* *| |
5 | |* Automatically generated file, do not edit! *| |
6 | |* From: Lanai.td *| |
7 | |* *| |
8 | \*===----------------------------------------------------------------------===*/ |
9 | |
10 | /// getMnemonic - This method is automatically generated by tablegen |
11 | /// from the instruction set description. |
12 | std::pair<const char *, uint64_t> LanaiInstPrinter::getMnemonic(const MCInst *MI) { |
13 | |
14 | #ifdef __GNUC__ |
15 | #pragma GCC diagnostic push |
16 | #pragma GCC diagnostic ignored "-Woverlength-strings" |
17 | #endif |
18 | static const char AsmStrs[] = { |
19 | /* 0 */ "sha\t\0" |
20 | /* 5 */ "uld.b\t\0" |
21 | /* 12 */ "st.b\t\0" |
22 | /* 18 */ "subb\t\0" |
23 | /* 24 */ "sub\t\0" |
24 | /* 29 */ "addc\t\0" |
25 | /* 35 */ "popc\t\0" |
26 | /* 41 */ "add\t\0" |
27 | /* 46 */ "uld\t\0" |
28 | /* 51 */ "and\t\0" |
29 | /* 56 */ "sha.f\t\0" |
30 | /* 63 */ "subb.f\t\0" |
31 | /* 71 */ "sub.f\t\0" |
32 | /* 78 */ "addc.f\t\0" |
33 | /* 86 */ "add.f\t\0" |
34 | /* 93 */ "and.f\t\0" |
35 | /* 100 */ "sh.f\t\0" |
36 | /* 106 */ "xor.f\t\0" |
37 | /* 113 */ "uld.h\t\0" |
38 | /* 120 */ "st.h\t\0" |
39 | /* 126 */ "sh\t\0" |
40 | /* 130 */ "xor\t\0" |
41 | /* 135 */ "bt\t\0" |
42 | /* 139 */ "st\t\0" |
43 | /* 143 */ "mov\t\0" |
44 | /* 148 */ "leadz\t\0" |
45 | /* 155 */ "trailz\t\0" |
46 | /* 163 */ "#ADJDYNALLOC \0" |
47 | /* 177 */ "#ADJCALLSTACKDOWN \0" |
48 | /* 196 */ "#ADJCALLSTACKUP \0" |
49 | /* 213 */ "# XRay Function Patchable RET.\0" |
50 | /* 244 */ "# XRay Typed Event Log.\0" |
51 | /* 268 */ "# XRay Custom Event Log.\0" |
52 | /* 293 */ "sel.\0" |
53 | /* 298 */ "# XRay Function Enter.\0" |
54 | /* 321 */ "# XRay Tail Call Exit.\0" |
55 | /* 344 */ "# XRay Function Exit.\0" |
56 | /* 366 */ "log_0\0" |
57 | /* 372 */ "log_1\0" |
58 | /* 378 */ "log_2\0" |
59 | /* 384 */ "log_3\0" |
60 | /* 390 */ "log_4\0" |
61 | /* 396 */ "LIFETIME_END\0" |
62 | /* 409 */ "PSEUDO_PROBE\0" |
63 | /* 422 */ "BUNDLE\0" |
64 | /* 429 */ "DBG_VALUE\0" |
65 | /* 439 */ "DBG_INSTR_REF\0" |
66 | /* 453 */ "DBG_PHI\0" |
67 | /* 461 */ "DBG_LABEL\0" |
68 | /* 471 */ "LIFETIME_START\0" |
69 | /* 486 */ "DBG_VALUE_LIST\0" |
70 | /* 501 */ "sha\0" |
71 | /* 505 */ "subb\0" |
72 | /* 510 */ "sub\0" |
73 | /* 514 */ "addc\0" |
74 | /* 519 */ "add\0" |
75 | /* 523 */ "and\0" |
76 | /* 527 */ "sha.f\0" |
77 | /* 533 */ "subb.f\0" |
78 | /* 540 */ "sub.f\0" |
79 | /* 546 */ "addc.f\0" |
80 | /* 553 */ "add.f\0" |
81 | /* 559 */ "and.f\0" |
82 | /* 565 */ "sh.f\0" |
83 | /* 570 */ "xor.f\0" |
84 | /* 576 */ "sh\0" |
85 | /* 579 */ "# FEntry call\0" |
86 | /* 593 */ "ld\t-4[%fp], %pc ! return\0" |
87 | /* 618 */ "nop\0" |
88 | /* 622 */ "xor\0" |
89 | /* 626 */ "s\0" |
90 | }; |
91 | #ifdef __GNUC__ |
92 | #pragma GCC diagnostic pop |
93 | #endif |
94 | |
95 | static const uint16_t OpInfo0[] = { |
96 | 0U, // PHI |
97 | 0U, // INLINEASM |
98 | 0U, // INLINEASM_BR |
99 | 0U, // CFI_INSTRUCTION |
100 | 0U, // EH_LABEL |
101 | 0U, // GC_LABEL |
102 | 0U, // ANNOTATION_LABEL |
103 | 0U, // KILL |
104 | 0U, // EXTRACT_SUBREG |
105 | 0U, // INSERT_SUBREG |
106 | 0U, // IMPLICIT_DEF |
107 | 0U, // SUBREG_TO_REG |
108 | 0U, // COPY_TO_REGCLASS |
109 | 430U, // DBG_VALUE |
110 | 487U, // DBG_VALUE_LIST |
111 | 440U, // DBG_INSTR_REF |
112 | 454U, // DBG_PHI |
113 | 462U, // DBG_LABEL |
114 | 0U, // REG_SEQUENCE |
115 | 0U, // COPY |
116 | 423U, // BUNDLE |
117 | 472U, // LIFETIME_START |
118 | 397U, // LIFETIME_END |
119 | 410U, // PSEUDO_PROBE |
120 | 0U, // ARITH_FENCE |
121 | 0U, // STACKMAP |
122 | 580U, // FENTRY_CALL |
123 | 0U, // PATCHPOINT |
124 | 0U, // LOAD_STACK_GUARD |
125 | 0U, // PREALLOCATED_SETUP |
126 | 0U, // PREALLOCATED_ARG |
127 | 0U, // STATEPOINT |
128 | 0U, // LOCAL_ESCAPE |
129 | 0U, // FAULTING_OP |
130 | 0U, // PATCHABLE_OP |
131 | 299U, // PATCHABLE_FUNCTION_ENTER |
132 | 214U, // PATCHABLE_RET |
133 | 345U, // PATCHABLE_FUNCTION_EXIT |
134 | 322U, // PATCHABLE_TAIL_CALL |
135 | 269U, // PATCHABLE_EVENT_CALL |
136 | 245U, // PATCHABLE_TYPED_EVENT_CALL |
137 | 0U, // ICALL_BRANCH_FUNNEL |
138 | 0U, // MEMBARRIER |
139 | 0U, // JUMP_TABLE_DEBUG_INFO |
140 | 0U, // CONVERGENCECTRL_ENTRY |
141 | 0U, // CONVERGENCECTRL_ANCHOR |
142 | 0U, // CONVERGENCECTRL_LOOP |
143 | 0U, // CONVERGENCECTRL_GLUE |
144 | 0U, // G_ASSERT_SEXT |
145 | 0U, // G_ASSERT_ZEXT |
146 | 0U, // G_ASSERT_ALIGN |
147 | 0U, // G_ADD |
148 | 0U, // G_SUB |
149 | 0U, // G_MUL |
150 | 0U, // G_SDIV |
151 | 0U, // G_UDIV |
152 | 0U, // G_SREM |
153 | 0U, // G_UREM |
154 | 0U, // G_SDIVREM |
155 | 0U, // G_UDIVREM |
156 | 0U, // G_AND |
157 | 0U, // G_OR |
158 | 0U, // G_XOR |
159 | 0U, // G_IMPLICIT_DEF |
160 | 0U, // G_PHI |
161 | 0U, // G_FRAME_INDEX |
162 | 0U, // G_GLOBAL_VALUE |
163 | 0U, // G_PTRAUTH_GLOBAL_VALUE |
164 | 0U, // G_CONSTANT_POOL |
165 | 0U, // G_EXTRACT |
166 | 0U, // G_UNMERGE_VALUES |
167 | 0U, // G_INSERT |
168 | 0U, // G_MERGE_VALUES |
169 | 0U, // G_BUILD_VECTOR |
170 | 0U, // G_BUILD_VECTOR_TRUNC |
171 | 0U, // G_CONCAT_VECTORS |
172 | 0U, // G_PTRTOINT |
173 | 0U, // G_INTTOPTR |
174 | 0U, // G_BITCAST |
175 | 0U, // G_FREEZE |
176 | 0U, // G_CONSTANT_FOLD_BARRIER |
177 | 0U, // G_INTRINSIC_FPTRUNC_ROUND |
178 | 0U, // G_INTRINSIC_TRUNC |
179 | 0U, // G_INTRINSIC_ROUND |
180 | 0U, // G_INTRINSIC_LRINT |
181 | 0U, // G_INTRINSIC_LLRINT |
182 | 0U, // G_INTRINSIC_ROUNDEVEN |
183 | 0U, // G_READCYCLECOUNTER |
184 | 0U, // G_READSTEADYCOUNTER |
185 | 0U, // G_LOAD |
186 | 0U, // G_SEXTLOAD |
187 | 0U, // G_ZEXTLOAD |
188 | 0U, // G_INDEXED_LOAD |
189 | 0U, // G_INDEXED_SEXTLOAD |
190 | 0U, // G_INDEXED_ZEXTLOAD |
191 | 0U, // G_STORE |
192 | 0U, // G_INDEXED_STORE |
193 | 0U, // G_ATOMIC_CMPXCHG_WITH_SUCCESS |
194 | 0U, // G_ATOMIC_CMPXCHG |
195 | 0U, // G_ATOMICRMW_XCHG |
196 | 0U, // G_ATOMICRMW_ADD |
197 | 0U, // G_ATOMICRMW_SUB |
198 | 0U, // G_ATOMICRMW_AND |
199 | 0U, // G_ATOMICRMW_NAND |
200 | 0U, // G_ATOMICRMW_OR |
201 | 0U, // G_ATOMICRMW_XOR |
202 | 0U, // G_ATOMICRMW_MAX |
203 | 0U, // G_ATOMICRMW_MIN |
204 | 0U, // G_ATOMICRMW_UMAX |
205 | 0U, // G_ATOMICRMW_UMIN |
206 | 0U, // G_ATOMICRMW_FADD |
207 | 0U, // G_ATOMICRMW_FSUB |
208 | 0U, // G_ATOMICRMW_FMAX |
209 | 0U, // G_ATOMICRMW_FMIN |
210 | 0U, // G_ATOMICRMW_UINC_WRAP |
211 | 0U, // G_ATOMICRMW_UDEC_WRAP |
212 | 0U, // G_FENCE |
213 | 0U, // G_PREFETCH |
214 | 0U, // G_BRCOND |
215 | 0U, // G_BRINDIRECT |
216 | 0U, // G_INVOKE_REGION_START |
217 | 0U, // G_INTRINSIC |
218 | 0U, // G_INTRINSIC_W_SIDE_EFFECTS |
219 | 0U, // G_INTRINSIC_CONVERGENT |
220 | 0U, // G_INTRINSIC_CONVERGENT_W_SIDE_EFFECTS |
221 | 0U, // G_ANYEXT |
222 | 0U, // G_TRUNC |
223 | 0U, // G_CONSTANT |
224 | 0U, // G_FCONSTANT |
225 | 0U, // G_VASTART |
226 | 0U, // G_VAARG |
227 | 0U, // G_SEXT |
228 | 0U, // G_SEXT_INREG |
229 | 0U, // G_ZEXT |
230 | 0U, // G_SHL |
231 | 0U, // G_LSHR |
232 | 0U, // G_ASHR |
233 | 0U, // G_FSHL |
234 | 0U, // G_FSHR |
235 | 0U, // G_ROTR |
236 | 0U, // G_ROTL |
237 | 0U, // G_ICMP |
238 | 0U, // G_FCMP |
239 | 0U, // G_SCMP |
240 | 0U, // G_UCMP |
241 | 0U, // G_SELECT |
242 | 0U, // G_UADDO |
243 | 0U, // G_UADDE |
244 | 0U, // G_USUBO |
245 | 0U, // G_USUBE |
246 | 0U, // G_SADDO |
247 | 0U, // G_SADDE |
248 | 0U, // G_SSUBO |
249 | 0U, // G_SSUBE |
250 | 0U, // G_UMULO |
251 | 0U, // G_SMULO |
252 | 0U, // G_UMULH |
253 | 0U, // G_SMULH |
254 | 0U, // G_UADDSAT |
255 | 0U, // G_SADDSAT |
256 | 0U, // G_USUBSAT |
257 | 0U, // G_SSUBSAT |
258 | 0U, // G_USHLSAT |
259 | 0U, // G_SSHLSAT |
260 | 0U, // G_SMULFIX |
261 | 0U, // G_UMULFIX |
262 | 0U, // G_SMULFIXSAT |
263 | 0U, // G_UMULFIXSAT |
264 | 0U, // G_SDIVFIX |
265 | 0U, // G_UDIVFIX |
266 | 0U, // G_SDIVFIXSAT |
267 | 0U, // G_UDIVFIXSAT |
268 | 0U, // G_FADD |
269 | 0U, // G_FSUB |
270 | 0U, // G_FMUL |
271 | 0U, // G_FMA |
272 | 0U, // G_FMAD |
273 | 0U, // G_FDIV |
274 | 0U, // G_FREM |
275 | 0U, // G_FPOW |
276 | 0U, // G_FPOWI |
277 | 0U, // G_FEXP |
278 | 0U, // G_FEXP2 |
279 | 0U, // G_FEXP10 |
280 | 0U, // G_FLOG |
281 | 0U, // G_FLOG2 |
282 | 0U, // G_FLOG10 |
283 | 0U, // G_FLDEXP |
284 | 0U, // G_FFREXP |
285 | 0U, // G_FNEG |
286 | 0U, // G_FPEXT |
287 | 0U, // G_FPTRUNC |
288 | 0U, // G_FPTOSI |
289 | 0U, // G_FPTOUI |
290 | 0U, // G_SITOFP |
291 | 0U, // G_UITOFP |
292 | 0U, // G_FABS |
293 | 0U, // G_FCOPYSIGN |
294 | 0U, // G_IS_FPCLASS |
295 | 0U, // G_FCANONICALIZE |
296 | 0U, // G_FMINNUM |
297 | 0U, // G_FMAXNUM |
298 | 0U, // G_FMINNUM_IEEE |
299 | 0U, // G_FMAXNUM_IEEE |
300 | 0U, // G_FMINIMUM |
301 | 0U, // G_FMAXIMUM |
302 | 0U, // G_GET_FPENV |
303 | 0U, // G_SET_FPENV |
304 | 0U, // G_RESET_FPENV |
305 | 0U, // G_GET_FPMODE |
306 | 0U, // G_SET_FPMODE |
307 | 0U, // G_RESET_FPMODE |
308 | 0U, // G_PTR_ADD |
309 | 0U, // G_PTRMASK |
310 | 0U, // G_SMIN |
311 | 0U, // G_SMAX |
312 | 0U, // G_UMIN |
313 | 0U, // G_UMAX |
314 | 0U, // G_ABS |
315 | 0U, // G_LROUND |
316 | 0U, // G_LLROUND |
317 | 0U, // G_BR |
318 | 0U, // G_BRJT |
319 | 0U, // G_VSCALE |
320 | 0U, // G_INSERT_SUBVECTOR |
321 | 0U, // G_EXTRACT_SUBVECTOR |
322 | 0U, // G_INSERT_VECTOR_ELT |
323 | 0U, // G_EXTRACT_VECTOR_ELT |
324 | 0U, // G_SHUFFLE_VECTOR |
325 | 0U, // G_SPLAT_VECTOR |
326 | 0U, // G_VECTOR_COMPRESS |
327 | 0U, // G_CTTZ |
328 | 0U, // G_CTTZ_ZERO_UNDEF |
329 | 0U, // G_CTLZ |
330 | 0U, // G_CTLZ_ZERO_UNDEF |
331 | 0U, // G_CTPOP |
332 | 0U, // G_BSWAP |
333 | 0U, // G_BITREVERSE |
334 | 0U, // G_FCEIL |
335 | 0U, // G_FCOS |
336 | 0U, // G_FSIN |
337 | 0U, // G_FTAN |
338 | 0U, // G_FACOS |
339 | 0U, // G_FASIN |
340 | 0U, // G_FATAN |
341 | 0U, // G_FCOSH |
342 | 0U, // G_FSINH |
343 | 0U, // G_FTANH |
344 | 0U, // G_FSQRT |
345 | 0U, // G_FFLOOR |
346 | 0U, // G_FRINT |
347 | 0U, // G_FNEARBYINT |
348 | 0U, // G_ADDRSPACE_CAST |
349 | 0U, // G_BLOCK_ADDR |
350 | 0U, // G_JUMP_TABLE |
351 | 0U, // G_DYN_STACKALLOC |
352 | 0U, // G_STACKSAVE |
353 | 0U, // G_STACKRESTORE |
354 | 0U, // G_STRICT_FADD |
355 | 0U, // G_STRICT_FSUB |
356 | 0U, // G_STRICT_FMUL |
357 | 0U, // G_STRICT_FDIV |
358 | 0U, // G_STRICT_FREM |
359 | 0U, // G_STRICT_FMA |
360 | 0U, // G_STRICT_FSQRT |
361 | 0U, // G_STRICT_FLDEXP |
362 | 0U, // G_READ_REGISTER |
363 | 0U, // G_WRITE_REGISTER |
364 | 0U, // G_MEMCPY |
365 | 0U, // G_MEMCPY_INLINE |
366 | 0U, // G_MEMMOVE |
367 | 0U, // G_MEMSET |
368 | 0U, // G_BZERO |
369 | 0U, // G_TRAP |
370 | 0U, // G_DEBUGTRAP |
371 | 0U, // G_UBSANTRAP |
372 | 0U, // G_VECREDUCE_SEQ_FADD |
373 | 0U, // G_VECREDUCE_SEQ_FMUL |
374 | 0U, // G_VECREDUCE_FADD |
375 | 0U, // G_VECREDUCE_FMUL |
376 | 0U, // G_VECREDUCE_FMAX |
377 | 0U, // G_VECREDUCE_FMIN |
378 | 0U, // G_VECREDUCE_FMAXIMUM |
379 | 0U, // G_VECREDUCE_FMINIMUM |
380 | 0U, // G_VECREDUCE_ADD |
381 | 0U, // G_VECREDUCE_MUL |
382 | 0U, // G_VECREDUCE_AND |
383 | 0U, // G_VECREDUCE_OR |
384 | 0U, // G_VECREDUCE_XOR |
385 | 0U, // G_VECREDUCE_SMAX |
386 | 0U, // G_VECREDUCE_SMIN |
387 | 0U, // G_VECREDUCE_UMAX |
388 | 0U, // G_VECREDUCE_UMIN |
389 | 0U, // G_SBFX |
390 | 0U, // G_UBFX |
391 | 1202U, // ADJCALLSTACKDOWN |
392 | 1221U, // ADJCALLSTACKUP |
393 | 1188U, // ADJDYNALLOC |
394 | 0U, // CALL |
395 | 0U, // CALLR |
396 | 18511U, // ADDC_F_I_HI |
397 | 34895U, // ADDC_F_I_LO |
398 | 3619U, // ADDC_F_R |
399 | 18462U, // ADDC_I_HI |
400 | 34846U, // ADDC_I_LO |
401 | 3587U, // ADDC_R |
402 | 18519U, // ADD_F_I_HI |
403 | 34903U, // ADD_F_I_LO |
404 | 3626U, // ADD_F_R |
405 | 18474U, // ADD_I_HI |
406 | 34858U, // ADD_I_LO |
407 | 3592U, // ADD_R |
408 | 51294U, // AND_F_I_HI |
409 | 2142U, // AND_F_I_LO |
410 | 3632U, // AND_F_R |
411 | 51252U, // AND_I_HI |
412 | 2100U, // AND_I_LO |
413 | 3596U, // AND_R |
414 | 20989U, // BRCC |
415 | 20989U, // BRIND_CC |
416 | 5629U, // BRIND_CCA |
417 | 37373U, // BRR |
418 | 50312U, // BT |
419 | 50312U, // JR |
420 | 6192U, // LDADDR |
421 | 7175U, // LDBs_RI |
422 | 8199U, // LDBs_RR |
423 | 7174U, // LDBz_RI |
424 | 8198U, // LDBz_RR |
425 | 7283U, // LDHs_RI |
426 | 8307U, // LDHs_RR |
427 | 7282U, // LDHz_RI |
428 | 8306U, // LDHz_RR |
429 | 9263U, // LDW_RI |
430 | 8240U, // LDW_RR |
431 | 8239U, // LDWz_RR |
432 | 2197U, // LEADZ |
433 | 367U, // LOG0 |
434 | 373U, // LOG1 |
435 | 379U, // LOG2 |
436 | 385U, // LOG3 |
437 | 391U, // LOG4 |
438 | 10384U, // MOVHI |
439 | 619U, // NOP |
440 | 18540U, // OR_F_I_HI |
441 | 34924U, // OR_F_I_LO |
442 | 3644U, // OR_F_R |
443 | 18564U, // OR_I_HI |
444 | 34948U, // OR_I_LO |
445 | 3696U, // OR_R |
446 | 2084U, // POPC |
447 | 594U, // RET |
448 | 34873U, // SA_F_I |
449 | 34817U, // SA_I |
450 | 21107U, // SCC |
451 | 11558U, // SELECT |
452 | 17480U, // SFSUB_F_RI_HI |
453 | 17480U, // SFSUB_F_RI_LO |
454 | 17480U, // SFSUB_F_RR |
455 | 3638U, // SHL_F_R |
456 | 3649U, // SHL_R |
457 | 2192U, // SLI |
458 | 34917U, // SL_F_I |
459 | 34943U, // SL_I |
460 | 3600U, // SRA_F_R |
461 | 3574U, // SRA_R |
462 | 3638U, // SRL_F_R |
463 | 3649U, // SRL_R |
464 | 17548U, // STADDR |
465 | 17421U, // STB_RI |
466 | 17421U, // STB_RR |
467 | 17529U, // STH_RI |
468 | 17529U, // STH_RR |
469 | 18496U, // SUBB_F_I_HI |
470 | 34880U, // SUBB_F_I_LO |
471 | 3606U, // SUBB_F_R |
472 | 18451U, // SUBB_I_HI |
473 | 34835U, // SUBB_I_LO |
474 | 3578U, // SUBB_R |
475 | 18504U, // SUB_F_I_HI |
476 | 34888U, // SUB_F_I_LO |
477 | 3613U, // SUB_F_R |
478 | 18457U, // SUB_I_HI |
479 | 34841U, // SUB_I_LO |
480 | 3583U, // SUB_R |
481 | 17548U, // SW_RI |
482 | 17548U, // SW_RR |
483 | 2204U, // TRAILZ |
484 | 18539U, // XOR_F_I_HI |
485 | 34923U, // XOR_F_I_LO |
486 | 3643U, // XOR_F_R |
487 | 18563U, // XOR_I_HI |
488 | 34947U, // XOR_I_LO |
489 | 3695U, // XOR_R |
490 | }; |
491 | |
492 | static const uint8_t OpInfo1[] = { |
493 | 0U, // PHI |
494 | 0U, // INLINEASM |
495 | 0U, // INLINEASM_BR |
496 | 0U, // CFI_INSTRUCTION |
497 | 0U, // EH_LABEL |
498 | 0U, // GC_LABEL |
499 | 0U, // ANNOTATION_LABEL |
500 | 0U, // KILL |
501 | 0U, // EXTRACT_SUBREG |
502 | 0U, // INSERT_SUBREG |
503 | 0U, // IMPLICIT_DEF |
504 | 0U, // SUBREG_TO_REG |
505 | 0U, // COPY_TO_REGCLASS |
506 | 0U, // DBG_VALUE |
507 | 0U, // DBG_VALUE_LIST |
508 | 0U, // DBG_INSTR_REF |
509 | 0U, // DBG_PHI |
510 | 0U, // DBG_LABEL |
511 | 0U, // REG_SEQUENCE |
512 | 0U, // COPY |
513 | 0U, // BUNDLE |
514 | 0U, // LIFETIME_START |
515 | 0U, // LIFETIME_END |
516 | 0U, // PSEUDO_PROBE |
517 | 0U, // ARITH_FENCE |
518 | 0U, // STACKMAP |
519 | 0U, // FENTRY_CALL |
520 | 0U, // PATCHPOINT |
521 | 0U, // LOAD_STACK_GUARD |
522 | 0U, // PREALLOCATED_SETUP |
523 | 0U, // PREALLOCATED_ARG |
524 | 0U, // STATEPOINT |
525 | 0U, // LOCAL_ESCAPE |
526 | 0U, // FAULTING_OP |
527 | 0U, // PATCHABLE_OP |
528 | 0U, // PATCHABLE_FUNCTION_ENTER |
529 | 0U, // PATCHABLE_RET |
530 | 0U, // PATCHABLE_FUNCTION_EXIT |
531 | 0U, // PATCHABLE_TAIL_CALL |
532 | 0U, // PATCHABLE_EVENT_CALL |
533 | 0U, // PATCHABLE_TYPED_EVENT_CALL |
534 | 0U, // ICALL_BRANCH_FUNNEL |
535 | 0U, // MEMBARRIER |
536 | 0U, // JUMP_TABLE_DEBUG_INFO |
537 | 0U, // CONVERGENCECTRL_ENTRY |
538 | 0U, // CONVERGENCECTRL_ANCHOR |
539 | 0U, // CONVERGENCECTRL_LOOP |
540 | 0U, // CONVERGENCECTRL_GLUE |
541 | 0U, // G_ASSERT_SEXT |
542 | 0U, // G_ASSERT_ZEXT |
543 | 0U, // G_ASSERT_ALIGN |
544 | 0U, // G_ADD |
545 | 0U, // G_SUB |
546 | 0U, // G_MUL |
547 | 0U, // G_SDIV |
548 | 0U, // G_UDIV |
549 | 0U, // G_SREM |
550 | 0U, // G_UREM |
551 | 0U, // G_SDIVREM |
552 | 0U, // G_UDIVREM |
553 | 0U, // G_AND |
554 | 0U, // G_OR |
555 | 0U, // G_XOR |
556 | 0U, // G_IMPLICIT_DEF |
557 | 0U, // G_PHI |
558 | 0U, // G_FRAME_INDEX |
559 | 0U, // G_GLOBAL_VALUE |
560 | 0U, // G_PTRAUTH_GLOBAL_VALUE |
561 | 0U, // G_CONSTANT_POOL |
562 | 0U, // G_EXTRACT |
563 | 0U, // G_UNMERGE_VALUES |
564 | 0U, // G_INSERT |
565 | 0U, // G_MERGE_VALUES |
566 | 0U, // G_BUILD_VECTOR |
567 | 0U, // G_BUILD_VECTOR_TRUNC |
568 | 0U, // G_CONCAT_VECTORS |
569 | 0U, // G_PTRTOINT |
570 | 0U, // G_INTTOPTR |
571 | 0U, // G_BITCAST |
572 | 0U, // G_FREEZE |
573 | 0U, // G_CONSTANT_FOLD_BARRIER |
574 | 0U, // G_INTRINSIC_FPTRUNC_ROUND |
575 | 0U, // G_INTRINSIC_TRUNC |
576 | 0U, // G_INTRINSIC_ROUND |
577 | 0U, // G_INTRINSIC_LRINT |
578 | 0U, // G_INTRINSIC_LLRINT |
579 | 0U, // G_INTRINSIC_ROUNDEVEN |
580 | 0U, // G_READCYCLECOUNTER |
581 | 0U, // G_READSTEADYCOUNTER |
582 | 0U, // G_LOAD |
583 | 0U, // G_SEXTLOAD |
584 | 0U, // G_ZEXTLOAD |
585 | 0U, // G_INDEXED_LOAD |
586 | 0U, // G_INDEXED_SEXTLOAD |
587 | 0U, // G_INDEXED_ZEXTLOAD |
588 | 0U, // G_STORE |
589 | 0U, // G_INDEXED_STORE |
590 | 0U, // G_ATOMIC_CMPXCHG_WITH_SUCCESS |
591 | 0U, // G_ATOMIC_CMPXCHG |
592 | 0U, // G_ATOMICRMW_XCHG |
593 | 0U, // G_ATOMICRMW_ADD |
594 | 0U, // G_ATOMICRMW_SUB |
595 | 0U, // G_ATOMICRMW_AND |
596 | 0U, // G_ATOMICRMW_NAND |
597 | 0U, // G_ATOMICRMW_OR |
598 | 0U, // G_ATOMICRMW_XOR |
599 | 0U, // G_ATOMICRMW_MAX |
600 | 0U, // G_ATOMICRMW_MIN |
601 | 0U, // G_ATOMICRMW_UMAX |
602 | 0U, // G_ATOMICRMW_UMIN |
603 | 0U, // G_ATOMICRMW_FADD |
604 | 0U, // G_ATOMICRMW_FSUB |
605 | 0U, // G_ATOMICRMW_FMAX |
606 | 0U, // G_ATOMICRMW_FMIN |
607 | 0U, // G_ATOMICRMW_UINC_WRAP |
608 | 0U, // G_ATOMICRMW_UDEC_WRAP |
609 | 0U, // G_FENCE |
610 | 0U, // G_PREFETCH |
611 | 0U, // G_BRCOND |
612 | 0U, // G_BRINDIRECT |
613 | 0U, // G_INVOKE_REGION_START |
614 | 0U, // G_INTRINSIC |
615 | 0U, // G_INTRINSIC_W_SIDE_EFFECTS |
616 | 0U, // G_INTRINSIC_CONVERGENT |
617 | 0U, // G_INTRINSIC_CONVERGENT_W_SIDE_EFFECTS |
618 | 0U, // G_ANYEXT |
619 | 0U, // G_TRUNC |
620 | 0U, // G_CONSTANT |
621 | 0U, // G_FCONSTANT |
622 | 0U, // G_VASTART |
623 | 0U, // G_VAARG |
624 | 0U, // G_SEXT |
625 | 0U, // G_SEXT_INREG |
626 | 0U, // G_ZEXT |
627 | 0U, // G_SHL |
628 | 0U, // G_LSHR |
629 | 0U, // G_ASHR |
630 | 0U, // G_FSHL |
631 | 0U, // G_FSHR |
632 | 0U, // G_ROTR |
633 | 0U, // G_ROTL |
634 | 0U, // G_ICMP |
635 | 0U, // G_FCMP |
636 | 0U, // G_SCMP |
637 | 0U, // G_UCMP |
638 | 0U, // G_SELECT |
639 | 0U, // G_UADDO |
640 | 0U, // G_UADDE |
641 | 0U, // G_USUBO |
642 | 0U, // G_USUBE |
643 | 0U, // G_SADDO |
644 | 0U, // G_SADDE |
645 | 0U, // G_SSUBO |
646 | 0U, // G_SSUBE |
647 | 0U, // G_UMULO |
648 | 0U, // G_SMULO |
649 | 0U, // G_UMULH |
650 | 0U, // G_SMULH |
651 | 0U, // G_UADDSAT |
652 | 0U, // G_SADDSAT |
653 | 0U, // G_USUBSAT |
654 | 0U, // G_SSUBSAT |
655 | 0U, // G_USHLSAT |
656 | 0U, // G_SSHLSAT |
657 | 0U, // G_SMULFIX |
658 | 0U, // G_UMULFIX |
659 | 0U, // G_SMULFIXSAT |
660 | 0U, // G_UMULFIXSAT |
661 | 0U, // G_SDIVFIX |
662 | 0U, // G_UDIVFIX |
663 | 0U, // G_SDIVFIXSAT |
664 | 0U, // G_UDIVFIXSAT |
665 | 0U, // G_FADD |
666 | 0U, // G_FSUB |
667 | 0U, // G_FMUL |
668 | 0U, // G_FMA |
669 | 0U, // G_FMAD |
670 | 0U, // G_FDIV |
671 | 0U, // G_FREM |
672 | 0U, // G_FPOW |
673 | 0U, // G_FPOWI |
674 | 0U, // G_FEXP |
675 | 0U, // G_FEXP2 |
676 | 0U, // G_FEXP10 |
677 | 0U, // G_FLOG |
678 | 0U, // G_FLOG2 |
679 | 0U, // G_FLOG10 |
680 | 0U, // G_FLDEXP |
681 | 0U, // G_FFREXP |
682 | 0U, // G_FNEG |
683 | 0U, // G_FPEXT |
684 | 0U, // G_FPTRUNC |
685 | 0U, // G_FPTOSI |
686 | 0U, // G_FPTOUI |
687 | 0U, // G_SITOFP |
688 | 0U, // G_UITOFP |
689 | 0U, // G_FABS |
690 | 0U, // G_FCOPYSIGN |
691 | 0U, // G_IS_FPCLASS |
692 | 0U, // G_FCANONICALIZE |
693 | 0U, // G_FMINNUM |
694 | 0U, // G_FMAXNUM |
695 | 0U, // G_FMINNUM_IEEE |
696 | 0U, // G_FMAXNUM_IEEE |
697 | 0U, // G_FMINIMUM |
698 | 0U, // G_FMAXIMUM |
699 | 0U, // G_GET_FPENV |
700 | 0U, // G_SET_FPENV |
701 | 0U, // G_RESET_FPENV |
702 | 0U, // G_GET_FPMODE |
703 | 0U, // G_SET_FPMODE |
704 | 0U, // G_RESET_FPMODE |
705 | 0U, // G_PTR_ADD |
706 | 0U, // G_PTRMASK |
707 | 0U, // G_SMIN |
708 | 0U, // G_SMAX |
709 | 0U, // G_UMIN |
710 | 0U, // G_UMAX |
711 | 0U, // G_ABS |
712 | 0U, // G_LROUND |
713 | 0U, // G_LLROUND |
714 | 0U, // G_BR |
715 | 0U, // G_BRJT |
716 | 0U, // G_VSCALE |
717 | 0U, // G_INSERT_SUBVECTOR |
718 | 0U, // G_EXTRACT_SUBVECTOR |
719 | 0U, // G_INSERT_VECTOR_ELT |
720 | 0U, // G_EXTRACT_VECTOR_ELT |
721 | 0U, // G_SHUFFLE_VECTOR |
722 | 0U, // G_SPLAT_VECTOR |
723 | 0U, // G_VECTOR_COMPRESS |
724 | 0U, // G_CTTZ |
725 | 0U, // G_CTTZ_ZERO_UNDEF |
726 | 0U, // G_CTLZ |
727 | 0U, // G_CTLZ_ZERO_UNDEF |
728 | 0U, // G_CTPOP |
729 | 0U, // G_BSWAP |
730 | 0U, // G_BITREVERSE |
731 | 0U, // G_FCEIL |
732 | 0U, // G_FCOS |
733 | 0U, // G_FSIN |
734 | 0U, // G_FTAN |
735 | 0U, // G_FACOS |
736 | 0U, // G_FASIN |
737 | 0U, // G_FATAN |
738 | 0U, // G_FCOSH |
739 | 0U, // G_FSINH |
740 | 0U, // G_FTANH |
741 | 0U, // G_FSQRT |
742 | 0U, // G_FFLOOR |
743 | 0U, // G_FRINT |
744 | 0U, // G_FNEARBYINT |
745 | 0U, // G_ADDRSPACE_CAST |
746 | 0U, // G_BLOCK_ADDR |
747 | 0U, // G_JUMP_TABLE |
748 | 0U, // G_DYN_STACKALLOC |
749 | 0U, // G_STACKSAVE |
750 | 0U, // G_STACKRESTORE |
751 | 0U, // G_STRICT_FADD |
752 | 0U, // G_STRICT_FSUB |
753 | 0U, // G_STRICT_FMUL |
754 | 0U, // G_STRICT_FDIV |
755 | 0U, // G_STRICT_FREM |
756 | 0U, // G_STRICT_FMA |
757 | 0U, // G_STRICT_FSQRT |
758 | 0U, // G_STRICT_FLDEXP |
759 | 0U, // G_READ_REGISTER |
760 | 0U, // G_WRITE_REGISTER |
761 | 0U, // G_MEMCPY |
762 | 0U, // G_MEMCPY_INLINE |
763 | 0U, // G_MEMMOVE |
764 | 0U, // G_MEMSET |
765 | 0U, // G_BZERO |
766 | 0U, // G_TRAP |
767 | 0U, // G_DEBUGTRAP |
768 | 0U, // G_UBSANTRAP |
769 | 0U, // G_VECREDUCE_SEQ_FADD |
770 | 0U, // G_VECREDUCE_SEQ_FMUL |
771 | 0U, // G_VECREDUCE_FADD |
772 | 0U, // G_VECREDUCE_FMUL |
773 | 0U, // G_VECREDUCE_FMAX |
774 | 0U, // G_VECREDUCE_FMIN |
775 | 0U, // G_VECREDUCE_FMAXIMUM |
776 | 0U, // G_VECREDUCE_FMINIMUM |
777 | 0U, // G_VECREDUCE_ADD |
778 | 0U, // G_VECREDUCE_MUL |
779 | 0U, // G_VECREDUCE_AND |
780 | 0U, // G_VECREDUCE_OR |
781 | 0U, // G_VECREDUCE_XOR |
782 | 0U, // G_VECREDUCE_SMAX |
783 | 0U, // G_VECREDUCE_SMIN |
784 | 0U, // G_VECREDUCE_UMAX |
785 | 0U, // G_VECREDUCE_UMIN |
786 | 0U, // G_SBFX |
787 | 0U, // G_UBFX |
788 | 0U, // ADJCALLSTACKDOWN |
789 | 0U, // ADJCALLSTACKUP |
790 | 0U, // ADJDYNALLOC |
791 | 0U, // CALL |
792 | 0U, // CALLR |
793 | 0U, // ADDC_F_I_HI |
794 | 0U, // ADDC_F_I_LO |
795 | 0U, // ADDC_F_R |
796 | 0U, // ADDC_I_HI |
797 | 0U, // ADDC_I_LO |
798 | 0U, // ADDC_R |
799 | 0U, // ADD_F_I_HI |
800 | 0U, // ADD_F_I_LO |
801 | 0U, // ADD_F_R |
802 | 0U, // ADD_I_HI |
803 | 0U, // ADD_I_LO |
804 | 0U, // ADD_R |
805 | 0U, // AND_F_I_HI |
806 | 1U, // AND_F_I_LO |
807 | 0U, // AND_F_R |
808 | 0U, // AND_I_HI |
809 | 1U, // AND_I_LO |
810 | 0U, // AND_R |
811 | 1U, // BRCC |
812 | 1U, // BRIND_CC |
813 | 0U, // BRIND_CCA |
814 | 1U, // BRR |
815 | 1U, // BT |
816 | 1U, // JR |
817 | 0U, // LDADDR |
818 | 0U, // LDBs_RI |
819 | 0U, // LDBs_RR |
820 | 0U, // LDBz_RI |
821 | 0U, // LDBz_RR |
822 | 0U, // LDHs_RI |
823 | 0U, // LDHs_RR |
824 | 0U, // LDHz_RI |
825 | 0U, // LDHz_RR |
826 | 0U, // LDW_RI |
827 | 0U, // LDW_RR |
828 | 0U, // LDWz_RR |
829 | 2U, // LEADZ |
830 | 0U, // LOG0 |
831 | 0U, // LOG1 |
832 | 0U, // LOG2 |
833 | 0U, // LOG3 |
834 | 0U, // LOG4 |
835 | 0U, // MOVHI |
836 | 0U, // NOP |
837 | 0U, // OR_F_I_HI |
838 | 0U, // OR_F_I_LO |
839 | 0U, // OR_F_R |
840 | 0U, // OR_I_HI |
841 | 0U, // OR_I_LO |
842 | 0U, // OR_R |
843 | 2U, // POPC |
844 | 0U, // RET |
845 | 0U, // SA_F_I |
846 | 0U, // SA_I |
847 | 1U, // SCC |
848 | 0U, // SELECT |
849 | 2U, // SFSUB_F_RI_HI |
850 | 6U, // SFSUB_F_RI_LO |
851 | 6U, // SFSUB_F_RR |
852 | 0U, // SHL_F_R |
853 | 0U, // SHL_R |
854 | 2U, // SLI |
855 | 0U, // SL_F_I |
856 | 0U, // SL_I |
857 | 0U, // SRA_F_R |
858 | 0U, // SRA_R |
859 | 0U, // SRL_F_R |
860 | 0U, // SRL_R |
861 | 10U, // STADDR |
862 | 14U, // STB_RI |
863 | 18U, // STB_RR |
864 | 14U, // STH_RI |
865 | 18U, // STH_RR |
866 | 0U, // SUBB_F_I_HI |
867 | 0U, // SUBB_F_I_LO |
868 | 0U, // SUBB_F_R |
869 | 0U, // SUBB_I_HI |
870 | 0U, // SUBB_I_LO |
871 | 0U, // SUBB_R |
872 | 0U, // SUB_F_I_HI |
873 | 0U, // SUB_F_I_LO |
874 | 0U, // SUB_F_R |
875 | 0U, // SUB_I_HI |
876 | 0U, // SUB_I_LO |
877 | 0U, // SUB_R |
878 | 22U, // SW_RI |
879 | 18U, // SW_RR |
880 | 2U, // TRAILZ |
881 | 0U, // XOR_F_I_HI |
882 | 0U, // XOR_F_I_LO |
883 | 0U, // XOR_F_R |
884 | 0U, // XOR_I_HI |
885 | 0U, // XOR_I_LO |
886 | 0U, // XOR_R |
887 | }; |
888 | |
889 | // Emit the opcode for the instruction. |
890 | uint32_t Bits = 0; |
891 | Bits |= OpInfo0[MI->getOpcode()] << 0; |
892 | Bits |= OpInfo1[MI->getOpcode()] << 16; |
893 | if (Bits == 0) |
894 | return {nullptr, Bits}; |
895 | return {AsmStrs+(Bits & 1023)-1, Bits}; |
896 | |
897 | } |
898 | /// printInstruction - This method is automatically generated by tablegen |
899 | /// from the instruction set description. |
900 | LLVM_NO_PROFILE_INSTRUMENT_FUNCTION |
901 | void LanaiInstPrinter::printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O) { |
902 | O << "\t" ; |
903 | |
904 | auto MnemonicInfo = getMnemonic(MI); |
905 | |
906 | O << MnemonicInfo.first; |
907 | |
908 | uint32_t Bits = MnemonicInfo.second; |
909 | assert(Bits != 0 && "Cannot print this instruction." ); |
910 | |
911 | // Fragment 0 encoded into 4 bits for 12 unique commands. |
912 | switch ((Bits >> 10) & 15) { |
913 | default: llvm_unreachable("Invalid command number." ); |
914 | case 0: |
915 | // DBG_VALUE, DBG_VALUE_LIST, DBG_INSTR_REF, DBG_PHI, DBG_LABEL, BUNDLE, ... |
916 | return; |
917 | break; |
918 | case 1: |
919 | // ADJCALLSTACKDOWN, ADJCALLSTACKUP, ADJDYNALLOC, BT, JR, SFSUB_F_RI_HI, ... |
920 | printOperand(MI, OpNo: 0, O); |
921 | break; |
922 | case 2: |
923 | // ADDC_F_I_HI, ADDC_F_I_LO, ADDC_I_HI, ADDC_I_LO, ADD_F_I_HI, ADD_F_I_LO... |
924 | printOperand(MI, OpNo: 1, O); |
925 | O << ", " ; |
926 | break; |
927 | case 3: |
928 | // ADDC_F_R, ADDC_R, ADD_F_R, ADD_R, AND_F_R, AND_R, OR_F_R, OR_R, SHL_F_... |
929 | printPredicateOperand(MI, OpNum: 3, O); |
930 | O << "\t" ; |
931 | printOperand(MI, OpNo: 1, O); |
932 | O << ", " ; |
933 | printOperand(MI, OpNo: 2, O); |
934 | O << ", " ; |
935 | printOperand(MI, OpNo: 0, O); |
936 | return; |
937 | break; |
938 | case 4: |
939 | // BRCC, BRIND_CC, BRR, SCC |
940 | printCCOperand(MI, OpNo: 1, O); |
941 | break; |
942 | case 5: |
943 | // BRIND_CCA |
944 | printCCOperand(MI, OpNo: 2, O); |
945 | O << "\t" ; |
946 | printOperand(MI, OpNo: 0, O); |
947 | O << " add " ; |
948 | printOperand(MI, OpNo: 1, O); |
949 | return; |
950 | break; |
951 | case 6: |
952 | // LDADDR |
953 | printMemImmOperand(MI, OpNo: 1, O); |
954 | O << ", " ; |
955 | printOperand(MI, OpNo: 0, O); |
956 | return; |
957 | break; |
958 | case 7: |
959 | // LDBs_RI, LDBz_RI, LDHs_RI, LDHz_RI |
960 | printMemSplsOperand(MI, OpNo: 1, O); |
961 | O << ", " ; |
962 | printOperand(MI, OpNo: 0, O); |
963 | return; |
964 | break; |
965 | case 8: |
966 | // LDBs_RR, LDBz_RR, LDHs_RR, LDHz_RR, LDW_RR, LDWz_RR |
967 | printMemRrOperand(MI, OpNo: 1, O); |
968 | O << ", " ; |
969 | printOperand(MI, OpNo: 0, O); |
970 | return; |
971 | break; |
972 | case 9: |
973 | // LDW_RI |
974 | printMemRiOperand(MI, OpNo: 1, O); |
975 | O << ", " ; |
976 | printOperand(MI, OpNo: 0, O); |
977 | return; |
978 | break; |
979 | case 10: |
980 | // MOVHI |
981 | printHi16ImmOperand(MI, OpNo: 1, O); |
982 | O << ", " ; |
983 | printOperand(MI, OpNo: 0, O); |
984 | return; |
985 | break; |
986 | case 11: |
987 | // SELECT |
988 | printCCOperand(MI, OpNo: 3, O); |
989 | O << ' '; |
990 | printOperand(MI, OpNo: 1, O); |
991 | O << ", " ; |
992 | printOperand(MI, OpNo: 2, O); |
993 | O << ", " ; |
994 | printOperand(MI, OpNo: 0, O); |
995 | return; |
996 | break; |
997 | } |
998 | |
999 | |
1000 | // Fragment 1 encoded into 4 bits for 10 unique commands. |
1001 | switch ((Bits >> 14) & 15) { |
1002 | default: llvm_unreachable("Invalid command number." ); |
1003 | case 0: |
1004 | // ADJCALLSTACKDOWN, ADJCALLSTACKUP, ADJDYNALLOC |
1005 | O << ' '; |
1006 | printOperand(MI, OpNo: 1, O); |
1007 | return; |
1008 | break; |
1009 | case 1: |
1010 | // ADDC_F_I_HI, ADDC_I_HI, ADD_F_I_HI, ADD_I_HI, OR_F_I_HI, OR_I_HI, SUBB... |
1011 | printHi16ImmOperand(MI, OpNo: 2, O); |
1012 | O << ", " ; |
1013 | printOperand(MI, OpNo: 0, O); |
1014 | return; |
1015 | break; |
1016 | case 2: |
1017 | // ADDC_F_I_LO, ADDC_I_LO, ADD_F_I_LO, ADD_I_LO, OR_F_I_LO, OR_I_LO, SA_F... |
1018 | printOperand(MI, OpNo: 2, O); |
1019 | O << ", " ; |
1020 | printOperand(MI, OpNo: 0, O); |
1021 | return; |
1022 | break; |
1023 | case 3: |
1024 | // AND_F_I_HI, AND_I_HI |
1025 | printHi16AndImmOperand(MI, OpNo: 2, O); |
1026 | O << ", " ; |
1027 | printOperand(MI, OpNo: 0, O); |
1028 | return; |
1029 | break; |
1030 | case 4: |
1031 | // AND_F_I_LO, AND_I_LO |
1032 | printLo16AndImmOperand(MI, OpNo: 2, O); |
1033 | O << ", " ; |
1034 | printOperand(MI, OpNo: 0, O); |
1035 | return; |
1036 | break; |
1037 | case 5: |
1038 | // BRCC, BRIND_CC, SCC |
1039 | O << "\t" ; |
1040 | printOperand(MI, OpNo: 0, O); |
1041 | return; |
1042 | break; |
1043 | case 6: |
1044 | // BRR |
1045 | O << ".r\t" ; |
1046 | printOperand(MI, OpNo: 0, O); |
1047 | return; |
1048 | break; |
1049 | case 7: |
1050 | // BT, JR |
1051 | return; |
1052 | break; |
1053 | case 8: |
1054 | // LEADZ, POPC, SLI, TRAILZ |
1055 | printOperand(MI, OpNo: 0, O); |
1056 | return; |
1057 | break; |
1058 | case 9: |
1059 | // SFSUB_F_RI_HI, SFSUB_F_RI_LO, SFSUB_F_RR, STADDR, STB_RI, STB_RR, STH_... |
1060 | O << ", " ; |
1061 | break; |
1062 | } |
1063 | |
1064 | |
1065 | // Fragment 2 encoded into 3 bits for 6 unique commands. |
1066 | switch ((Bits >> 18) & 7) { |
1067 | default: llvm_unreachable("Invalid command number." ); |
1068 | case 0: |
1069 | // SFSUB_F_RI_HI |
1070 | printHi16ImmOperand(MI, OpNo: 1, O); |
1071 | O << ", %r0" ; |
1072 | return; |
1073 | break; |
1074 | case 1: |
1075 | // SFSUB_F_RI_LO, SFSUB_F_RR |
1076 | printOperand(MI, OpNo: 1, O); |
1077 | O << ", %r0" ; |
1078 | return; |
1079 | break; |
1080 | case 2: |
1081 | // STADDR |
1082 | printMemImmOperand(MI, OpNo: 1, O); |
1083 | return; |
1084 | break; |
1085 | case 3: |
1086 | // STB_RI, STH_RI |
1087 | printMemSplsOperand(MI, OpNo: 1, O); |
1088 | return; |
1089 | break; |
1090 | case 4: |
1091 | // STB_RR, STH_RR, SW_RR |
1092 | printMemRrOperand(MI, OpNo: 1, O); |
1093 | return; |
1094 | break; |
1095 | case 5: |
1096 | // SW_RI |
1097 | printMemRiOperand(MI, OpNo: 1, O); |
1098 | return; |
1099 | break; |
1100 | } |
1101 | |
1102 | } |
1103 | |
1104 | |
1105 | /// getRegisterName - This method is automatically generated by tblgen |
1106 | /// from the register set description. This returns the assembler name |
1107 | /// for the specified register. |
1108 | const char *LanaiInstPrinter::getRegisterName(MCRegister Reg) { |
1109 | unsigned RegNo = Reg.id(); |
1110 | assert(RegNo && RegNo < 41 && "Invalid register number!" ); |
1111 | |
1112 | |
1113 | #ifdef __GNUC__ |
1114 | #pragma GCC diagnostic push |
1115 | #pragma GCC diagnostic ignored "-Woverlength-strings" |
1116 | #endif |
1117 | static const char AsmStrs[] = { |
1118 | /* 0 */ "r10\0" |
1119 | /* 4 */ "r20\0" |
1120 | /* 8 */ "r30\0" |
1121 | /* 12 */ "r0\0" |
1122 | /* 15 */ "r11\0" |
1123 | /* 19 */ "r21\0" |
1124 | /* 23 */ "r31\0" |
1125 | /* 27 */ "rr1\0" |
1126 | /* 31 */ "r12\0" |
1127 | /* 35 */ "r22\0" |
1128 | /* 39 */ "rr2\0" |
1129 | /* 43 */ "r13\0" |
1130 | /* 47 */ "r23\0" |
1131 | /* 51 */ "r3\0" |
1132 | /* 54 */ "r14\0" |
1133 | /* 58 */ "r24\0" |
1134 | /* 62 */ "r4\0" |
1135 | /* 65 */ "r15\0" |
1136 | /* 69 */ "r25\0" |
1137 | /* 73 */ "r5\0" |
1138 | /* 76 */ "r16\0" |
1139 | /* 80 */ "r26\0" |
1140 | /* 84 */ "r6\0" |
1141 | /* 87 */ "r17\0" |
1142 | /* 91 */ "r27\0" |
1143 | /* 95 */ "r7\0" |
1144 | /* 98 */ "r18\0" |
1145 | /* 102 */ "r28\0" |
1146 | /* 106 */ "r8\0" |
1147 | /* 109 */ "r19\0" |
1148 | /* 113 */ "r29\0" |
1149 | /* 117 */ "r9\0" |
1150 | /* 120 */ "rca\0" |
1151 | /* 124 */ "pc\0" |
1152 | /* 127 */ "fp\0" |
1153 | /* 130 */ "sp\0" |
1154 | /* 133 */ "rv\0" |
1155 | /* 136 */ "sw\0" |
1156 | }; |
1157 | #ifdef __GNUC__ |
1158 | #pragma GCC diagnostic pop |
1159 | #endif |
1160 | |
1161 | static const uint8_t RegAsmOffset[] = { |
1162 | 127, 124, 120, 133, 130, 136, 12, 28, 40, 51, 62, 73, 84, 95, |
1163 | 106, 117, 0, 15, 31, 43, 54, 65, 76, 87, 98, 109, 4, 19, |
1164 | 35, 47, 58, 69, 80, 91, 102, 113, 8, 23, 27, 39, |
1165 | }; |
1166 | |
1167 | assert (*(AsmStrs+RegAsmOffset[RegNo-1]) && |
1168 | "Invalid alt name index for register!" ); |
1169 | return AsmStrs+RegAsmOffset[RegNo-1]; |
1170 | } |
1171 | |
1172 | #ifdef PRINT_ALIAS_INSTR |
1173 | #undef PRINT_ALIAS_INSTR |
1174 | |
1175 | bool LanaiInstPrinter::printAliasInstr(const MCInst *MI, uint64_t Address, raw_ostream &OS) { |
1176 | static const PatternsForOpcode OpToPatterns[] = { |
1177 | {.Opcode: Lanai::ADD_I_HI, .PatternStart: 0, .NumPatterns: 1 }, |
1178 | {.Opcode: Lanai::ADD_I_LO, .PatternStart: 1, .NumPatterns: 1 }, |
1179 | {.Opcode: Lanai::ADD_R, .PatternStart: 2, .NumPatterns: 1 }, |
1180 | {.Opcode: Lanai::AND_I_HI, .PatternStart: 3, .NumPatterns: 1 }, |
1181 | {.Opcode: Lanai::AND_I_LO, .PatternStart: 4, .NumPatterns: 1 }, |
1182 | {.Opcode: Lanai::LDW_RI, .PatternStart: 5, .NumPatterns: 1 }, |
1183 | }; |
1184 | |
1185 | static const AliasPattern Patterns[] = { |
1186 | // Lanai::ADD_I_HI - 0 |
1187 | {.AsmStrOffset: 0, .AliasCondStart: 0, .NumOperands: 3, .NumConds: 2 }, |
1188 | // Lanai::ADD_I_LO - 1 |
1189 | {.AsmStrOffset: 13, .AliasCondStart: 2, .NumOperands: 3, .NumConds: 2 }, |
1190 | // Lanai::ADD_R - 2 |
1191 | {.AsmStrOffset: 24, .AliasCondStart: 4, .NumOperands: 4, .NumConds: 4 }, |
1192 | // Lanai::AND_I_HI - 3 |
1193 | {.AsmStrOffset: 35, .AliasCondStart: 8, .NumOperands: 3, .NumConds: 2 }, |
1194 | // Lanai::AND_I_LO - 4 |
1195 | {.AsmStrOffset: 48, .AliasCondStart: 10, .NumOperands: 3, .NumConds: 2 }, |
1196 | // Lanai::LDW_RI - 5 |
1197 | {.AsmStrOffset: 61, .AliasCondStart: 12, .NumOperands: 4, .NumConds: 1 }, |
1198 | }; |
1199 | |
1200 | static const AliasPatternCond Conds[] = { |
1201 | // (ADD_I_HI GPR:$dst, R0, i32hi16:$imm16) - 0 |
1202 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1203 | {.Kind: AliasPatternCond::K_Reg, .Value: Lanai::R0}, |
1204 | // (ADD_I_LO GPR:$dst, R0, i32lo16z:$imm16) - 2 |
1205 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1206 | {.Kind: AliasPatternCond::K_Reg, .Value: Lanai::R0}, |
1207 | // (ADD_R GPR:$dst, GPR:$src, R0, 0) - 4 |
1208 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1209 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1210 | {.Kind: AliasPatternCond::K_Reg, .Value: Lanai::R0}, |
1211 | {.Kind: AliasPatternCond::K_Imm, .Value: uint32_t(0)}, |
1212 | // (AND_I_HI GPR:$dst, R1, i32hi16and:$imm16) - 8 |
1213 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1214 | {.Kind: AliasPatternCond::K_Reg, .Value: Lanai::R1}, |
1215 | // (AND_I_LO GPR:$dst, R1, i32lo16and:$imm16) - 10 |
1216 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1217 | {.Kind: AliasPatternCond::K_Reg, .Value: Lanai::R1}, |
1218 | // (LDW_RI GPR:$dst, MEMri:$src) - 12 |
1219 | {.Kind: AliasPatternCond::K_RegClass, .Value: Lanai::GPRRegClassID}, |
1220 | }; |
1221 | |
1222 | static const char AsmStrings[] = |
1223 | /* 0 */ "mov $\xFF\x03\x01, $\x01\0" |
1224 | /* 13 */ "mov $\x03, $\x01\0" |
1225 | /* 24 */ "mov $\x02, $\x01\0" |
1226 | /* 35 */ "mov $\xFF\x03\x02, $\x01\0" |
1227 | /* 48 */ "mov $\xFF\x03\x03, $\x01\0" |
1228 | /* 61 */ "ld $\xFF\x02\x04, $\x01\0" |
1229 | ; |
1230 | |
1231 | #ifndef NDEBUG |
1232 | static struct SortCheck { |
1233 | SortCheck(ArrayRef<PatternsForOpcode> OpToPatterns) { |
1234 | assert(std::is_sorted( |
1235 | OpToPatterns.begin(), OpToPatterns.end(), |
1236 | [](const PatternsForOpcode &L, const PatternsForOpcode &R) { |
1237 | return L.Opcode < R.Opcode; |
1238 | }) && |
1239 | "tablegen failed to sort opcode patterns" ); |
1240 | } |
1241 | } sortCheckVar(OpToPatterns); |
1242 | #endif |
1243 | |
1244 | AliasMatchingData M { |
1245 | .OpToPatterns: ArrayRef(OpToPatterns), |
1246 | .Patterns: ArrayRef(Patterns), |
1247 | .PatternConds: ArrayRef(Conds), |
1248 | .AsmStrings: StringRef(AsmStrings, std::size(AsmStrings)), |
1249 | .ValidateMCOperand: nullptr, |
1250 | }; |
1251 | const char *AsmString = matchAliasPatterns(MI, STI: nullptr, M); |
1252 | if (!AsmString) return false; |
1253 | |
1254 | unsigned I = 0; |
1255 | while (AsmString[I] != ' ' && AsmString[I] != '\t' && |
1256 | AsmString[I] != '$' && AsmString[I] != '\0') |
1257 | ++I; |
1258 | OS << '\t' << StringRef(AsmString, I); |
1259 | if (AsmString[I] != '\0') { |
1260 | if (AsmString[I] == ' ' || AsmString[I] == '\t') { |
1261 | OS << '\t'; |
1262 | ++I; |
1263 | } |
1264 | do { |
1265 | if (AsmString[I] == '$') { |
1266 | ++I; |
1267 | if (AsmString[I] == (char)0xff) { |
1268 | ++I; |
1269 | int OpIdx = AsmString[I++] - 1; |
1270 | int PrintMethodIdx = AsmString[I++] - 1; |
1271 | printCustomAliasOperand(MI, Address, OpIdx, PrintMethodIdx, O&: OS); |
1272 | } else |
1273 | printOperand(MI, OpNo: unsigned(AsmString[I++]) - 1, O&: OS); |
1274 | } else { |
1275 | OS << AsmString[I++]; |
1276 | } |
1277 | } while (AsmString[I] != '\0'); |
1278 | } |
1279 | |
1280 | return true; |
1281 | } |
1282 | |
1283 | void LanaiInstPrinter::printCustomAliasOperand( |
1284 | const MCInst *MI, uint64_t Address, unsigned OpIdx, |
1285 | unsigned PrintMethodIdx, |
1286 | raw_ostream &OS) { |
1287 | switch (PrintMethodIdx) { |
1288 | default: |
1289 | llvm_unreachable("Unknown PrintMethod kind" ); |
1290 | break; |
1291 | case 0: |
1292 | printHi16ImmOperand(MI, OpNo: OpIdx, O&: OS); |
1293 | break; |
1294 | case 1: |
1295 | printHi16AndImmOperand(MI, OpNo: OpIdx, O&: OS); |
1296 | break; |
1297 | case 2: |
1298 | printLo16AndImmOperand(MI, OpNo: OpIdx, O&: OS); |
1299 | break; |
1300 | case 3: |
1301 | printMemRiOperand(MI, OpNo: OpIdx, O&: OS); |
1302 | break; |
1303 | } |
1304 | } |
1305 | |
1306 | #endif // PRINT_ALIAS_INSTR |
1307 | |