Coverage Report

Created: 2018-07-20 23:04

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/BPF/BPFGenMCCodeEmitter.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Machine Code Emitter                                                       *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
9
uint64_t BPFMCCodeEmitter::getBinaryCodeForInstr(const MCInst &MI,
10
    SmallVectorImpl<MCFixup> &Fixups,
11
867
    const MCSubtargetInfo &STI) const {
12
867
  static const uint64_t InstBits[] = {
13
867
    UINT64_C(0),
14
867
    UINT64_C(0),
15
867
    UINT64_C(0),
16
867
    UINT64_C(0),
17
867
    UINT64_C(0),
18
867
    UINT64_C(0),
19
867
    UINT64_C(0),
20
867
    UINT64_C(0),
21
867
    UINT64_C(0),
22
867
    UINT64_C(0),
23
867
    UINT64_C(0),
24
867
    UINT64_C(0),
25
867
    UINT64_C(0),
26
867
    UINT64_C(0),
27
867
    UINT64_C(0),
28
867
    UINT64_C(0),
29
867
    UINT64_C(0),
30
867
    UINT64_C(0),
31
867
    UINT64_C(0),
32
867
    UINT64_C(0),
33
867
    UINT64_C(0),
34
867
    UINT64_C(0),
35
867
    UINT64_C(0),
36
867
    UINT64_C(0),
37
867
    UINT64_C(0),
38
867
    UINT64_C(0),
39
867
    UINT64_C(0),
40
867
    UINT64_C(0),
41
867
    UINT64_C(0),
42
867
    UINT64_C(0),
43
867
    UINT64_C(0),
44
867
    UINT64_C(0),
45
867
    UINT64_C(0),
46
867
    UINT64_C(0),
47
867
    UINT64_C(0),
48
867
    UINT64_C(0),
49
867
    UINT64_C(0),
50
867
    UINT64_C(0),
51
867
    UINT64_C(0),
52
867
    UINT64_C(0),
53
867
    UINT64_C(0),
54
867
    UINT64_C(0),
55
867
    UINT64_C(0),
56
867
    UINT64_C(0),
57
867
    UINT64_C(0),
58
867
    UINT64_C(0),
59
867
    UINT64_C(0),
60
867
    UINT64_C(0),
61
867
    UINT64_C(0),
62
867
    UINT64_C(0),
63
867
    UINT64_C(0),
64
867
    UINT64_C(0),
65
867
    UINT64_C(0),
66
867
    UINT64_C(0),
67
867
    UINT64_C(0),
68
867
    UINT64_C(0),
69
867
    UINT64_C(0),
70
867
    UINT64_C(0),
71
867
    UINT64_C(0),
72
867
    UINT64_C(0),
73
867
    UINT64_C(0),
74
867
    UINT64_C(0),
75
867
    UINT64_C(0),
76
867
    UINT64_C(0),
77
867
    UINT64_C(0),
78
867
    UINT64_C(0),
79
867
    UINT64_C(0),
80
867
    UINT64_C(0),
81
867
    UINT64_C(0),
82
867
    UINT64_C(0),
83
867
    UINT64_C(0),
84
867
    UINT64_C(0),
85
867
    UINT64_C(0),
86
867
    UINT64_C(0),
87
867
    UINT64_C(0),
88
867
    UINT64_C(0),
89
867
    UINT64_C(0),
90
867
    UINT64_C(0),
91
867
    UINT64_C(0),
92
867
    UINT64_C(0),
93
867
    UINT64_C(0),
94
867
    UINT64_C(0),
95
867
    UINT64_C(0),
96
867
    UINT64_C(0),
97
867
    UINT64_C(0),
98
867
    UINT64_C(0),
99
867
    UINT64_C(0),
100
867
    UINT64_C(0),
101
867
    UINT64_C(0),
102
867
    UINT64_C(0),
103
867
    UINT64_C(0),
104
867
    UINT64_C(0),
105
867
    UINT64_C(0),
106
867
    UINT64_C(0),
107
867
    UINT64_C(0),
108
867
    UINT64_C(0),
109
867
    UINT64_C(0),
110
867
    UINT64_C(0),
111
867
    UINT64_C(0),
112
867
    UINT64_C(0),
113
867
    UINT64_C(0),
114
867
    UINT64_C(0),
115
867
    UINT64_C(0),
116
867
    UINT64_C(0),
117
867
    UINT64_C(0),
118
867
    UINT64_C(0),
119
867
    UINT64_C(0),
120
867
    UINT64_C(0),
121
867
    UINT64_C(0),
122
867
    UINT64_C(0),
123
867
    UINT64_C(0),
124
867
    UINT64_C(0),
125
867
    UINT64_C(0),
126
867
    UINT64_C(0),
127
867
    UINT64_C(0),
128
867
    UINT64_C(0),
129
867
    UINT64_C(0),
130
867
    UINT64_C(0),
131
867
    UINT64_C(0),
132
867
    UINT64_C(0),
133
867
    UINT64_C(0),
134
867
    UINT64_C(0),
135
867
    UINT64_C(0),
136
867
    UINT64_C(0),
137
867
    UINT64_C(0),
138
867
    UINT64_C(0),
139
867
    UINT64_C(0),
140
867
    UINT64_C(0),
141
867
    UINT64_C(0),
142
867
    UINT64_C(0),
143
867
    UINT64_C(0),
144
867
    UINT64_C(0),
145
867
    UINT64_C(0),
146
867
    UINT64_C(0),
147
867
    UINT64_C(0),
148
867
    UINT64_C(504403158265495552), // ADD_ri
149
867
    UINT64_C(288230376151711744), // ADD_ri_32
150
867
    UINT64_C(1080863910568919040),  // ADD_rr
151
867
    UINT64_C(864691128455135232), // ADD_rr_32
152
867
    UINT64_C(6269010681299730432),  // AND_ri
153
867
    UINT64_C(6052837899185946624),  // AND_ri_32
154
867
    UINT64_C(6845471433603153920),  // AND_rr
155
867
    UINT64_C(6629298651489370112),  // AND_rr_32
156
867
    UINT64_C(15852670688344145936), // BE16
157
867
    UINT64_C(15852670688344145952), // BE32
158
867
    UINT64_C(15852670688344145984), // BE64
159
867
    UINT64_C(3963167672086036480),  // DIV_ri
160
867
    UINT64_C(3746994889972252672),  // DIV_ri_32
161
867
    UINT64_C(4539628424389459968),  // DIV_rr
162
867
    UINT64_C(4323455642275676160),  // DIV_rr_32
163
867
    UINT64_C(1738389456165011456),  // FI_ri
164
867
    UINT64_C(9583660007044415488),  // JAL
165
867
    UINT64_C(10160120759347838976), // JALX
166
867
    UINT64_C(1513209474796486656),  // JEQ_ri
167
867
    UINT64_C(2089670227099910144),  // JEQ_rr
168
867
    UINT64_C(360287970189639680), // JMP
169
867
    UINT64_C(6124895493223874560),  // JNE_ri
170
867
    UINT64_C(6701356245527298048),  // JNE_rr
171
867
    UINT64_C(8430738502437568512),  // JSGE_ri
172
867
    UINT64_C(9007199254740992000),  // JSGE_rr
173
867
    UINT64_C(7277816997830721536),  // JSGT_ri
174
867
    UINT64_C(7854277750134145024),  // JSGT_rr
175
867
    UINT64_C(15348267530078650368), // JSLE_ri
176
867
    UINT64_C(15924728282382073856), // JSLE_rr
177
867
    UINT64_C(14195346025471803392), // JSLT_ri
178
867
    UINT64_C(14771806777775226880), // JSLT_rr
179
867
    UINT64_C(3819052484010180608),  // JUGE_ri
180
867
    UINT64_C(4395513236313604096),  // JUGE_rr
181
867
    UINT64_C(2666130979403333632),  // JUGT_ri
182
867
    UINT64_C(3242591731706757120),  // JUGT_rr
183
867
    UINT64_C(13042424520864956416), // JULE_ri
184
867
    UINT64_C(13618885273168379904), // JULE_rr
185
867
    UINT64_C(11889503016258109440), // JULT_ri
186
867
    UINT64_C(12465963768561532928), // JULT_rr
187
867
    UINT64_C(8142508126285856768),  // LDB
188
867
    UINT64_C(8142508126285856768),  // LDB32
189
867
    UINT64_C(8718968878589280256),  // LDD
190
867
    UINT64_C(7566047373982433280),  // LDH
191
867
    UINT64_C(7566047373982433280),  // LDH32
192
867
    UINT64_C(6989586621679009792),  // LDW
193
867
    UINT64_C(6989586621679009792),  // LDW32
194
867
    UINT64_C(3458764513820540928),  // LD_ABS_B
195
867
    UINT64_C(2882303761517117440),  // LD_ABS_H
196
867
    UINT64_C(2305843009213693952),  // LD_ABS_W
197
867
    UINT64_C(5764607523034234880),  // LD_IND_B
198
867
    UINT64_C(5188146770730811392),  // LD_IND_H
199
867
    UINT64_C(4611686018427387904),  // LD_IND_W
200
867
    UINT64_C(1729382256910270464),  // LD_imm64
201
867
    UINT64_C(1729382256910270464),  // LD_pseudo
202
867
    UINT64_C(15276209936040722448), // LE16
203
867
    UINT64_C(15276209936040722464), // LE32
204
867
    UINT64_C(15276209936040722496), // LE64
205
867
    UINT64_C(13546827679130451968), // MOV_32_64
206
867
    UINT64_C(13186539708940812288), // MOV_ri
207
867
    UINT64_C(12970366926827028480), // MOV_ri_32
208
867
    UINT64_C(13763000461244235776), // MOV_rr
209
867
    UINT64_C(13546827679130451968), // MOV_rr_32
210
867
    UINT64_C(2810246167479189504),  // MUL_ri
211
867
    UINT64_C(2594073385365405696),  // MUL_ri_32
212
867
    UINT64_C(3386706919782612992),  // MUL_rr
213
867
    UINT64_C(3170534137668829184),  // MUL_rr_32
214
867
    UINT64_C(9511602413006487552),  // NEG_32
215
867
    UINT64_C(9727775195120271360),  // NEG_64
216
867
    UINT64_C(13763000461244235776), // NOP
217
867
    UINT64_C(5116089176692883456),  // OR_ri
218
867
    UINT64_C(4899916394579099648),  // OR_ri_32
219
867
    UINT64_C(5692549928996306944),  // OR_rr
220
867
    UINT64_C(5476377146882523136),  // OR_rr_32
221
867
    UINT64_C(10736581511651262464), // RET
222
867
    UINT64_C(7421932185906577408),  // SLL_ri
223
867
    UINT64_C(7205759403792793600),  // SLL_ri_32
224
867
    UINT64_C(7998392938210000896),  // SLL_rr
225
867
    UINT64_C(7782220156096217088),  // SLL_rr_32
226
867
    UINT64_C(14339461213547659264), // SRA_ri
227
867
    UINT64_C(14123288431433875456), // SRA_ri_32
228
867
    UINT64_C(14915921965851082752), // SRA_rr
229
867
    UINT64_C(14699749183737298944), // SRA_rr_32
230
867
    UINT64_C(8574853690513424384),  // SRL_ri
231
867
    UINT64_C(8358680908399640576),  // SRL_ri_32
232
867
    UINT64_C(9151314442816847872),  // SRL_rr
233
867
    UINT64_C(8935141660703064064),  // SRL_rr_32
234
867
    UINT64_C(8286623314361712640),  // STB
235
867
    UINT64_C(8286623314361712640),  // STB32
236
867
    UINT64_C(8863084066665136128),  // STD
237
867
    UINT64_C(7710162562058289152),  // STH
238
867
    UINT64_C(7710162562058289152),  // STH32
239
867
    UINT64_C(7133701809754865664),  // STW
240
867
    UINT64_C(7133701809754865664),  // STW32
241
867
    UINT64_C(1657324662872342528),  // SUB_ri
242
867
    UINT64_C(1441151880758558720),  // SUB_ri_32
243
867
    UINT64_C(2233785415175766016),  // SUB_rr
244
867
    UINT64_C(2017612633061982208),  // SUB_rr_32
245
867
    UINT64_C(14051230837395947520), // XADD32
246
867
    UINT64_C(15780613094306217984), // XADD64
247
867
    UINT64_C(12033618204333965312), // XOR_ri
248
867
    UINT64_C(11817445422220181504), // XOR_ri_32
249
867
    UINT64_C(12610078956637388800), // XOR_rr
250
867
    UINT64_C(12393906174523604992), // XOR_rr_32
251
867
    UINT64_C(0)
252
867
  };
253
867
  const unsigned opcode = MI.getOpcode();
254
867
  uint64_t Value = InstBits[opcode];
255
867
  uint64_t op = 0;
256
867
  (void)op;  // suppress warning
257
867
  switch (opcode) {
258
867
    case BPF::FI_ri:
259
69
    case BPF::NOP:
260
69
    case BPF::RET: {
261
69
      break;
262
69
    }
263
69
    case BPF::JMP: {
264
12
      // op: BrDst
265
12
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
266
12
      Value |= (op & UINT64_C(65535)) << 32;
267
12
      break;
268
69
    }
269
69
    case BPF::JAL:
270
24
    case BPF::JALX: {
271
24
      // op: BrDst
272
24
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
273
24
      Value |= op & UINT64_C(4294967295);
274
24
      break;
275
24
    }
276
24
    case BPF::BE16:
277
17
    case BPF::BE32:
278
17
    case BPF::BE64:
279
17
    case BPF::LE16:
280
17
    case BPF::LE32:
281
17
    case BPF::LE64:
282
17
    case BPF::NEG_32:
283
17
    case BPF::NEG_64: {
284
17
      // op: dst
285
17
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
286
17
      Value |= (op & UINT64_C(15)) << 48;
287
17
      break;
288
17
    }
289
38
    case BPF::JEQ_ri:
290
38
    case BPF::JNE_ri:
291
38
    case BPF::JSGE_ri:
292
38
    case BPF::JSGT_ri:
293
38
    case BPF::JSLE_ri:
294
38
    case BPF::JSLT_ri:
295
38
    case BPF::JUGE_ri:
296
38
    case BPF::JUGT_ri:
297
38
    case BPF::JULE_ri:
298
38
    case BPF::JULT_ri: {
299
38
      // op: dst
300
38
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
301
38
      Value |= (op & UINT64_C(15)) << 48;
302
38
      // op: BrDst
303
38
      op = getMachineOpValue(MI, MI.getOperand(2), Fixups, STI);
304
38
      Value |= (op & UINT64_C(65535)) << 32;
305
38
      // op: imm
306
38
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
307
38
      Value |= op & UINT64_C(4294967295);
308
38
      break;
309
38
    }
310
46
    case BPF::LDB:
311
46
    case BPF::LDB32:
312
46
    case BPF::LDD:
313
46
    case BPF::LDH:
314
46
    case BPF::LDH32:
315
46
    case BPF::LDW:
316
46
    case BPF::LDW32: {
317
46
      // op: dst
318
46
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
319
46
      Value |= (op & UINT64_C(15)) << 48;
320
46
      // op: addr
321
46
      op = getMemoryOpValue(MI, 1, Fixups, STI);
322
46
      Value |= (op & UINT64_C(983040)) << 36;
323
46
      Value |= (op & UINT64_C(65535)) << 32;
324
46
      break;
325
46
    }
326
105
    case BPF::LD_imm64:
327
105
    case BPF::MOV_ri:
328
105
    case BPF::MOV_ri_32: {
329
105
      // op: dst
330
105
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
331
105
      Value |= (op & UINT64_C(15)) << 48;
332
105
      // op: imm
333
105
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
334
105
      Value |= op & UINT64_C(4294967295);
335
105
      break;
336
105
    }
337
133
    case BPF::ADD_ri:
338
133
    case BPF::ADD_ri_32:
339
133
    case BPF::AND_ri:
340
133
    case BPF::AND_ri_32:
341
133
    case BPF::DIV_ri:
342
133
    case BPF::DIV_ri_32:
343
133
    case BPF::MUL_ri:
344
133
    case BPF::MUL_ri_32:
345
133
    case BPF::OR_ri:
346
133
    case BPF::OR_ri_32:
347
133
    case BPF::SLL_ri:
348
133
    case BPF::SLL_ri_32:
349
133
    case BPF::SRA_ri:
350
133
    case BPF::SRA_ri_32:
351
133
    case BPF::SRL_ri:
352
133
    case BPF::SRL_ri_32:
353
133
    case BPF::SUB_ri:
354
133
    case BPF::SUB_ri_32:
355
133
    case BPF::XOR_ri:
356
133
    case BPF::XOR_ri_32: {
357
133
      // op: dst
358
133
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
359
133
      Value |= (op & UINT64_C(15)) << 48;
360
133
      // op: imm
361
133
      op = getMachineOpValue(MI, MI.getOperand(2), Fixups, STI);
362
133
      Value |= op & UINT64_C(4294967295);
363
133
      break;
364
133
    }
365
133
    case BPF::LD_pseudo: {
366
4
      // op: dst
367
4
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
368
4
      Value |= (op & UINT64_C(15)) << 48;
369
4
      // op: imm
370
4
      op = getMachineOpValue(MI, MI.getOperand(2), Fixups, STI);
371
4
      Value |= op & UINT64_C(4294967295);
372
4
      // op: pseudo
373
4
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
374
4
      Value |= (op & UINT64_C(15)) << 52;
375
4
      break;
376
133
    }
377
173
    case BPF::MOV_32_64:
378
173
    case BPF::MOV_rr:
379
173
    case BPF::MOV_rr_32: {
380
173
      // op: dst
381
173
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
382
173
      Value |= (op & UINT64_C(15)) << 48;
383
173
      // op: src
384
173
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
385
173
      Value |= (op & UINT64_C(15)) << 52;
386
173
      break;
387
173
    }
388
173
    case BPF::JEQ_rr:
389
18
    case BPF::JNE_rr:
390
18
    case BPF::JSGE_rr:
391
18
    case BPF::JSGT_rr:
392
18
    case BPF::JSLE_rr:
393
18
    case BPF::JSLT_rr:
394
18
    case BPF::JUGE_rr:
395
18
    case BPF::JUGT_rr:
396
18
    case BPF::JULE_rr:
397
18
    case BPF::JULT_rr: {
398
18
      // op: dst
399
18
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
400
18
      Value |= (op & UINT64_C(15)) << 48;
401
18
      // op: src
402
18
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
403
18
      Value |= (op & UINT64_C(15)) << 52;
404
18
      // op: BrDst
405
18
      op = getMachineOpValue(MI, MI.getOperand(2), Fixups, STI);
406
18
      Value |= (op & UINT64_C(65535)) << 32;
407
18
      break;
408
18
    }
409
92
    case BPF::ADD_rr:
410
92
    case BPF::ADD_rr_32:
411
92
    case BPF::AND_rr:
412
92
    case BPF::AND_rr_32:
413
92
    case BPF::DIV_rr:
414
92
    case BPF::DIV_rr_32:
415
92
    case BPF::MUL_rr:
416
92
    case BPF::MUL_rr_32:
417
92
    case BPF::OR_rr:
418
92
    case BPF::OR_rr_32:
419
92
    case BPF::SLL_rr:
420
92
    case BPF::SLL_rr_32:
421
92
    case BPF::SRA_rr:
422
92
    case BPF::SRA_rr_32:
423
92
    case BPF::SRL_rr:
424
92
    case BPF::SRL_rr_32:
425
92
    case BPF::SUB_rr:
426
92
    case BPF::SUB_rr_32:
427
92
    case BPF::XOR_rr:
428
92
    case BPF::XOR_rr_32: {
429
92
      // op: dst
430
92
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
431
92
      Value |= (op & UINT64_C(15)) << 48;
432
92
      // op: src
433
92
      op = getMachineOpValue(MI, MI.getOperand(2), Fixups, STI);
434
92
      Value |= (op & UINT64_C(15)) << 52;
435
92
      break;
436
92
    }
437
92
    case BPF::XADD32:
438
7
    case BPF::XADD64: {
439
7
      // op: dst
440
7
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
441
7
      Value |= (op & UINT64_C(15)) << 52;
442
7
      // op: addr
443
7
      op = getMemoryOpValue(MI, 1, Fixups, STI);
444
7
      Value |= (op & UINT64_C(1048575)) << 32;
445
7
      break;
446
7
    }
447
17
    case BPF::LD_ABS_B:
448
17
    case BPF::LD_ABS_H:
449
17
    case BPF::LD_ABS_W: {
450
17
      // op: imm
451
17
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
452
17
      Value |= op & UINT64_C(4294967295);
453
17
      break;
454
17
    }
455
65
    case BPF::STB:
456
65
    case BPF::STB32:
457
65
    case BPF::STD:
458
65
    case BPF::STH:
459
65
    case BPF::STH32:
460
65
    case BPF::STW:
461
65
    case BPF::STW32: {
462
65
      // op: src
463
65
      op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);
464
65
      Value |= (op & UINT64_C(15)) << 52;
465
65
      // op: addr
466
65
      op = getMemoryOpValue(MI, 1, Fixups, STI);
467
65
      Value |= (op & UINT64_C(1048575)) << 32;
468
65
      break;
469
65
    }
470
65
    case BPF::LD_IND_B:
471
47
    case BPF::LD_IND_H:
472
47
    case BPF::LD_IND_W: {
473
47
      // op: val
474
47
      op = getMachineOpValue(MI, MI.getOperand(1), Fixups, STI);
475
47
      Value |= (op & UINT64_C(15)) << 52;
476
47
      break;
477
47
    }
478
47
  default:
479
0
    std::string msg;
480
0
    raw_string_ostream Msg(msg);
481
0
    Msg << "Not supported instr: " << MI;
482
0
    report_fatal_error(Msg.str());
483
867
  }
