Coverage Report

Created: 2024-01-17 10:31

/src/build/lib/Target/MSP430/MSP430GenAsmWriter.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Assembly Writer Source Fragment                                            *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|* From: MSP430.td                                                            *|
7
|*                                                                            *|
8
\*===----------------------------------------------------------------------===*/
9
10
/// getMnemonic - This method is automatically generated by tablegen
11
/// from the instruction set description.
12
0
std::pair<const char *, uint64_t> MSP430InstPrinter::getMnemonic(const MCInst *MI) {
13
14
0
#ifdef __GNUC__
15
0
#pragma GCC diagnostic push
16
0
#pragma GCC diagnostic ignored "-Woverlength-strings"
17
0
#endif
18
0
  static const char AsmStrs[] = {
19
0
  /* 0 */ "rra\t\0"
20
0
  /* 5 */ "rra.b\t\0"
21
0
  /* 12 */ "sub.b\t\0"
22
0
  /* 19 */ "subc.b\t\0"
23
0
  /* 27 */ "addc.b\t\0"
24
0
  /* 35 */ "bic.b\t\0"
25
0
  /* 42 */ "rrc.b\t\0"
26
0
  /* 49 */ "dadd.b\t\0"
27
0
  /* 57 */ "and.b\t\0"
28
0
  /* 64 */ "push.b\t\0"
29
0
  /* 72 */ "cmp.b\t\0"
30
0
  /* 79 */ "xor.b\t\0"
31
0
  /* 86 */ "bis.b\t\0"
32
0
  /* 93 */ "bit.b\t\0"
33
0
  /* 100 */ "mov.b\t\0"
34
0
  /* 107 */ "swpb\t\0"
35
0
  /* 113 */ "sub\t\0"
36
0
  /* 118 */ "subc\t\0"
37
0
  /* 124 */ "addc\t\0"
38
0
  /* 130 */ "bic\t\0"
39
0
  /* 135 */ "rrc\t\0"
40
0
  /* 140 */ "dadd\t\0"
41
0
  /* 146 */ "and\t\0"
42
0
  /* 151 */ "push\t\0"
43
0
  /* 157 */ "call\t\0"
44
0
  /* 163 */ "cmp\t\0"
45
0
  /* 168 */ "jmp\t\0"
46
0
  /* 173 */ "pop\t\0"
47
0
  /* 178 */ "br\t\0"
48
0
  /* 182 */ "xor\t\0"
49
0
  /* 187 */ "bis\t\0"
50
0
  /* 192 */ "bit\t\0"
51
0
  /* 197 */ "sxt\t\0"
52
0
  /* 202 */ "mov\t\0"
53
0
  /* 207 */ "#ADJCALLSTACKDOWN \0"
54
0
  /* 226 */ "#ADJCALLSTACKUP \0"
55
0
  /* 243 */ "# XRay Function Patchable RET.\0"
56
0
  /* 274 */ "# XRay Typed Event Log.\0"
57
0
  /* 298 */ "# XRay Custom Event Log.\0"
58
0
  /* 323 */ "# XRay Function Enter.\0"
59
0
  /* 346 */ "# XRay Tail Call Exit.\0"
60
0
  /* 369 */ "# XRay Function Exit.\0"
61
0
  /* 391 */ "LIFETIME_END\0"
62
0
  /* 404 */ "PSEUDO_PROBE\0"
63
0
  /* 417 */ "BUNDLE\0"
64
0
  /* 424 */ "DBG_VALUE\0"
65
0
  /* 434 */ "DBG_INSTR_REF\0"
66
0
  /* 448 */ "DBG_PHI\0"
67
0
  /* 456 */ "DBG_LABEL\0"
68
0
  /* 466 */ "# Sra16 PSEUDO\0"
69
0
  /* 481 */ "# Shl16 PSEUDO\0"
70
0
  /* 496 */ "# Srl16 PSEUDO\0"
71
0
  /* 511 */ "# Select16 PSEUDO\0"
72
0
  /* 529 */ "# Sra8 PSEUDO\0"
73
0
  /* 543 */ "# Shl8 PSEUDO\0"
74
0
  /* 557 */ "# Srl8 PSEUDO\0"
75
0
  /* 571 */ "# Select8 PSEUDO\0"
76
0
  /* 588 */ "# ADDframe PSEUDO\0"
77
0
  /* 606 */ "LIFETIME_START\0"
78
0
  /* 621 */ "DBG_VALUE_LIST\0"
79
0
  /* 636 */ "reti\0"
80
0
  /* 641 */ "j\0"
81
0
  /* 643 */ "# FEntry call\0"
82
0
  /* 657 */ "ret\0"
83
0
};
84
0
#ifdef __GNUC__
85
0
#pragma GCC diagnostic pop
86
0
#endif
87
88
0
  static const uint16_t OpInfo0[] = {
89
0
    0U, // PHI
90
0
    0U, // INLINEASM
91
0
    0U, // INLINEASM_BR
92
0
    0U, // CFI_INSTRUCTION
93
0
    0U, // EH_LABEL
94
0
    0U, // GC_LABEL
95
0
    0U, // ANNOTATION_LABEL
96
0
    0U, // KILL
97
0
    0U, // EXTRACT_SUBREG
98
0
    0U, // INSERT_SUBREG
99
0
    0U, // IMPLICIT_DEF
100
0
    0U, // SUBREG_TO_REG
101
0
    0U, // COPY_TO_REGCLASS
102
0
    425U, // DBG_VALUE
103
0
    622U, // DBG_VALUE_LIST
104
0
    435U, // DBG_INSTR_REF
105
0
    449U, // DBG_PHI
106
0
    457U, // DBG_LABEL
107
0
    0U, // REG_SEQUENCE
108
0
    0U, // COPY
109
0
    418U, // BUNDLE
110
0
    607U, // LIFETIME_START
111
0
    392U, // LIFETIME_END
112
0
    405U, // PSEUDO_PROBE
113
0
    0U, // ARITH_FENCE
114
0
    0U, // STACKMAP
115
0
    644U, // FENTRY_CALL
116
0
    0U, // PATCHPOINT
117
0
    0U, // LOAD_STACK_GUARD
118
0
    0U, // PREALLOCATED_SETUP
119
0
    0U, // PREALLOCATED_ARG
120
0
    0U, // STATEPOINT
121
0
    0U, // LOCAL_ESCAPE
122
0
    0U, // FAULTING_OP
123
0
    0U, // PATCHABLE_OP
124
0
    324U, // PATCHABLE_FUNCTION_ENTER
125
0
    244U, // PATCHABLE_RET
126
0
    370U, // PATCHABLE_FUNCTION_EXIT
127
0
    347U, // PATCHABLE_TAIL_CALL
128
0
    299U, // PATCHABLE_EVENT_CALL
129
0
    275U, // PATCHABLE_TYPED_EVENT_CALL
130
0
    0U, // ICALL_BRANCH_FUNNEL
131
0
    0U, // MEMBARRIER
132
0
    0U, // JUMP_TABLE_DEBUG_INFO
133
0
    0U, // G_ASSERT_SEXT
134
0
    0U, // G_ASSERT_ZEXT
135
0
    0U, // G_ASSERT_ALIGN
136
0
    0U, // G_ADD
137
0
    0U, // G_SUB
138
0
    0U, // G_MUL
139
0
    0U, // G_SDIV
140
0
    0U, // G_UDIV
141
0
    0U, // G_SREM
142
0
    0U, // G_UREM
143
0
    0U, // G_SDIVREM
144
0
    0U, // G_UDIVREM
145
0
    0U, // G_AND
146
0
    0U, // G_OR
147
0
    0U, // G_XOR
148
0
    0U, // G_IMPLICIT_DEF
149
0
    0U, // G_PHI
150
0
    0U, // G_FRAME_INDEX
151
0
    0U, // G_GLOBAL_VALUE
152
0
    0U, // G_CONSTANT_POOL
153
0
    0U, // G_EXTRACT
154
0
    0U, // G_UNMERGE_VALUES
155
0
    0U, // G_INSERT
156
0
    0U, // G_MERGE_VALUES
157
0
    0U, // G_BUILD_VECTOR
158
0
    0U, // G_BUILD_VECTOR_TRUNC
159
0
    0U, // G_CONCAT_VECTORS
160
0
    0U, // G_PTRTOINT
161
0
    0U, // G_INTTOPTR
162
0
    0U, // G_BITCAST
163
0
    0U, // G_FREEZE
164
0
    0U, // G_CONSTANT_FOLD_BARRIER
165
0
    0U, // G_INTRINSIC_FPTRUNC_ROUND
166
0
    0U, // G_INTRINSIC_TRUNC
167
0
    0U, // G_INTRINSIC_ROUND
168
0
    0U, // G_INTRINSIC_LRINT
169
0
    0U, // G_INTRINSIC_ROUNDEVEN
170
0
    0U, // G_READCYCLECOUNTER
171
0
    0U, // G_LOAD
172
0
    0U, // G_SEXTLOAD
173
0
    0U, // G_ZEXTLOAD
174
0
    0U, // G_INDEXED_LOAD
175
0
    0U, // G_INDEXED_SEXTLOAD
176
0
    0U, // G_INDEXED_ZEXTLOAD
177
0
    0U, // G_STORE
178
0
    0U, // G_INDEXED_STORE
179
0
    0U, // G_ATOMIC_CMPXCHG_WITH_SUCCESS
180
0
    0U, // G_ATOMIC_CMPXCHG
181
0
    0U, // G_ATOMICRMW_XCHG
182
0
    0U, // G_ATOMICRMW_ADD
183
0
    0U, // G_ATOMICRMW_SUB
184
0
    0U, // G_ATOMICRMW_AND
185
0
    0U, // G_ATOMICRMW_NAND
186
0
    0U, // G_ATOMICRMW_OR
187
0
    0U, // G_ATOMICRMW_XOR
188
0
    0U, // G_ATOMICRMW_MAX
189
0
    0U, // G_ATOMICRMW_MIN
190
0
    0U, // G_ATOMICRMW_UMAX
191
0
    0U, // G_ATOMICRMW_UMIN
192
0
    0U, // G_ATOMICRMW_FADD
193
0
    0U, // G_ATOMICRMW_FSUB
194
0
    0U, // G_ATOMICRMW_FMAX
195
0
    0U, // G_ATOMICRMW_FMIN
196
0
    0U, // G_ATOMICRMW_UINC_WRAP
197
0
    0U, // G_ATOMICRMW_UDEC_WRAP
198
0
    0U, // G_FENCE
199
0
    0U, // G_PREFETCH
200
0
    0U, // G_BRCOND
201
0
    0U, // G_BRINDIRECT
202
0
    0U, // G_INVOKE_REGION_START
203
0
    0U, // G_INTRINSIC
204
0
    0U, // G_INTRINSIC_W_SIDE_EFFECTS
205
0
    0U, // G_INTRINSIC_CONVERGENT
206
0
    0U, // G_INTRINSIC_CONVERGENT_W_SIDE_EFFECTS
207
0
    0U, // G_ANYEXT
208
0
    0U, // G_TRUNC
209
0
    0U, // G_CONSTANT
210
0
    0U, // G_FCONSTANT
211
0
    0U, // G_VASTART
212
0
    0U, // G_VAARG
213
0
    0U, // G_SEXT
214
0
    0U, // G_SEXT_INREG
215
0
    0U, // G_ZEXT
216
0
    0U, // G_SHL
217
0
    0U, // G_LSHR
218
0
    0U, // G_ASHR
219
0
    0U, // G_FSHL
220
0
    0U, // G_FSHR
221
0
    0U, // G_ROTR
222
0
    0U, // G_ROTL
223
0
    0U, // G_ICMP
224
0
    0U, // G_FCMP
225
0
    0U, // G_SELECT
226
0
    0U, // G_UADDO
227
0
    0U, // G_UADDE
228
0
    0U, // G_USUBO
229
0
    0U, // G_USUBE
230
0
    0U, // G_SADDO
231
0
    0U, // G_SADDE
232
0
    0U, // G_SSUBO
233
0
    0U, // G_SSUBE
234
0
    0U, // G_UMULO
235
0
    0U, // G_SMULO
236
0
    0U, // G_UMULH
237
0
    0U, // G_SMULH
238
0
    0U, // G_UADDSAT
239
0
    0U, // G_SADDSAT
240
0
    0U, // G_USUBSAT
241
0
    0U, // G_SSUBSAT
242
0
    0U, // G_USHLSAT
243
0
    0U, // G_SSHLSAT
244
0
    0U, // G_SMULFIX
245
0
    0U, // G_UMULFIX
246
0
    0U, // G_SMULFIXSAT
247
0
    0U, // G_UMULFIXSAT
248
0
    0U, // G_SDIVFIX
249
0
    0U, // G_UDIVFIX
250
0
    0U, // G_SDIVFIXSAT
251
0
    0U, // G_UDIVFIXSAT
252
0
    0U, // G_FADD
253
0
    0U, // G_FSUB
254
0
    0U, // G_FMUL
255
0
    0U, // G_FMA
256
0
    0U, // G_FMAD
257
0
    0U, // G_FDIV
258
0
    0U, // G_FREM
259
0
    0U, // G_FPOW
260
0
    0U, // G_FPOWI
261
0
    0U, // G_FEXP
262
0
    0U, // G_FEXP2
263
0
    0U, // G_FEXP10
264
0
    0U, // G_FLOG
265
0
    0U, // G_FLOG2
266
0
    0U, // G_FLOG10
267
0
    0U, // G_FLDEXP
268
0
    0U, // G_FFREXP
269
0
    0U, // G_FNEG
270
0
    0U, // G_FPEXT
271
0
    0U, // G_FPTRUNC
272
0
    0U, // G_FPTOSI
273
0
    0U, // G_FPTOUI
274
0
    0U, // G_SITOFP
275
0
    0U, // G_UITOFP
276
0
    0U, // G_FABS
277
0
    0U, // G_FCOPYSIGN
278
0
    0U, // G_IS_FPCLASS
279
0
    0U, // G_FCANONICALIZE
280
0
    0U, // G_FMINNUM
281
0
    0U, // G_FMAXNUM
282
0
    0U, // G_FMINNUM_IEEE
283
0
    0U, // G_FMAXNUM_IEEE
284
0
    0U, // G_FMINIMUM
285
0
    0U, // G_FMAXIMUM
286
0
    0U, // G_GET_FPENV
287
0
    0U, // G_SET_FPENV
288
0
    0U, // G_RESET_FPENV
289
0
    0U, // G_GET_FPMODE
290
0
    0U, // G_SET_FPMODE
291
0
    0U, // G_RESET_FPMODE
292
0
    0U, // G_PTR_ADD
293
0
    0U, // G_PTRMASK
294
0
    0U, // G_SMIN
295
0
    0U, // G_SMAX
296
0
    0U, // G_UMIN
297
0
    0U, // G_UMAX
298
0
    0U, // G_ABS
299
0
    0U, // G_LROUND
300
0
    0U, // G_LLROUND
301
0
    0U, // G_BR
302
0
    0U, // G_BRJT
303
0
    0U, // G_INSERT_VECTOR_ELT
304
0
    0U, // G_EXTRACT_VECTOR_ELT
305
0
    0U, // G_SHUFFLE_VECTOR
306
0
    0U, // G_CTTZ
307
0
    0U, // G_CTTZ_ZERO_UNDEF
308
0
    0U, // G_CTLZ
309
0
    0U, // G_CTLZ_ZERO_UNDEF
310
0
    0U, // G_CTPOP
311
0
    0U, // G_BSWAP
312
0
    0U, // G_BITREVERSE
313
0
    0U, // G_FCEIL
314
0
    0U, // G_FCOS
315
0
    0U, // G_FSIN
316
0
    0U, // G_FSQRT
317
0
    0U, // G_FFLOOR
318
0
    0U, // G_FRINT
319
0
    0U, // G_FNEARBYINT
320
0
    0U, // G_ADDRSPACE_CAST
321
0
    0U, // G_BLOCK_ADDR
322
0
    0U, // G_JUMP_TABLE
323
0
    0U, // G_DYN_STACKALLOC
324
0
    0U, // G_STACKSAVE
325
0
    0U, // G_STACKRESTORE
326
0
    0U, // G_STRICT_FADD
327
0
    0U, // G_STRICT_FSUB
328
0
    0U, // G_STRICT_FMUL
329
0
    0U, // G_STRICT_FDIV
330
0
    0U, // G_STRICT_FREM
331
0
    0U, // G_STRICT_FMA
332
0
    0U, // G_STRICT_FSQRT
333
0
    0U, // G_STRICT_FLDEXP
334
0
    0U, // G_READ_REGISTER
335
0
    0U, // G_WRITE_REGISTER
336
0
    0U, // G_MEMCPY
337
0
    0U, // G_MEMCPY_INLINE
338
0
    0U, // G_MEMMOVE
339
0
    0U, // G_MEMSET
340
0
    0U, // G_BZERO
341
0
    0U, // G_VECREDUCE_SEQ_FADD
342
0
    0U, // G_VECREDUCE_SEQ_FMUL
343
0
    0U, // G_VECREDUCE_FADD
344
0
    0U, // G_VECREDUCE_FMUL
345
0
    0U, // G_VECREDUCE_FMAX
346
0
    0U, // G_VECREDUCE_FMIN
347
0
    0U, // G_VECREDUCE_FMAXIMUM
348
0
    0U, // G_VECREDUCE_FMINIMUM
349
0
    0U, // G_VECREDUCE_ADD
350
0
    0U, // G_VECREDUCE_MUL
351
0
    0U, // G_VECREDUCE_AND
352
0
    0U, // G_VECREDUCE_OR
353
0
    0U, // G_VECREDUCE_XOR
354
0
    0U, // G_VECREDUCE_SMAX
355
0
    0U, // G_VECREDUCE_SMIN
356
0
    0U, // G_VECREDUCE_UMAX
357
0
    0U, // G_VECREDUCE_UMIN
358
0
    0U, // G_SBFX
359
0
    0U, // G_UBFX
360
0
    1166U,  // ADD16mc
361
0
    1166U,  // ADD16mi
362
0
    2190U,  // ADD16mm
363
0
    3214U,  // ADD16mn
364
0
    4238U,  // ADD16mp
365
0
    1166U,  // ADD16mr
366
0
    17550U, // ADD16rc
367
0
    17550U, // ADD16ri
368
0
    18574U, // ADD16rm
369
0
    19598U, // ADD16rn
370
0
    5262U,  // ADD16rp
371
0
    17550U, // ADD16rr
372
0
    1075U,  // ADD8mc
373
0
    1075U,  // ADD8mi
374
0
    2099U,  // ADD8mm
375
0
    3123U,  // ADD8mn
376
0
    4147U,  // ADD8mp
377
0
    1075U,  // ADD8mr
378
0
    17459U, // ADD8rc
379
0
    17459U, // ADD8ri
380
0
    18483U, // ADD8rm
381
0
    19507U, // ADD8rn
382
0
    5171U,  // ADD8rp
383
0
    17459U, // ADD8rr
384
0
    1149U,  // ADDC16mc
385
0
    1149U,  // ADDC16mi
386
0
    2173U,  // ADDC16mm
387
0
    3197U,  // ADDC16mn
388
0
    4221U,  // ADDC16mp
389
0
    1149U,  // ADDC16mr
390
0
    17533U, // ADDC16rc
391
0
    17533U, // ADDC16ri
392
0
    18557U, // ADDC16rm
393
0
    19581U, // ADDC16rn
394
0
    5245U,  // ADDC16rp
395
0
    17533U, // ADDC16rr
396
0
    1052U,  // ADDC8mc
397
0
    1052U,  // ADDC8mi
398
0
    2076U,  // ADDC8mm
399
0
    3100U,  // ADDC8mn
400
0
    4124U,  // ADDC8mp
401
0
    1052U,  // ADDC8mr
402
0
    17436U, // ADDC8rc
403
0
    17436U, // ADDC8ri
404
0
    18460U, // ADDC8rm
405
0
    19484U, // ADDC8rn
406
0
    5148U,  // ADDC8rp
407
0
    17436U, // ADDC8rr
408
0
    589U, // ADDframe
409
0
    39120U, // ADJCALLSTACKDOWN
410
0
    39139U, // ADJCALLSTACKUP
411
0
    1171U,  // AND16mc
412
0
    1171U,  // AND16mi
413
0
    2195U,  // AND16mm
414
0
    3219U,  // AND16mn
415
0
    4243U,  // AND16mp
416
0
    1171U,  // AND16mr
417
0
    17555U, // AND16rc
418
0
    17555U, // AND16ri
419
0
    18579U, // AND16rm
420
0
    19603U, // AND16rn
421
0
    5267U,  // AND16rp
422
0
    17555U, // AND16rr
423
0
    1082U,  // AND8mc
424
0
    1082U,  // AND8mi
425
0
    2106U,  // AND8mm
426
0
    3130U,  // AND8mn
427
0
    4154U,  // AND8mp
428
0
    1082U,  // AND8mr
429
0
    17466U, // AND8rc
430
0
    17466U, // AND8ri
431
0
    18490U, // AND8rm
432
0
    19514U, // AND8rn
433
0
    5178U,  // AND8rp
434
0
    17466U, // AND8rr
435
0
    1155U,  // BIC16mc
436
0
    1155U,  // BIC16mi
437
0
    2179U,  // BIC16mm
438
0
    3203U,  // BIC16mn
439
0
    4227U,  // BIC16mp
440
0
    1155U,  // BIC16mr
441
0
    17539U, // BIC16rc
442
0
    17539U, // BIC16ri
443
0
    18563U, // BIC16rm
444
0
    19587U, // BIC16rn
445
0
    5251U,  // BIC16rp
446
0
    17539U, // BIC16rr
447
0
    1060U,  // BIC8mc
448
0
    1060U,  // BIC8mi
449
0
    2084U,  // BIC8mm
450
0
    3108U,  // BIC8mn
451
0
    4132U,  // BIC8mp
452
0
    1060U,  // BIC8mr
453
0
    17444U, // BIC8rc
454
0
    17444U, // BIC8ri
455
0
    18468U, // BIC8rm
456
0
    19492U, // BIC8rn
457
0
    5156U,  // BIC8rp
458
0
    17444U, // BIC8rr
459
0
    1212U,  // BIS16mc
460
0
    1212U,  // BIS16mi
461
0
    2236U,  // BIS16mm
462
0
    3260U,  // BIS16mn
463
0
    4284U,  // BIS16mp
464
0
    1212U,  // BIS16mr
465
0
    17596U, // BIS16rc
466
0
    17596U, // BIS16ri
467
0
    18620U, // BIS16rm
468
0
    19644U, // BIS16rn
469
0
    5308U,  // BIS16rp
470
0
    17596U, // BIS16rr
471
0
    1111U,  // BIS8mc
472
0
    1111U,  // BIS8mi
473
0
    2135U,  // BIS8mm
474
0
    3159U,  // BIS8mn
475
0
    4183U,  // BIS8mp
476
0
    1111U,  // BIS8mr
477
0
    17495U, // BIS8rc
478
0
    17495U, // BIS8ri
479
0
    18519U, // BIS8rm
480
0
    19543U, // BIS8rn
481
0
    5207U,  // BIS8rp
482
0
    17495U, // BIS8rr
483
0
    1217U,  // BIT16mc
484
0
    1217U,  // BIT16mi
485
0
    2241U,  // BIT16mm
486
0
    3265U,  // BIT16mn
487
0
    4289U,  // BIT16mp
488
0
    1217U,  // BIT16mr
489
0
    7361U,  // BIT16rc
490
0
    7361U,  // BIT16ri
491
0
    8385U,  // BIT16rm
492
0
    9409U,  // BIT16rn
493
0
    10433U, // BIT16rp
494
0
    7361U,  // BIT16rr
495
0
    1118U,  // BIT8mc
496
0
    1118U,  // BIT8mi
497
0
    2142U,  // BIT8mm
498
0
    3166U,  // BIT8mn
499
0
    4190U,  // BIT8mp
500
0
    1118U,  // BIT8mr
501
0
    7262U,  // BIT8rc
502
0
    7262U,  // BIT8ri
503
0
    8286U,  // BIT8rm
504
0
    9310U,  // BIT8rn
505
0
    10334U, // BIT8rp
506
0
    7262U,  // BIT8rr
507
0
    55475U, // Bi
508
0
    11443U, // Bm
509
0
    55475U, // Br
510
0
    55454U, // CALLi
511
0
    11422U, // CALLm
512
0
    12446U, // CALLn
513
0
    13470U, // CALLp
514
0
    55454U, // CALLr
515
0
    1188U,  // CMP16mc
516
0
    1188U,  // CMP16mi
517
0
    2212U,  // CMP16mm
518
0
    3236U,  // CMP16mn
519
0
    4260U,  // CMP16mp
520
0
    1188U,  // CMP16mr
521
0
    7332U,  // CMP16rc
522
0
    7332U,  // CMP16ri
523
0
    8356U,  // CMP16rm
524
0
    9380U,  // CMP16rn
525
0
    10404U, // CMP16rp
526
0
    7332U,  // CMP16rr
527
0
    1097U,  // CMP8mc
528
0
    1097U,  // CMP8mi
529
0
    2121U,  // CMP8mm
530
0
    3145U,  // CMP8mn
531
0
    4169U,  // CMP8mp
532
0
    1097U,  // CMP8mr
533
0
    7241U,  // CMP8rc
534
0
    7241U,  // CMP8ri
535
0
    8265U,  // CMP8rm
536
0
    9289U,  // CMP8rn
537
0
    10313U, // CMP8rp
538
0
    7241U,  // CMP8rr
539
0
    1165U,  // DADD16mc
540
0
    1165U,  // DADD16mi
541
0
    2189U,  // DADD16mm
542
0
    3213U,  // DADD16mn
543
0
    4237U,  // DADD16mp
544
0
    1165U,  // DADD16mr
545
0
    17549U, // DADD16rc
546
0
    17549U, // DADD16ri
547
0
    18573U, // DADD16rm
548
0
    19597U, // DADD16rn
549
0
    5261U,  // DADD16rp
550
0
    17549U, // DADD16rr
551
0
    1074U,  // DADD8mc
552
0
    1074U,  // DADD8mi
553
0
    2098U,  // DADD8mm
554
0
    3122U,  // DADD8mn
555
0
    4146U,  // DADD8mp
556
0
    1074U,  // DADD8mr
557
0
    17458U, // DADD8rc
558
0
    17458U, // DADD8ri
559
0
    18482U, // DADD8rm
560
0
    19506U, // DADD8rn
561
0
    5170U,  // DADD8rp
562
0
    17458U, // DADD8rr
563
0
    14978U, // JCC
564
0
    15529U, // JMP
565
0
    1227U,  // MOV16mc
566
0
    1227U,  // MOV16mi
567
0
    2251U,  // MOV16mm
568
0
    3275U,  // MOV16mn
569
0
    1227U,  // MOV16mr
570
0
    7371U,  // MOV16rc
571
0
    7371U,  // MOV16ri
572
0
    8395U,  // MOV16rm
573
0
    9419U,  // MOV16rn
574
0
    20683U, // MOV16rp
575
0
    7371U,  // MOV16rr
576
0
    1125U,  // MOV8mc
577
0
    1125U,  // MOV8mi
578
0
    2149U,  // MOV8mm
579
0
    3173U,  // MOV8mn
580
0
    1125U,  // MOV8mr
581
0
    7269U,  // MOV8rc
582
0
    7269U,  // MOV8ri
583
0
    8293U,  // MOV8rm
584
0
    9317U,  // MOV8rn
585
0
    20581U, // MOV8rp
586
0
    7269U,  // MOV8rr
587
0
    8293U,  // MOVZX16rm8
588
0
    7269U,  // MOVZX16rr8
589
0
    55470U, // POP16r
590
0
    55448U, // PUSH16c
591
0
    55448U, // PUSH16i
592
0
    55448U, // PUSH16r
593
0
    55361U, // PUSH8r
594
0
    658U, // RET
595
0
    637U, // RETI
596
0
    11265U, // RRA16m
597
0
    12289U, // RRA16n
598
0
    13313U, // RRA16p
599
0
    55297U, // RRA16r
600
0
    11270U, // RRA8m
601
0
    12294U, // RRA8n
602
0
    13318U, // RRA8p
603
0
    55302U, // RRA8r
604
0
    11400U, // RRC16m
605
0
    12424U, // RRC16n
606
0
    13448U, // RRC16p
607
0
    55432U, // RRC16r
608
0
    11307U, // RRC8m
609
0
    12331U, // RRC8n
610
0
    13355U, // RRC8p
611
0
    55339U, // RRC8r
612
0
    0U, // Rrcl16
613
0
    0U, // Rrcl8
614
0
    11462U, // SEXT16m
615
0
    12486U, // SEXT16n
616
0
    13510U, // SEXT16p
617
0
    55494U, // SEXT16r
618
0
    1138U,  // SUB16mc
619
0
    1138U,  // SUB16mi
620
0
    2162U,  // SUB16mm
621
0
    3186U,  // SUB16mn
622
0
    4210U,  // SUB16mp
623
0
    1138U,  // SUB16mr
624
0
    17522U, // SUB16rc
625
0
    17522U, // SUB16ri
626
0
    18546U, // SUB16rm
627
0
    19570U, // SUB16rn
628
0
    5234U,  // SUB16rp
629
0
    17522U, // SUB16rr
630
0
    1037U,  // SUB8mc
631
0
    1037U,  // SUB8mi
632
0
    2061U,  // SUB8mm
633
0
    3085U,  // SUB8mn
634
0
    4109U,  // SUB8mp
635
0
    1037U,  // SUB8mr
636
0
    17421U, // SUB8rc
637
0
    17421U, // SUB8ri
638
0
    18445U, // SUB8rm
639
0
    19469U, // SUB8rn
640
0
    5133U,  // SUB8rp
641
0
    17421U, // SUB8rr
642
0
    1143U,  // SUBC16mc
643
0
    1143U,  // SUBC16mi
644
0
    2167U,  // SUBC16mm
645
0
    3191U,  // SUBC16mn
646
0
    4215U,  // SUBC16mp
647
0
    1143U,  // SUBC16mr
648
0
    17527U, // SUBC16rc
649
0
    17527U, // SUBC16ri
650
0
    18551U, // SUBC16rm
651
0
    19575U, // SUBC16rn
652
0
    5239U,  // SUBC16rp
653
0
    17527U, // SUBC16rr
654
0
    1044U,  // SUBC8mc
655
0
    1044U,  // SUBC8mi
656
0
    2068U,  // SUBC8mm
657
0
    3092U,  // SUBC8mn
658
0
    4116U,  // SUBC8mp
659
0
    1044U,  // SUBC8mr
660
0
    17428U, // SUBC8rc
661
0
    17428U, // SUBC8ri
662
0
    18452U, // SUBC8rm
663
0
    19476U, // SUBC8rn
664
0
    5140U,  // SUBC8rp
665
0
    17428U, // SUBC8rr
666
0
    11372U, // SWPB16m
667
0
    12396U, // SWPB16n
668
0
    13420U, // SWPB16p
669
0
    55404U, // SWPB16r
670
0
    512U, // Select16
671
0
    572U, // Select8
672
0
    482U, // Shl16
673
0
    544U, // Shl8
674
0
    467U, // Sra16
675
0
    530U, // Sra8
676
0
    497U, // Srl16
677
0
    558U, // Srl8
678
0
    1207U,  // XOR16mc
679
0
    1207U,  // XOR16mi
680
0
    2231U,  // XOR16mm
681
0
    3255U,  // XOR16mn
682
0
    4279U,  // XOR16mp
683
0
    1207U,  // XOR16mr
684
0
    17591U, // XOR16rc
685
0
    17591U, // XOR16ri
686
0
    18615U, // XOR16rm
687
0
    19639U, // XOR16rn
688
0
    5303U,  // XOR16rp
689
0
    17591U, // XOR16rr
690
0
    1104U,  // XOR8mc
691
0
    1104U,  // XOR8mi
692
0
    2128U,  // XOR8mm
693
0
    3152U,  // XOR8mn
694
0
    4176U,  // XOR8mp
695
0
    1104U,  // XOR8mr
696
0
    17488U, // XOR8rc
697
0
    17488U, // XOR8ri
698
0
    18512U, // XOR8rm
699
0
    19536U, // XOR8rn
700
0
    5200U,  // XOR8rp
701
0
    17488U, // XOR8rr
702
0
    7269U,  // ZEXT16r
703
0
  };
704
705
  // Emit the opcode for the instruction.
706
0
  uint32_t Bits = 0;
707
0
  Bits |= OpInfo0[MI->getOpcode()] << 0;
708
0
  if (Bits == 0)
709
0
    return {nullptr, Bits};
710
0
  return {AsmStrs+(Bits & 1023)-1, Bits};
711
712
0
}
713
/// printInstruction - This method is automatically generated by tablegen
714
/// from the instruction set description.
715
LLVM_NO_PROFILE_INSTRUMENT_FUNCTION
716
void MSP430InstPrinter::printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O) {
717
  O << "\t";
718
719
  auto MnemonicInfo = getMnemonic(MI);
720
721
  O << MnemonicInfo.first;
722
723
  uint32_t Bits = MnemonicInfo.second;
724
  assert(Bits != 0 && "Cannot print this instruction.");
725
726
  // Fragment 0 encoded into 4 bits for 16 unique commands.
727
  switch ((Bits >> 10) & 15) {
728
  default: llvm_unreachable("Invalid command number.");
729
  case 0:
730
    // DBG_VALUE, DBG_VALUE_LIST, DBG_INSTR_REF, DBG_PHI, DBG_LABEL, BUNDLE, ...
731
    return;
732
    break;
733
  case 1:
734
    // ADD16mc, ADD16mi, ADD16mr, ADD16rc, ADD16ri, ADD16rr, ADD8mc, ADD8mi, ...
735
    printOperand(MI, 2, O);
736
    O << ", ";
737
    break;
738
  case 2:
739
    // ADD16mm, ADD16rm, ADD8mm, ADD8rm, ADDC16mm, ADDC16rm, ADDC8mm, ADDC8rm...
740
    printSrcMemOperand(MI, 2, O);
741
    O << ", ";
742
    break;
743
  case 3:
744
    // ADD16mn, ADD16rn, ADD8mn, ADD8rn, ADDC16mn, ADDC16rn, ADDC8mn, ADDC8rn...
745
    printIndRegOperand(MI, 2, O);
746
    O << ", ";
747
    break;
748
  case 4:
749
    // ADD16mp, ADD8mp, ADDC16mp, ADDC8mp, AND16mp, AND8mp, BIC16mp, BIC8mp, ...
750
    printPostIndRegOperand(MI, 2, O);
751
    O << ", ";
752
    break;
753
  case 5:
754
    // ADD16rp, ADD8rp, ADDC16rp, ADDC8rp, AND16rp, AND8rp, BIC16rp, BIC8rp, ...
755
    printPostIndRegOperand(MI, 3, O);
756
    O << ", ";
757
    printOperand(MI, 0, O);
758
    return;
759
    break;
760
  case 6:
761
    // ADJCALLSTACKDOWN, ADJCALLSTACKUP, Bi, Br, CALLi, CALLr, POP16r, PUSH16...
762
    printOperand(MI, 0, O);
763
    break;
764
  case 7:
765
    // BIT16rc, BIT16ri, BIT16rr, BIT8rc, BIT8ri, BIT8rr, CMP16rc, CMP16ri, C...
766
    printOperand(MI, 1, O);
767
    O << ", ";
768
    printOperand(MI, 0, O);
769
    return;
770
    break;
771
  case 8:
772
    // BIT16rm, BIT8rm, CMP16rm, CMP8rm, MOV16rm, MOV8rm, MOVZX16rm8
773
    printSrcMemOperand(MI, 1, O);
774
    O << ", ";
775
    printOperand(MI, 0, O);
776
    return;
777
    break;
778
  case 9:
779
    // BIT16rn, BIT8rn, CMP16rn, CMP8rn, MOV16rn, MOV8rn
780
    printIndRegOperand(MI, 1, O);
781
    O << ", ";
782
    printOperand(MI, 0, O);
783
    return;
784
    break;
785
  case 10:
786
    // BIT16rp, BIT8rp, CMP16rp, CMP8rp
787
    printPostIndRegOperand(MI, 1, O);
788
    O << ", ";
789
    printOperand(MI, 0, O);
790
    return;
791
    break;
792
  case 11:
793
    // Bm, CALLm, RRA16m, RRA8m, RRC16m, RRC8m, SEXT16m, SWPB16m
794
    printSrcMemOperand(MI, 0, O);
795
    return;
796
    break;
797
  case 12:
798
    // CALLn, RRA16n, RRA8n, RRC16n, RRC8n, SEXT16n, SWPB16n
799
    printIndRegOperand(MI, 0, O);
800
    return;
801
    break;
802
  case 13:
803
    // CALLp, RRA16p, RRA8p, RRC16p, RRC8p, SEXT16p, SWPB16p
804
    printPostIndRegOperand(MI, 0, O);
805
    return;
806
    break;
807
  case 14:
808
    // JCC
809
    printCCOperand(MI, 1, O);
810
    O << "\t";
811
    printPCRelImmOperand(MI, 0, O);
812
    return;
813
    break;
814
  case 15:
815
    // JMP
816
    printPCRelImmOperand(MI, 0, O);
817
    return;
818
    break;
819
  }
820
821
822
  // Fragment 1 encoded into 2 bits for 4 unique commands.
823
  switch ((Bits >> 14) & 3) {
824
  default: llvm_unreachable("Invalid command number.");
825
  case 0:
826
    // ADD16mc, ADD16mi, ADD16mm, ADD16mn, ADD16mp, ADD16mr, ADD8mc, ADD8mi, ...
827
    printSrcMemOperand(MI, 0, O);
828
    return;
829
    break;
830
  case 1:
831
    // ADD16rc, ADD16ri, ADD16rm, ADD16rn, ADD16rr, ADD8rc, ADD8ri, ADD8rm, A...
832
    printOperand(MI, 0, O);
833
    return;
834
    break;
835
  case 2:
836
    // ADJCALLSTACKDOWN, ADJCALLSTACKUP
837
    O << ' ';
838
    printOperand(MI, 1, O);
839
    return;
840
    break;
841
  case 3:
842
    // Bi, Br, CALLi, CALLr, POP16r, PUSH16c, PUSH16i, PUSH16r, PUSH8r, RRA16...
843
    return;
844
    break;
845
  }
846
847
}
848
849
850
/// getRegisterName - This method is automatically generated by tblgen
851
/// from the register set description.  This returns the assembler name
852
/// for the specified register.
853
0
const char *MSP430InstPrinter::getRegisterName(MCRegister Reg) {
854
0
  unsigned RegNo = Reg.id();
855
0
  assert(RegNo && RegNo < 33 && "Invalid register number!");
856
857
858
0
#ifdef __GNUC__
859
0
#pragma GCC diagnostic push
860
0
#pragma GCC diagnostic ignored "-Woverlength-strings"
861
0
#endif
862
0
  static const char AsmStrs[] = {
863
0
  /* 0 */ "r10\0"
864
0
  /* 4 */ "r0\0"
865
0
  /* 7 */ "r11\0"
866
0
  /* 11 */ "r1\0"
867
0
  /* 14 */ "r12\0"
868
0
  /* 18 */ "r2\0"
869
0
  /* 21 */ "r13\0"
870
0
  /* 25 */ "r3\0"
871
0
  /* 28 */ "r14\0"
872
0
  /* 32 */ "r4\0"
873
0
  /* 35 */ "r15\0"
874
0
  /* 39 */ "r5\0"
875
0
  /* 42 */ "r6\0"
876
0
  /* 45 */ "r7\0"
877
0
  /* 48 */ "r8\0"
878
0
  /* 51 */ "r9\0"
879
0
};
880
0
#ifdef __GNUC__
881
0
#pragma GCC diagnostic pop
882
0
#endif
883
884
0
  static const uint8_t RegAsmOffset[] = {
885
0
    25, 25, 4, 4, 11, 11, 18, 18, 32, 39, 42, 45, 48, 51, 
886
0
    0, 7, 14, 21, 28, 35, 32, 39, 42, 45, 48, 51, 0, 7, 
887
0
    14, 21, 28, 35, 
888
0
  };
889
890
0
  assert (*(AsmStrs+RegAsmOffset[RegNo-1]) &&
891
0
          "Invalid alt name index for register!");
892
0
  return AsmStrs+RegAsmOffset[RegNo-1];
893
0
}
894
895
#ifdef PRINT_ALIAS_INSTR
896
#undef PRINT_ALIAS_INSTR
897
898
0
bool MSP430InstPrinter::printAliasInstr(const MCInst *MI, uint64_t Address, raw_ostream &OS) {
899
0
  static const PatternsForOpcode OpToPatterns[] = {
900
0
    {MSP430::ADD16mc, 0, 2 },
901
0
    {MSP430::ADD16rc, 2, 2 },
902
0
    {MSP430::ADD8mc, 4, 2 },
903
0
    {MSP430::ADD8rc, 6, 2 },
904
0
    {MSP430::ADDC16mc, 8, 1 },
905
0
    {MSP430::ADDC16rc, 9, 1 },
906
0
    {MSP430::ADDC8mc, 10, 1 },
907
0
    {MSP430::ADDC8rc, 11, 1 },
908
0
    {MSP430::BIC16rc, 12, 4 },
909
0
    {MSP430::BIS16rc, 16, 4 },
910
0
    {MSP430::CMP16mc, 20, 1 },
911
0
    {MSP430::CMP16rc, 21, 1 },
912
0
    {MSP430::CMP8mc, 22, 1 },
913
0
    {MSP430::CMP8rc, 23, 1 },
914
0
    {MSP430::DADD16mc, 24, 1 },
915
0
    {MSP430::DADD16rc, 25, 1 },
916
0
    {MSP430::DADD8mc, 26, 1 },
917
0
    {MSP430::DADD8rc, 27, 1 },
918
0
    {MSP430::MOV16mc, 28, 1 },
919
0
    {MSP430::MOV16rc, 29, 2 },
920
0
    {MSP430::MOV8mc, 31, 1 },
921
0
    {MSP430::MOV8rc, 32, 1 },
922
0
    {MSP430::SUB16mc, 33, 2 },
923
0
    {MSP430::SUB16rc, 35, 2 },
924
0
    {MSP430::SUB8mc, 37, 2 },
925
0
    {MSP430::SUB8rc, 39, 2 },
926
0
    {MSP430::SUBC16mc, 41, 1 },
927
0
    {MSP430::SUBC16rc, 42, 1 },
928
0
    {MSP430::SUBC8mc, 43, 1 },
929
0
    {MSP430::SUBC8rc, 44, 1 },
930
0
    {MSP430::XOR16mc, 45, 1 },
931
0
    {MSP430::XOR16rc, 46, 1 },
932
0
    {MSP430::XOR8mc, 47, 1 },
933
0
    {MSP430::XOR8rc, 48, 1 },
934
0
  };
935
936
0
  static const AliasPattern Patterns[] = {
937
    // MSP430::ADD16mc - 0
938
0
    {0, 0, 3, 3 },
939
0
    {9, 3, 3, 3 },
940
    // MSP430::ADD16rc - 2
941
0
    {19, 6, 3, 3 },
942
0
    {26, 9, 3, 3 },
943
    // MSP430::ADD8mc - 4
944
0
    {34, 12, 3, 3 },
945
0
    {45, 15, 3, 3 },
946
    // MSP430::ADD8rc - 6
947
0
    {57, 18, 3, 3 },
948
0
    {66, 21, 3, 3 },
949
    // MSP430::ADDC16mc - 8
950
0
    {76, 24, 3, 3 },
951
    // MSP430::ADDC16rc - 9
952
0
    {85, 27, 3, 3 },
953
    // MSP430::ADDC8mc - 10
954
0
    {92, 30, 3, 3 },
955
    // MSP430::ADDC8rc - 11
956
0
    {103, 33, 3, 3 },
957
    // MSP430::BIC16rc - 12
958
0
    {112, 36, 3, 3 },
959
0
    {117, 39, 3, 3 },
960
0
    {122, 42, 3, 3 },
961
0
    {127, 45, 3, 3 },
962
    // MSP430::BIS16rc - 16
963
0
    {132, 48, 3, 3 },
964
0
    {137, 51, 3, 3 },
965
0
    {142, 54, 3, 3 },
966
0
    {147, 57, 3, 3 },
967
    // MSP430::CMP16mc - 20
968
0
    {152, 60, 3, 3 },
969
    // MSP430::CMP16rc - 21
970
0
    {161, 63, 2, 2 },
971
    // MSP430::CMP8mc - 22
972
0
    {168, 65, 3, 3 },
973
    // MSP430::CMP8rc - 23
974
0
    {179, 68, 2, 2 },
975
    // MSP430::DADD16mc - 24
976
0
    {188, 70, 3, 3 },
977
    // MSP430::DADD16rc - 25
978
0
    {198, 73, 3, 3 },
979
    // MSP430::DADD8mc - 26
980
0
    {206, 76, 3, 3 },
981
    // MSP430::DADD8rc - 27
982
0
    {218, 79, 3, 3 },
983
    // MSP430::MOV16mc - 28
984
0
    {228, 82, 3, 3 },
985
    // MSP430::MOV16rc - 29
986
0
    {237, 85, 2, 2 },
987
0
    {241, 87, 2, 2 },
988
    // MSP430::MOV8mc - 31
989
0
    {248, 89, 3, 3 },
990
    // MSP430::MOV8rc - 32
991
0
    {259, 92, 2, 2 },
992
    // MSP430::SUB16mc - 33
993
0
    {268, 94, 3, 3 },
994
0
    {277, 97, 3, 3 },
995
    // MSP430::SUB16rc - 35
996
0
    {287, 100, 3, 3 },
997
0
    {294, 103, 3, 3 },
998
    // MSP430::SUB8mc - 37
999
0
    {302, 106, 3, 3 },
1000
0
    {313, 109, 3, 3 },
1001
    // MSP430::SUB8rc - 39
1002
0
    {325, 112, 3, 3 },
1003
0
    {334, 115, 3, 3 },
1004
    // MSP430::SUBC16mc - 41
1005
0
    {344, 118, 3, 3 },
1006
    // MSP430::SUBC16rc - 42
1007
0
    {353, 121, 3, 3 },
1008
    // MSP430::SUBC8mc - 43
1009
0
    {360, 124, 3, 3 },
1010
    // MSP430::SUBC8rc - 44
1011
0
    {371, 127, 3, 3 },
1012
    // MSP430::XOR16mc - 45
1013
0
    {380, 130, 3, 3 },
1014
    // MSP430::XOR16rc - 46
1015
0
    {389, 133, 3, 3 },
1016
    // MSP430::XOR8mc - 47
1017
0
    {396, 136, 3, 3 },
1018
    // MSP430::XOR8rc - 48
1019
0
    {407, 139, 3, 3 },
1020
0
  };
1021
1022
0
  static const AliasPatternCond Conds[] = {
1023
    // (ADD16mc memdst:$dst, 1) - 0
1024
0
    {AliasPatternCond::K_Ignore, 0},
1025
0
    {AliasPatternCond::K_Ignore, 0},
1026
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1027
    // (ADD16mc memdst:$dst, 2) - 3
1028
0
    {AliasPatternCond::K_Ignore, 0},
1029
0
    {AliasPatternCond::K_Ignore, 0},
1030
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1031
    // (ADD16rc GR16:$dst, 1) - 6
1032
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1033
0
    {AliasPatternCond::K_Ignore, 0},
1034
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1035
    // (ADD16rc GR16:$dst, 2) - 9
1036
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1037
0
    {AliasPatternCond::K_Ignore, 0},
1038
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1039
    // (ADD8mc memdst:$dst, 1) - 12
1040
0
    {AliasPatternCond::K_Ignore, 0},
1041
0
    {AliasPatternCond::K_Ignore, 0},
1042
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1043
    // (ADD8mc memdst:$dst, 2) - 15
1044
0
    {AliasPatternCond::K_Ignore, 0},
1045
0
    {AliasPatternCond::K_Ignore, 0},
1046
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1047
    // (ADD8rc GR8:$dst, 1) - 18
1048
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1049
0
    {AliasPatternCond::K_Ignore, 0},
1050
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1051
    // (ADD8rc GR8:$dst, 2) - 21
1052
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1053
0
    {AliasPatternCond::K_Ignore, 0},
1054
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1055
    // (ADDC16mc memdst:$dst, 0) - 24
1056
0
    {AliasPatternCond::K_Ignore, 0},
1057
0
    {AliasPatternCond::K_Ignore, 0},
1058
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1059
    // (ADDC16rc GR16:$dst, 0) - 27
1060
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1061
0
    {AliasPatternCond::K_Ignore, 0},
1062
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1063
    // (ADDC8mc memdst:$dst, 0) - 30
1064
0
    {AliasPatternCond::K_Ignore, 0},
1065
0
    {AliasPatternCond::K_Ignore, 0},
1066
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1067
    // (ADDC8rc GR8:$dst, 0) - 33
1068
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1069
0
    {AliasPatternCond::K_Ignore, 0},
1070
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1071
    // (BIC16rc SR, 8) - 36
1072
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1073
0
    {AliasPatternCond::K_Ignore, 0},
1074
0
    {AliasPatternCond::K_Imm, uint32_t(8)},
1075
    // (BIC16rc SR, 1) - 39
1076
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1077
0
    {AliasPatternCond::K_Ignore, 0},
1078
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1079
    // (BIC16rc SR, 4) - 42
1080
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1081
0
    {AliasPatternCond::K_Ignore, 0},
1082
0
    {AliasPatternCond::K_Imm, uint32_t(4)},
1083
    // (BIC16rc SR, 2) - 45
1084
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1085
0
    {AliasPatternCond::K_Ignore, 0},
1086
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1087
    // (BIS16rc SR, 8) - 48
1088
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1089
0
    {AliasPatternCond::K_Ignore, 0},
1090
0
    {AliasPatternCond::K_Imm, uint32_t(8)},
1091
    // (BIS16rc SR, 1) - 51
1092
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1093
0
    {AliasPatternCond::K_Ignore, 0},
1094
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1095
    // (BIS16rc SR, 4) - 54
1096
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1097
0
    {AliasPatternCond::K_Ignore, 0},
1098
0
    {AliasPatternCond::K_Imm, uint32_t(4)},
1099
    // (BIS16rc SR, 2) - 57
1100
0
    {AliasPatternCond::K_Reg, MSP430::SR},
1101
0
    {AliasPatternCond::K_Ignore, 0},
1102
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1103
    // (CMP16mc memdst:$dst, 0) - 60
1104
0
    {AliasPatternCond::K_Ignore, 0},
1105
0
    {AliasPatternCond::K_Ignore, 0},
1106
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1107
    // (CMP16rc GR16:$dst, 0) - 63
1108
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1109
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1110
    // (CMP8mc memdst:$dst, 0) - 65
1111
0
    {AliasPatternCond::K_Ignore, 0},
1112
0
    {AliasPatternCond::K_Ignore, 0},
1113
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1114
    // (CMP8rc GR8:$dst, 0) - 68
1115
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1116
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1117
    // (DADD16mc memdst:$dst, 0) - 70
1118
0
    {AliasPatternCond::K_Ignore, 0},
1119
0
    {AliasPatternCond::K_Ignore, 0},
1120
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1121
    // (DADD16rc GR16:$dst, 0) - 73
1122
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1123
0
    {AliasPatternCond::K_Ignore, 0},
1124
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1125
    // (DADD8mc memdst:$dst, 0) - 76
1126
0
    {AliasPatternCond::K_Ignore, 0},
1127
0
    {AliasPatternCond::K_Ignore, 0},
1128
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1129
    // (DADD8rc GR8:$dst, 0) - 79
1130
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1131
0
    {AliasPatternCond::K_Ignore, 0},
1132
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1133
    // (MOV16mc memdst:$dst, 0) - 82
1134
0
    {AliasPatternCond::K_Ignore, 0},
1135
0
    {AliasPatternCond::K_Ignore, 0},
1136
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1137
    // (MOV16rc CG, 0) - 85
1138
0
    {AliasPatternCond::K_Reg, MSP430::CG},
1139
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1140
    // (MOV16rc GR16:$dst, 0) - 87
1141
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1142
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1143
    // (MOV8mc memdst:$dst, 0) - 89
1144
0
    {AliasPatternCond::K_Ignore, 0},
1145
0
    {AliasPatternCond::K_Ignore, 0},
1146
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1147
    // (MOV8rc GR8:$dst, 0) - 92
1148
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1149
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1150
    // (SUB16mc memdst:$dst, 1) - 94
1151
0
    {AliasPatternCond::K_Ignore, 0},
1152
0
    {AliasPatternCond::K_Ignore, 0},
1153
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1154
    // (SUB16mc memdst:$dst, 2) - 97
1155
0
    {AliasPatternCond::K_Ignore, 0},
1156
0
    {AliasPatternCond::K_Ignore, 0},
1157
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1158
    // (SUB16rc GR16:$dst, 1) - 100
1159
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1160
0
    {AliasPatternCond::K_Ignore, 0},
1161
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1162
    // (SUB16rc GR16:$dst, 2) - 103
1163
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1164
0
    {AliasPatternCond::K_Ignore, 0},
1165
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1166
    // (SUB8mc memdst:$dst, 1) - 106
1167
0
    {AliasPatternCond::K_Ignore, 0},
1168
0
    {AliasPatternCond::K_Ignore, 0},
1169
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1170
    // (SUB8mc memdst:$dst, 2) - 109
1171
0
    {AliasPatternCond::K_Ignore, 0},
1172
0
    {AliasPatternCond::K_Ignore, 0},
1173
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1174
    // (SUB8rc GR8:$dst, 1) - 112
1175
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1176
0
    {AliasPatternCond::K_Ignore, 0},
1177
0
    {AliasPatternCond::K_Imm, uint32_t(1)},
1178
    // (SUB8rc GR8:$dst, 2) - 115
1179
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1180
0
    {AliasPatternCond::K_Ignore, 0},
1181
0
    {AliasPatternCond::K_Imm, uint32_t(2)},
1182
    // (SUBC16mc memdst:$dst, 0) - 118
1183
0
    {AliasPatternCond::K_Ignore, 0},
1184
0
    {AliasPatternCond::K_Ignore, 0},
1185
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1186
    // (SUBC16rc GR16:$dst, 0) - 121
1187
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1188
0
    {AliasPatternCond::K_Ignore, 0},
1189
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1190
    // (SUBC8mc memdst:$dst, 0) - 124
1191
0
    {AliasPatternCond::K_Ignore, 0},
1192
0
    {AliasPatternCond::K_Ignore, 0},
1193
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1194
    // (SUBC8rc GR8:$dst, 0) - 127
1195
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1196
0
    {AliasPatternCond::K_Ignore, 0},
1197
0
    {AliasPatternCond::K_Imm, uint32_t(0)},
1198
    // (XOR16mc memdst:$dst, -1) - 130
1199
0
    {AliasPatternCond::K_Ignore, 0},
1200
0
    {AliasPatternCond::K_Ignore, 0},
1201
0
    {AliasPatternCond::K_Imm, uint32_t(-1)},
1202
    // (XOR16rc GR16:$dst, -1) - 133
1203
0
    {AliasPatternCond::K_RegClass, MSP430::GR16RegClassID},
1204
0
    {AliasPatternCond::K_Ignore, 0},
1205
0
    {AliasPatternCond::K_Imm, uint32_t(-1)},
1206
    // (XOR8mc memdst:$dst, -1) - 136
1207
0
    {AliasPatternCond::K_Ignore, 0},
1208
0
    {AliasPatternCond::K_Ignore, 0},
1209
0
    {AliasPatternCond::K_Imm, uint32_t(-1)},
1210
    // (XOR8rc GR8:$dst, -1) - 139
1211
0
    {AliasPatternCond::K_RegClass, MSP430::GR8RegClassID},
1212
0
    {AliasPatternCond::K_Ignore, 0},
1213
0
    {AliasPatternCond::K_Imm, uint32_t(-1)},
1214
0
  };
1215
1216
0
  static const char AsmStrings[] =
1217
0
    /* 0 */ "inc  $\xFF\x01\x01\0"
1218
0
    /* 9 */ "incd $\xFF\x01\x01\0"
1219
0
    /* 19 */ "inc $\x01\0"
1220
0
    /* 26 */ "incd  $\x01\0"
1221
0
    /* 34 */ "inc.b $\xFF\x01\x01\0"
1222
0
    /* 45 */ "incd.b  $\xFF\x01\x01\0"
1223
0
    /* 57 */ "inc.b $\x01\0"
1224
0
    /* 66 */ "incd.b  $\x01\0"
1225
0
    /* 76 */ "adc $\xFF\x01\x01\0"
1226
0
    /* 85 */ "adc $\x01\0"
1227
0
    /* 92 */ "adc.b $\xFF\x01\x01\0"
1228
0
    /* 103 */ "adc.b  $\x01\0"
1229
0
    /* 112 */ "dint\0"
1230
0
    /* 117 */ "clrc\0"
1231
0
    /* 122 */ "clrn\0"
1232
0
    /* 127 */ "clrz\0"
1233
0
    /* 132 */ "eint\0"
1234
0
    /* 137 */ "setc\0"
1235
0
    /* 142 */ "setn\0"
1236
0
    /* 147 */ "setz\0"
1237
0
    /* 152 */ "tst  $\xFF\x01\x01\0"
1238
0
    /* 161 */ "tst  $\x01\0"
1239
0
    /* 168 */ "tst.b  $\xFF\x01\x01\0"
1240
0
    /* 179 */ "tst.b  $\x01\0"
1241
0
    /* 188 */ "dadc $\xFF\x01\x01\0"
1242
0
    /* 198 */ "dadc $\x01\0"
1243
0
    /* 206 */ "dadc.b $\xFF\x01\x01\0"
1244
0
    /* 218 */ "dadc.b $\x01\0"
1245
0
    /* 228 */ "clr  $\xFF\x01\x01\0"
1246
0
    /* 237 */ "nop\0"
1247
0
    /* 241 */ "clr  $\x01\0"
1248
0
    /* 248 */ "clr.b  $\xFF\x01\x01\0"
1249
0
    /* 259 */ "clr.b  $\x01\0"
1250
0
    /* 268 */ "dec  $\xFF\x01\x01\0"
1251
0
    /* 277 */ "decd $\xFF\x01\x01\0"
1252
0
    /* 287 */ "dec  $\x01\0"
1253
0
    /* 294 */ "decd $\x01\0"
1254
0
    /* 302 */ "dec.b  $\xFF\x01\x01\0"
1255
0
    /* 313 */ "decd.b $\xFF\x01\x01\0"
1256
0
    /* 325 */ "dec.b  $\x01\0"
1257
0
    /* 334 */ "decd.b $\x01\0"
1258
0
    /* 344 */ "sbc  $\xFF\x01\x01\0"
1259
0
    /* 353 */ "sbc  $\x01\0"
1260
0
    /* 360 */ "sbc.b  $\xFF\x01\x01\0"
1261
0
    /* 371 */ "sbc.b  $\x01\0"
1262
0
    /* 380 */ "inv  $\xFF\x01\x01\0"
1263
0
    /* 389 */ "inv  $\x01\0"
1264
0
    /* 396 */ "inv.b  $\xFF\x01\x01\0"
1265
0
    /* 407 */ "inv.b  $\x01\0"
1266
0
  ;
1267
1268
0
#ifndef NDEBUG
1269
0
  static struct SortCheck {
1270
0
    SortCheck(ArrayRef<PatternsForOpcode> OpToPatterns) {
1271
0
      assert(std::is_sorted(
1272
0
                 OpToPatterns.begin(), OpToPatterns.end(),
1273
0
                 [](const PatternsForOpcode &L, const PatternsForOpcode &R) {
1274
0
                   return L.Opcode < R.Opcode;
1275
0
                 }) &&
1276
0
             "tablegen failed to sort opcode patterns");
1277
0
    }
1278
0
  } sortCheckVar(OpToPatterns);
1279
0
#endif
1280
1281
0
  AliasMatchingData M {
1282
0
    ArrayRef(OpToPatterns),
1283
0
    ArrayRef(Patterns),
1284
0
    ArrayRef(Conds),
1285
0
    StringRef(AsmStrings, std::size(AsmStrings)),
1286
0
    nullptr,
1287
0
  };
1288
0
  const char *AsmString = matchAliasPatterns(MI, nullptr, M);
1289
0
  if (!AsmString) return false;
1290
1291
0
  unsigned I = 0;
1292
0
  while (AsmString[I] != ' ' && AsmString[I] != '\t' &&
1293
0
         AsmString[I] != '$' && AsmString[I] != '\0')
1294
0
    ++I;
1295
0
  OS << '\t' << StringRef(AsmString, I);
1296
0
  if (AsmString[I] != '\0') {
1297
0
    if (AsmString[I] == ' ' || AsmString[I] == '\t') {
1298
0
      OS << '\t';
1299
0
      ++I;
1300
0
    }
1301
0
    do {
1302
0
      if (AsmString[I] == '$') {
1303
0
        ++I;
1304
0
        if (AsmString[I] == (char)0xff) {
1305
0
          ++I;
1306
0
          int OpIdx = AsmString[I++] - 1;
1307
0
          int PrintMethodIdx = AsmString[I++] - 1;
1308
0
          printCustomAliasOperand(MI, Address, OpIdx, PrintMethodIdx, OS);
1309
0
        } else
1310
0
          printOperand(MI, unsigned(AsmString[I++]) - 1, OS);
1311
0
      } else {
1312
0
        OS << AsmString[I++];
1313
0
      }
1314
0
    } while (AsmString[I] != '\0');
1315
0
  }
1316
1317
0
  return true;
1318
0
}
1319
1320
void MSP430InstPrinter::printCustomAliasOperand(
1321
         const MCInst *MI, uint64_t Address, unsigned OpIdx,
1322
         unsigned PrintMethodIdx,
1323
0
         raw_ostream &OS) {
1324
0
  switch (PrintMethodIdx) {
1325
0
  default:
1326
0
    llvm_unreachable("Unknown PrintMethod kind");
1327
0
    break;
1328
0
  case 0:
1329
0
    printSrcMemOperand(MI, OpIdx, OS);
1330
0
    break;
1331
0
  }
1332
0
}
1333
1334
#endif // PRINT_ALIAS_INSTR