484
867
  return Value;
485
867
}
486
487
#ifdef ENABLE_INSTR_PREDICATE_VERIFIER
488
#undef ENABLE_INSTR_PREDICATE_VERIFIER
489
#include <sstream>
490
491
// Flags for subtarget features that participate in instruction matching.
492
enum SubtargetFeatureFlag : uint8_t {
493
  Feature_None = 0
494
};
495
496
#ifndef NDEBUG
497
static const char *SubtargetFeatureNames[] = {
498
  nullptr
499
};
500
501
#endif // NDEBUG
502
uint64_t BPFMCCodeEmitter::
503
867
computeAvailableFeatures(const FeatureBitset& FB) const {
504
867
  uint64_t Features = 0;
505
867
  return Features;
506
867
}
507
508
void BPFMCCodeEmitter::verifyInstructionPredicates(
509
867
    const MCInst &Inst, uint64_t AvailableFeatures) const {
510
#ifndef NDEBUG
511
  static uint64_t RequiredFeatures[] = {
512
    0, // PHI = 0
513
    0, // INLINEASM = 1
514
    0, // CFI_INSTRUCTION = 2
515
    0, // EH_LABEL = 3
516
    0, // GC_LABEL = 4
517
    0, // ANNOTATION_LABEL = 5
518
    0, // KILL = 6
519
    0, // EXTRACT_SUBREG = 7
520
    0, // INSERT_SUBREG = 8
521
    0, // IMPLICIT_DEF = 9
522
    0, // SUBREG_TO_REG = 10
523
    0, // COPY_TO_REGCLASS = 11
524
    0, // DBG_VALUE = 12
525
    0, // DBG_LABEL = 13
526
    0, // REG_SEQUENCE = 14
527
    0, // COPY = 15
528
    0, // BUNDLE = 16
529
    0, // LIFETIME_START = 17
530
    0, // LIFETIME_END = 18
531
    0, // STACKMAP = 19
532
    0, // FENTRY_CALL = 20
533
    0, // PATCHPOINT = 21
534
    0, // LOAD_STACK_GUARD = 22
535
    0, // STATEPOINT = 23
536
    0, // LOCAL_ESCAPE = 24
537
    0, // FAULTING_OP = 25
538
    0, // PATCHABLE_OP = 26
539
    0, // PATCHABLE_FUNCTION_ENTER = 27
540
    0, // PATCHABLE_RET = 28
541
    0, // PATCHABLE_FUNCTION_EXIT = 29
542
    0, // PATCHABLE_TAIL_CALL = 30
543
    0, // PATCHABLE_EVENT_CALL = 31
544
    0, // PATCHABLE_TYPED_EVENT_CALL = 32
545
    0, // ICALL_BRANCH_FUNNEL = 33
546
    0, // G_ADD = 34
547
    0, // G_SUB = 35
548
    0, // G_MUL = 36
549
    0, // G_SDIV = 37
550
    0, // G_UDIV = 38
551
    0, // G_SREM = 39
552
    0, // G_UREM = 40
553
    0, // G_AND = 41
554
    0, // G_OR = 42
555
    0, // G_XOR = 43
556
    0, // G_IMPLICIT_DEF = 44
557
    0, // G_PHI = 45
558
    0, // G_FRAME_INDEX = 46
559
    0, // G_GLOBAL_VALUE = 47
560
    0, // G_EXTRACT = 48
561
    0, // G_UNMERGE_VALUES = 49
562
    0, // G_INSERT = 50
563
    0, // G_MERGE_VALUES = 51
564
    0, // G_PTRTOINT = 52
565
    0, // G_INTTOPTR = 53
566
    0, // G_BITCAST = 54
567
    0, // G_LOAD = 55
568
    0, // G_SEXTLOAD = 56
569
    0, // G_ZEXTLOAD = 57
570
    0, // G_STORE = 58
571
    0, // G_ATOMIC_CMPXCHG_WITH_SUCCESS = 59
572
    0, // G_ATOMIC_CMPXCHG = 60
573
    0, // G_ATOMICRMW_XCHG = 61
574
    0, // G_ATOMICRMW_ADD = 62
575
    0, // G_ATOMICRMW_SUB = 63
576
    0, // G_ATOMICRMW_AND = 64
577
    0, // G_ATOMICRMW_NAND = 65
578
    0, // G_ATOMICRMW_OR = 66
579
    0, // G_ATOMICRMW_XOR = 67
580
    0, // G_ATOMICRMW_MAX = 68
581
    0, // G_ATOMICRMW_MIN = 69
582
    0, // G_ATOMICRMW_UMAX = 70
583
    0, // G_ATOMICRMW_UMIN = 71
584
    0, // G_BRCOND = 72
585
    0, // G_BRINDIRECT = 73
586
    0, // G_INTRINSIC = 74
587
    0, // G_INTRINSIC_W_SIDE_EFFECTS = 75
588
    0, // G_ANYEXT = 76
589
    0, // G_TRUNC = 77
590
    0, // G_CONSTANT = 78
591
    0, // G_FCONSTANT = 79
592
    0, // G_VASTART = 80
593
    0, // G_VAARG = 81
594
    0, // G_SEXT = 82
595
    0, // G_ZEXT = 83
596
    0, // G_SHL = 84
597
    0, // G_LSHR = 85
598
    0, // G_ASHR = 86
599
    0, // G_ICMP = 87
600
    0, // G_FCMP = 88
601
    0, // G_SELECT = 89
602
    0, // G_UADDE = 90
603
    0, // G_USUBE = 91
604
    0, // G_SADDO = 92
605
    0, // G_SSUBO = 93
606
    0, // G_UMULO = 94
607
    0, // G_SMULO = 95
608
    0, // G_UMULH = 96
609
    0, // G_SMULH = 97
610
    0, // G_FADD = 98
611
    0, // G_FSUB = 99
612
    0, // G_FMUL = 100
613
    0, // G_FMA = 101
614
    0, // G_FDIV = 102
615
    0, // G_FREM = 103
616
    0, // G_FPOW = 104
617
    0, // G_FEXP = 105
618
    0, // G_FEXP2 = 106
619
    0, // G_FLOG = 107
620
    0, // G_FLOG2 = 108
621
    0, // G_FNEG = 109
622
    0, // G_FPEXT = 110
623
    0, // G_FPTRUNC = 111
624
    0, // G_FPTOSI = 112
625
    0, // G_FPTOUI = 113
626
    0, // G_SITOFP = 114
627
    0, // G_UITOFP = 115
628
    0, // G_FABS = 116
629
    0, // G_GEP = 117
630
    0, // G_PTR_MASK = 118
631
    0, // G_BR = 119
632
    0, // G_INSERT_VECTOR_ELT = 120
633
    0, // G_EXTRACT_VECTOR_ELT = 121
634
    0, // G_SHUFFLE_VECTOR = 122
635
    0, // G_BSWAP = 123
636
    0, // G_ADDRSPACE_CAST = 124
637
    0, // ADJCALLSTACKDOWN = 125
638
    0, // ADJCALLSTACKUP = 126
639
    0, // Select = 127
640
    0, // Select_32 = 128
641
    0, // Select_32_64 = 129
642
    0, // Select_64_32 = 130
643
    0, // Select_Ri = 131
644
    0, // Select_Ri_32 = 132
645
    0, // Select_Ri_32_64 = 133
646
    0, // Select_Ri_64_32 = 134
647
    0, // ADD_ri = 135
648
    0, // ADD_ri_32 = 136
649
    0, // ADD_rr = 137
650
    0, // ADD_rr_32 = 138
651
    0, // AND_ri = 139
652
    0, // AND_ri_32 = 140
653
    0, // AND_rr = 141
654
    0, // AND_rr_32 = 142
655
    0, // BE16 = 143
656
    0, // BE32 = 144
657
    0, // BE64 = 145
658
    0, // DIV_ri = 146
659
    0, // DIV_ri_32 = 147
660
    0, // DIV_rr = 148
661
    0, // DIV_rr_32 = 149
662
    0, // FI_ri = 150
663
    0, // JAL = 151
664
    0, // JALX = 152
665
    0, // JEQ_ri = 153
666
    0, // JEQ_rr = 154
667
    0, // JMP = 155
668
    0, // JNE_ri = 156
669
    0, // JNE_rr = 157
670
    0, // JSGE_ri = 158
671
    0, // JSGE_rr = 159
672
    0, // JSGT_ri = 160
673
    0, // JSGT_rr = 161
674
    0, // JSLE_ri = 162
675
    0, // JSLE_rr = 163
676
    0, // JSLT_ri = 164
677
    0, // JSLT_rr = 165
678
    0, // JUGE_ri = 166
679
    0, // JUGE_rr = 167
680
    0, // JUGT_ri = 168
681
    0, // JUGT_rr = 169
682
    0, // JULE_ri = 170
683
    0, // JULE_rr = 171
684
    0, // JULT_ri = 172
685
    0, // JULT_rr = 173
686
    0, // LDB = 174
687
    0, // LDB32 = 175
688
    0, // LDD = 176
689
    0, // LDH = 177
690
    0, // LDH32 = 178
691
    0, // LDW = 179
692
    0, // LDW32 = 180
693
    0, // LD_ABS_B = 181
694
    0, // LD_ABS_H = 182
695
    0, // LD_ABS_W = 183
696
    0, // LD_IND_B = 184
697
    0, // LD_IND_H = 185
698
    0, // LD_IND_W = 186
699
    0, // LD_imm64 = 187
700
    0, // LD_pseudo = 188
701
    0, // LE16 = 189
702
    0, // LE32 = 190
703
    0, // LE64 = 191
704
    0, // MOV_32_64 = 192
705
    0, // MOV_ri = 193
706
    0, // MOV_ri_32 = 194
707
    0, // MOV_rr = 195
708
    0, // MOV_rr_32 = 196
709
    0, // MUL_ri = 197
710
    0, // MUL_ri_32 = 198
711
    0, // MUL_rr = 199
712
    0, // MUL_rr_32 = 200
713
    0, // NEG_32 = 201
714
    0, // NEG_64 = 202
715
    0, // NOP = 203
716
    0, // OR_ri = 204
717
    0, // OR_ri_32 = 205
718
    0, // OR_rr = 206
719
    0, // OR_rr_32 = 207
720
    0, // RET = 208
721
    0, // SLL_ri = 209
722
    0, // SLL_ri_32 = 210
723
    0, // SLL_rr = 211
724
    0, // SLL_rr_32 = 212
725
    0, // SRA_ri = 213
726
    0, // SRA_ri_32 = 214
727
    0, // SRA_rr = 215
728
    0, // SRA_rr_32 = 216
729
    0, // SRL_ri = 217
730
    0, // SRL_ri_32 = 218
731
    0, // SRL_rr = 219
732
    0, // SRL_rr_32 = 220
733
    0, // STB = 221
734
    0, // STB32 = 222
735
    0, // STD = 223
736
    0, // STH = 224
737
    0, // STH32 = 225
738
    0, // STW = 226
739
    0, // STW32 = 227
740
    0, // SUB_ri = 228
741
    0, // SUB_ri_32 = 229
742
    0, // SUB_rr = 230
743
    0, // SUB_rr_32 = 231
744
    0, // XADD32 = 232
745
    0, // XADD64 = 233
746
    0, // XOR_ri = 234
747
    0, // XOR_ri_32 = 235
748
    0, // XOR_rr = 236
749
    0, // XOR_rr_32 = 237
750
  };
751
752
  assert(Inst.getOpcode() < 238);
753
  uint64_t MissingFeatures =
754
      (AvailableFeatures & RequiredFeatures[Inst.getOpcode()]) ^
755
      RequiredFeatures[Inst.getOpcode()];
756
  if (MissingFeatures) {
757
    std::ostringstream Msg;
758
    Msg << "Attempting to emit " << MCII.getName(Inst.getOpcode()).str()
759
        << " instruction but the ";
760
    for (unsigned i = 0; i < 8 * sizeof(MissingFeatures); ++i)
761
      if (MissingFeatures & (1ULL << i))
762
        Msg << SubtargetFeatureNames[i] << " ";
763
    Msg << "predicate(s) are not met";
764
    report_fatal_error(Msg.str());
765
  }
766
#else
767
// Silence unused variable warning on targets that don't use MCII for other purposes (e.g. BPF).
768
867
(void)MCII;
769
867
#endif // NDEBUG
770
867
}
771
#endif