LLVM  5.0.0
HexagonMCDuplexInfo.cpp
Go to the documentation of this file.
1 //===----- HexagonMCDuplexInfo.cpp - Instruction bundle checking ----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This implements duplexing of instructions to reduce code size
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "HexagonBaseInfo.h"
16 
17 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/Support/Debug.h"
21 
22 #include <map>
23 
24 using namespace llvm;
25 using namespace Hexagon;
26 
27 #define DEBUG_TYPE "hexagon-mcduplex-info"
28 
29 // pair table of subInstructions with opcodes
30 static const std::pair<unsigned, unsigned> opcodeData[] = {
31  std::make_pair((unsigned)SA1_addi, 0),
32  std::make_pair((unsigned)SA1_addrx, 6144),
33  std::make_pair((unsigned)SA1_addsp, 3072),
34  std::make_pair((unsigned)SA1_and1, 4608),
35  std::make_pair((unsigned)SA1_clrf, 6768),
36  std::make_pair((unsigned)SA1_clrfnew, 6736),
37  std::make_pair((unsigned)SA1_clrt, 6752),
38  std::make_pair((unsigned)SA1_clrtnew, 6720),
39  std::make_pair((unsigned)SA1_cmpeqi, 6400),
40  std::make_pair((unsigned)SA1_combine0i, 7168),
41  std::make_pair((unsigned)SA1_combine1i, 7176),
42  std::make_pair((unsigned)SA1_combine2i, 7184),
43  std::make_pair((unsigned)SA1_combine3i, 7192),
44  std::make_pair((unsigned)SA1_combinerz, 7432),
45  std::make_pair((unsigned)SA1_combinezr, 7424),
46  std::make_pair((unsigned)SA1_dec, 4864),
47  std::make_pair((unsigned)SA1_inc, 4352),
48  std::make_pair((unsigned)SA1_seti, 2048),
49  std::make_pair((unsigned)SA1_setin1, 6656),
50  std::make_pair((unsigned)SA1_sxtb, 5376),
51  std::make_pair((unsigned)SA1_sxth, 5120),
52  std::make_pair((unsigned)SA1_tfr, 4096),
53  std::make_pair((unsigned)SA1_zxtb, 5888),
54  std::make_pair((unsigned)SA1_zxth, 5632),
55  std::make_pair((unsigned)SL1_loadri_io, 0),
56  std::make_pair((unsigned)SL1_loadrub_io, 4096),
57  std::make_pair((unsigned)SL2_deallocframe, 7936),
58  std::make_pair((unsigned)SL2_jumpr31, 8128),
59  std::make_pair((unsigned)SL2_jumpr31_f, 8133),
60  std::make_pair((unsigned)SL2_jumpr31_fnew, 8135),
61  std::make_pair((unsigned)SL2_jumpr31_t, 8132),
62  std::make_pair((unsigned)SL2_jumpr31_tnew, 8134),
63  std::make_pair((unsigned)SL2_loadrb_io, 4096),
64  std::make_pair((unsigned)SL2_loadrd_sp, 7680),
65  std::make_pair((unsigned)SL2_loadrh_io, 0),
66  std::make_pair((unsigned)SL2_loadri_sp, 7168),
67  std::make_pair((unsigned)SL2_loadruh_io, 2048),
68  std::make_pair((unsigned)SL2_return, 8000),
69  std::make_pair((unsigned)SL2_return_f, 8005),
70  std::make_pair((unsigned)SL2_return_fnew, 8007),
71  std::make_pair((unsigned)SL2_return_t, 8004),
72  std::make_pair((unsigned)SL2_return_tnew, 8006),
73  std::make_pair((unsigned)SS1_storeb_io, 4096),
74  std::make_pair((unsigned)SS1_storew_io, 0),
75  std::make_pair((unsigned)SS2_allocframe, 7168),
76  std::make_pair((unsigned)SS2_storebi0, 4608),
77  std::make_pair((unsigned)SS2_storebi1, 4864),
78  std::make_pair((unsigned)SS2_stored_sp, 2560),
79  std::make_pair((unsigned)SS2_storeh_io, 0),
80  std::make_pair((unsigned)SS2_storew_sp, 2048),
81  std::make_pair((unsigned)SS2_storewi0, 4096),
82  std::make_pair((unsigned)SS2_storewi1, 4352)};
83 
84 bool HexagonMCInstrInfo::isDuplexPairMatch(unsigned Ga, unsigned Gb) {
85  switch (Ga) {
87  default:
88  return false;
89  case HexagonII::HSIG_L1:
90  return (Gb == HexagonII::HSIG_L1 || Gb == HexagonII::HSIG_A);
91  case HexagonII::HSIG_L2:
92  return (Gb == HexagonII::HSIG_L1 || Gb == HexagonII::HSIG_L2 ||
93  Gb == HexagonII::HSIG_A);
94  case HexagonII::HSIG_S1:
95  return (Gb == HexagonII::HSIG_L1 || Gb == HexagonII::HSIG_L2 ||
96  Gb == HexagonII::HSIG_S1 || Gb == HexagonII::HSIG_A);
97  case HexagonII::HSIG_S2:
98  return (Gb == HexagonII::HSIG_L1 || Gb == HexagonII::HSIG_L2 ||
99  Gb == HexagonII::HSIG_S1 || Gb == HexagonII::HSIG_S2 ||
100  Gb == HexagonII::HSIG_A);
101  case HexagonII::HSIG_A:
102  return (Gb == HexagonII::HSIG_A);
104  return (Gb == HexagonII::HSIG_Compound);
105  }
106  return false;
107 }
108 
109 unsigned HexagonMCInstrInfo::iClassOfDuplexPair(unsigned Ga, unsigned Gb) {
110  switch (Ga) {
112  default:
113  break;
114  case HexagonII::HSIG_L1:
115  switch (Gb) {
116  default:
117  break;
118  case HexagonII::HSIG_L1:
119  return 0;
120  case HexagonII::HSIG_A:
121  return 0x4;
122  }
123  case HexagonII::HSIG_L2:
124  switch (Gb) {
125  default:
126  break;
127  case HexagonII::HSIG_L1:
128  return 0x1;
129  case HexagonII::HSIG_L2:
130  return 0x2;
131  case HexagonII::HSIG_A:
132  return 0x5;
133  }
134  case HexagonII::HSIG_S1:
135  switch (Gb) {
136  default:
137  break;
138  case HexagonII::HSIG_L1:
139  return 0x8;
140  case HexagonII::HSIG_L2:
141  return 0x9;
142  case HexagonII::HSIG_S1:
143  return 0xA;
144  case HexagonII::HSIG_A:
145  return 0x6;
146  }
147  case HexagonII::HSIG_S2:
148  switch (Gb) {
149  default:
150  break;
151  case HexagonII::HSIG_L1:
152  return 0xC;
153  case HexagonII::HSIG_L2:
154  return 0xD;
155  case HexagonII::HSIG_S1:
156  return 0xB;
157  case HexagonII::HSIG_S2:
158  return 0xE;
159  case HexagonII::HSIG_A:
160  return 0x7;
161  }
162  case HexagonII::HSIG_A:
163  switch (Gb) {
164  default:
165  break;
166  case HexagonII::HSIG_A:
167  return 0x3;
168  }
170  switch (Gb) {
172  return 0xFFFFFFFF;
173  }
174  }
175  return 0xFFFFFFFF;
176 }
177 
179  unsigned DstReg, PredReg, SrcReg, Src1Reg, Src2Reg;
180 
181  switch (MCI.getOpcode()) {
182  default:
183  return HexagonII::HSIG_None;
184  //
185  // Group L1:
186  //
187  // Rd = memw(Rs+#u4:2)
188  // Rd = memub(Rs+#u4:0)
189  case Hexagon::L2_loadri_io:
190  DstReg = MCI.getOperand(0).getReg();
191  SrcReg = MCI.getOperand(1).getReg();
192  // Special case this one from Group L2.
193  // Rd = memw(r29+#u5:2)
195  if (HexagonMCInstrInfo::isIntReg(SrcReg) &&
196  Hexagon::R29 == SrcReg && inRange<5, 2>(MCI, 2)) {
197  return HexagonII::HSIG_L2;
198  }
199  // Rd = memw(Rs+#u4:2)
201  inRange<4, 2>(MCI, 2)) {
202  return HexagonII::HSIG_L1;
203  }
204  }
205  break;
206  case Hexagon::L2_loadrub_io:
207  // Rd = memub(Rs+#u4:0)
208  DstReg = MCI.getOperand(0).getReg();
209  SrcReg = MCI.getOperand(1).getReg();
212  inRange<4>(MCI, 2)) {
213  return HexagonII::HSIG_L1;
214  }
215  break;
216  //
217  // Group L2:
218  //
219  // Rd = memh/memuh(Rs+#u3:1)
220  // Rd = memb(Rs+#u3:0)
221  // Rd = memw(r29+#u5:2) - Handled above.
222  // Rdd = memd(r29+#u5:3)
223  // deallocframe
224  // [if ([!]p0[.new])] dealloc_return
225  // [if ([!]p0[.new])] jumpr r31
226  case Hexagon::L2_loadrh_io:
227  case Hexagon::L2_loadruh_io:
228  // Rd = memh/memuh(Rs+#u3:1)
229  DstReg = MCI.getOperand(0).getReg();
230  SrcReg = MCI.getOperand(1).getReg();
233  inRange<3, 1>(MCI, 2)) {
234  return HexagonII::HSIG_L2;
235  }
236  break;
237  case Hexagon::L2_loadrb_io:
238  // Rd = memb(Rs+#u3:0)
239  DstReg = MCI.getOperand(0).getReg();
240  SrcReg = MCI.getOperand(1).getReg();
243  inRange<3>(MCI, 2)) {
244  return HexagonII::HSIG_L2;
245  }
246  break;
247  case Hexagon::L2_loadrd_io:
248  // Rdd = memd(r29+#u5:3)
249  DstReg = MCI.getOperand(0).getReg();
250  SrcReg = MCI.getOperand(1).getReg();
252  HexagonMCInstrInfo::isIntReg(SrcReg) && Hexagon::R29 == SrcReg &&
253  inRange<5, 3>(MCI, 2)) {
254  return HexagonII::HSIG_L2;
255  }
256  break;
257 
258  case Hexagon::L4_return:
259 
260  case Hexagon::L2_deallocframe:
261 
262  return HexagonII::HSIG_L2;
263  case Hexagon::EH_RETURN_JMPR:
264 
265  case Hexagon::J2_jumpr:
266  case Hexagon::PS_jmpret:
267  // jumpr r31
268  // Actual form JMPR %PC<imp-def>, %R31<imp-use>, %R0<imp-use,internal>.
269  DstReg = MCI.getOperand(0).getReg();
270  if (Hexagon::R31 == DstReg)
271  return HexagonII::HSIG_L2;
272  break;
273 
274  case Hexagon::J2_jumprt:
275  case Hexagon::J2_jumprf:
276  case Hexagon::J2_jumprtnew:
277  case Hexagon::J2_jumprfnew:
278  case Hexagon::J2_jumprtnewpt:
279  case Hexagon::J2_jumprfnewpt:
280  case Hexagon::PS_jmprett:
281  case Hexagon::PS_jmpretf:
282  case Hexagon::PS_jmprettnew:
283  case Hexagon::PS_jmpretfnew:
284  case Hexagon::PS_jmprettnewpt:
285  case Hexagon::PS_jmpretfnewpt:
286  DstReg = MCI.getOperand(1).getReg();
287  SrcReg = MCI.getOperand(0).getReg();
288  // [if ([!]p0[.new])] jumpr r31
289  if ((HexagonMCInstrInfo::isPredReg(SrcReg) && (Hexagon::P0 == SrcReg)) &&
290  (Hexagon::R31 == DstReg)) {
291  return HexagonII::HSIG_L2;
292  }
293  break;
294  case Hexagon::L4_return_t:
295  case Hexagon::L4_return_f:
296  case Hexagon::L4_return_tnew_pnt:
297  case Hexagon::L4_return_fnew_pnt:
298  case Hexagon::L4_return_tnew_pt:
299  case Hexagon::L4_return_fnew_pt:
300  // [if ([!]p0[.new])] dealloc_return
301  SrcReg = MCI.getOperand(0).getReg();
302  if (Hexagon::P0 == SrcReg) {
303  return HexagonII::HSIG_L2;
304  }
305  break;
306  //
307  // Group S1:
308  //
309  // memw(Rs+#u4:2) = Rt
310  // memb(Rs+#u4:0) = Rt
311  case Hexagon::S2_storeri_io:
312  // Special case this one from Group S2.
313  // memw(r29+#u5:2) = Rt
314  Src1Reg = MCI.getOperand(0).getReg();
315  Src2Reg = MCI.getOperand(2).getReg();
316  if (HexagonMCInstrInfo::isIntReg(Src1Reg) &&
318  Hexagon::R29 == Src1Reg && inRange<5, 2>(MCI, 1)) {
319  return HexagonII::HSIG_S2;
320  }
321  // memw(Rs+#u4:2) = Rt
324  inRange<4, 2>(MCI, 1)) {
325  return HexagonII::HSIG_S1;
326  }
327  break;
328  case Hexagon::S2_storerb_io:
329  // memb(Rs+#u4:0) = Rt
330  Src1Reg = MCI.getOperand(0).getReg();
331  Src2Reg = MCI.getOperand(2).getReg();
334  inRange<4>(MCI, 1)) {
335  return HexagonII::HSIG_S1;
336  }
337  break;
338  //
339  // Group S2:
340  //
341  // memh(Rs+#u3:1) = Rt
342  // memw(r29+#u5:2) = Rt
343  // memd(r29+#s6:3) = Rtt
344  // memw(Rs+#u4:2) = #U1
345  // memb(Rs+#u4) = #U1
346  // allocframe(#u5:3)
347  case Hexagon::S2_storerh_io:
348  // memh(Rs+#u3:1) = Rt
349  Src1Reg = MCI.getOperand(0).getReg();
350  Src2Reg = MCI.getOperand(2).getReg();
353  inRange<3, 1>(MCI, 1)) {
354  return HexagonII::HSIG_S2;
355  }
356  break;
357  case Hexagon::S2_storerd_io:
358  // memd(r29+#s6:3) = Rtt
359  Src1Reg = MCI.getOperand(0).getReg();
360  Src2Reg = MCI.getOperand(2).getReg();
362  HexagonMCInstrInfo::isIntReg(Src1Reg) && Hexagon::R29 == Src1Reg &&
363  inSRange<6, 3>(MCI, 1)) {
364  return HexagonII::HSIG_S2;
365  }
366  break;
367  case Hexagon::S4_storeiri_io:
368  // memw(Rs+#u4:2) = #U1
369  Src1Reg = MCI.getOperand(0).getReg();
371  inRange<4, 2>(MCI, 1) && inRange<1>(MCI, 2)) {
372  return HexagonII::HSIG_S2;
373  }
374  break;
375  case Hexagon::S4_storeirb_io:
376  // memb(Rs+#u4) = #U1
377  Src1Reg = MCI.getOperand(0).getReg();
379  inRange<4>(MCI, 1) && inRange<1>(MCI, 2)) {
380  return HexagonII::HSIG_S2;
381  }
382  break;
383  case Hexagon::S2_allocframe:
384  if (inRange<5, 3>(MCI, 0))
385  return HexagonII::HSIG_S2;
386  break;
387  //
388  // Group A:
389  //
390  // Rx = add(Rx,#s7)
391  // Rd = Rs
392  // Rd = #u6
393  // Rd = #-1
394  // if ([!]P0[.new]) Rd = #0
395  // Rd = add(r29,#u6:2)
396  // Rx = add(Rx,Rs)
397  // P0 = cmp.eq(Rs,#u2)
398  // Rdd = combine(#0,Rs)
399  // Rdd = combine(Rs,#0)
400  // Rdd = combine(#u2,#U2)
401  // Rd = add(Rs,#1)
402  // Rd = add(Rs,#-1)
403  // Rd = sxth/sxtb/zxtb/zxth(Rs)
404  // Rd = and(Rs,#1)
405  case Hexagon::A2_addi:
406  DstReg = MCI.getOperand(0).getReg();
407  SrcReg = MCI.getOperand(1).getReg();
409  // Rd = add(r29,#u6:2)
410  if (HexagonMCInstrInfo::isIntReg(SrcReg) && Hexagon::R29 == SrcReg &&
411  inRange<6, 2>(MCI, 2)) {
412  return HexagonII::HSIG_A;
413  }
414  // Rx = add(Rx,#s7)
415  if (DstReg == SrcReg) {
416  return HexagonII::HSIG_A;
417  }
418  // Rd = add(Rs,#1)
419  // Rd = add(Rs,#-1)
421  (minConstant(MCI, 2) == 1 || minConstant(MCI, 2) == -1)) {
422  return HexagonII::HSIG_A;
423  }
424  }
425  break;
426  case Hexagon::A2_add:
427  // Rx = add(Rx,Rs)
428  DstReg = MCI.getOperand(0).getReg();
429  Src1Reg = MCI.getOperand(1).getReg();
430  Src2Reg = MCI.getOperand(2).getReg();
431  if (HexagonMCInstrInfo::isIntRegForSubInst(DstReg) && (DstReg == Src1Reg) &&
433  return HexagonII::HSIG_A;
434  }
435  break;
436  case Hexagon::A2_andir:
437  DstReg = MCI.getOperand(0).getReg();
438  SrcReg = MCI.getOperand(1).getReg();
441  (minConstant(MCI, 2) == 1 || minConstant(MCI, 2) == 255)) {
442  return HexagonII::HSIG_A;
443  }
444  break;
445  case Hexagon::A2_tfr:
446  // Rd = Rs
447  DstReg = MCI.getOperand(0).getReg();
448  SrcReg = MCI.getOperand(1).getReg();
451  return HexagonII::HSIG_A;
452  }
453  break;
454  case Hexagon::A2_tfrsi:
455  DstReg = MCI.getOperand(0).getReg();
456 
458  return HexagonII::HSIG_A;
459  }
460  break;
461  case Hexagon::C2_cmoveit:
462  case Hexagon::C2_cmovenewit:
463  case Hexagon::C2_cmoveif:
464  case Hexagon::C2_cmovenewif:
465  // if ([!]P0[.new]) Rd = #0
466  // Actual form:
467  // %R16<def> = C2_cmovenewit %P0<internal>, 0, %R16<imp-use,undef>;
468  DstReg = MCI.getOperand(0).getReg(); // Rd
469  PredReg = MCI.getOperand(1).getReg(); // P0
471  Hexagon::P0 == PredReg && minConstant(MCI, 2) == 0) {
472  return HexagonII::HSIG_A;
473  }
474  break;
475  case Hexagon::C2_cmpeqi:
476  // P0 = cmp.eq(Rs,#u2)
477  DstReg = MCI.getOperand(0).getReg();
478  SrcReg = MCI.getOperand(1).getReg();
479  if (Hexagon::P0 == DstReg &&
481  inRange<2>(MCI, 2)) {
482  return HexagonII::HSIG_A;
483  }
484  break;
485  case Hexagon::A2_combineii:
486  case Hexagon::A4_combineii:
487  // Rdd = combine(#u2,#U2)
488  DstReg = MCI.getOperand(0).getReg();
490  inRange<2>(MCI, 1) && inRange<2>(MCI, 2)) {
491  return HexagonII::HSIG_A;
492  }
493  break;
494  case Hexagon::A4_combineri:
495  // Rdd = combine(Rs,#0)
496  DstReg = MCI.getOperand(0).getReg();
497  SrcReg = MCI.getOperand(1).getReg();
500  minConstant(MCI, 2) == 0) {
501  return HexagonII::HSIG_A;
502  }
503  break;
504  case Hexagon::A4_combineir:
505  // Rdd = combine(#0,Rs)
506  DstReg = MCI.getOperand(0).getReg();
507  SrcReg = MCI.getOperand(2).getReg();
510  minConstant(MCI, 1) == 0) {
511  return HexagonII::HSIG_A;
512  }
513  break;
514  case Hexagon::A2_sxtb:
515  case Hexagon::A2_sxth:
516  case Hexagon::A2_zxtb:
517  case Hexagon::A2_zxth:
518  // Rd = sxth/sxtb/zxtb/zxth(Rs)
519  DstReg = MCI.getOperand(0).getReg();
520  SrcReg = MCI.getOperand(1).getReg();
523  return HexagonII::HSIG_A;
524  }
525  break;
526  }
527 
528  return HexagonII::HSIG_None;
529 }
530 
532  unsigned DstReg, SrcReg;
533  switch (potentialDuplex.getOpcode()) {
534  case Hexagon::A2_addi:
535  // testing for case of: Rx = add(Rx,#s7)
536  DstReg = potentialDuplex.getOperand(0).getReg();
537  SrcReg = potentialDuplex.getOperand(1).getReg();
538  if (DstReg == SrcReg && HexagonMCInstrInfo::isIntRegForSubInst(DstReg)) {
539  int64_t Value;
540  if (!potentialDuplex.getOperand(2).getExpr()->evaluateAsAbsolute(Value))
541  return true;
542  if (!isShiftedInt<7, 0>(Value))
543  return true;
544  }
545  break;
546  case Hexagon::A2_tfrsi:
547  DstReg = potentialDuplex.getOperand(0).getReg();
548 
550  int64_t Value;
551  if (!potentialDuplex.getOperand(1).getExpr()->evaluateAsAbsolute(Value))
552  return true;
553  // Check for case of Rd = #-1.
554  if (Value == -1)
555  return false;
556  // Check for case of Rd = #u6.
557  if (!isShiftedUInt<6, 0>(Value))
558  return true;
559  }
560  break;
561  default:
562  break;
563  }
564  return false;
565 }
566 
567 /// non-Symmetrical. See if these two instructions are fit for duplex pair.
569  MCInst const &MIa, bool ExtendedA,
570  MCInst const &MIb, bool ExtendedB,
571  bool bisReversable,
572  MCSubtargetInfo const &STI) {
573  // Slot 1 cannot be extended in duplexes PRM 10.5
574  if (ExtendedA)
575  return false;
576  // Only A2_addi and A2_tfrsi can be extended in duplex form PRM 10.5
577  if (ExtendedB) {
578  unsigned Opcode = MIb.getOpcode();
579  if ((Opcode != Hexagon::A2_addi) && (Opcode != Hexagon::A2_tfrsi))
580  return false;
581  }
582  unsigned MIaG = HexagonMCInstrInfo::getDuplexCandidateGroup(MIa),
584 
585  static std::map<unsigned, unsigned> subinstOpcodeMap(std::begin(opcodeData),
587 
588  // If a duplex contains 2 insns in the same group, the insns must be
589  // ordered such that the numerically smaller opcode is in slot 1.
590  if ((MIaG != HexagonII::HSIG_None) && (MIaG == MIbG) && bisReversable) {
593 
594  unsigned zeroedSubInstS0 =
595  subinstOpcodeMap.find(SubInst0.getOpcode())->second;
596  unsigned zeroedSubInstS1 =
597  subinstOpcodeMap.find(SubInst1.getOpcode())->second;
598 
599  if (zeroedSubInstS0 < zeroedSubInstS1)
600  // subinstS0 (maps to slot 0) must be greater than
601  // subinstS1 (maps to slot 1)
602  return false;
603  }
604 
605  // allocframe must always be in slot 0
606  if (MIb.getOpcode() == Hexagon::S2_allocframe)
607  return false;
608 
609  if ((MIaG != HexagonII::HSIG_None) && (MIbG != HexagonII::HSIG_None)) {
610  // Prevent 2 instructions with extenders from duplexing
611  // Note that MIb (slot1) can be extended and MIa (slot0)
612  // can never be extended
613  if (subInstWouldBeExtended(MIa))
614  return false;
615 
616  // If duplexing produces an extender, but the original did not
617  // have an extender, do not duplex.
618  if (subInstWouldBeExtended(MIb) && !ExtendedB)
619  return false;
620  }
621 
622  // If jumpr r31 appears, it must be in slot 0, and never slot 1 (MIb).
623  if (MIbG == HexagonII::HSIG_L2) {
624  if ((MIb.getNumOperands() > 1) && MIb.getOperand(1).isReg() &&
625  (MIb.getOperand(1).getReg() == Hexagon::R31))
626  return false;
627  if ((MIb.getNumOperands() > 0) && MIb.getOperand(0).isReg() &&
628  (MIb.getOperand(0).getReg() == Hexagon::R31))
629  return false;
630  }
631 
632  if (STI.getCPU().equals_lower("hexagonv4") ||
633  STI.getCPU().equals_lower("hexagonv5") ||
634  STI.getCPU().equals_lower("hexagonv55") ||
635  STI.getCPU().equals_lower("hexagonv60")) {
636  // If a store appears, it must be in slot 0 (MIa) 1st, and then slot 1 (MIb);
637  // therefore, not duplexable if slot 1 is a store, and slot 0 is not.
638  if ((MIbG == HexagonII::HSIG_S1) || (MIbG == HexagonII::HSIG_S2)) {
639  if ((MIaG != HexagonII::HSIG_S1) && (MIaG != HexagonII::HSIG_S2))
640  return false;
641  }
642  }
643 
644  return (isDuplexPairMatch(MIaG, MIbG));
645 }
646 
647 /// Symmetrical. See if these two instructions are fit for duplex pair.
648 bool HexagonMCInstrInfo::isDuplexPair(MCInst const &MIa, MCInst const &MIb) {
649  unsigned MIaG = getDuplexCandidateGroup(MIa),
650  MIbG = getDuplexCandidateGroup(MIb);
651  return (isDuplexPairMatch(MIaG, MIbG) || isDuplexPairMatch(MIbG, MIaG));
652 }
653 
654 inline static void addOps(MCInst &subInstPtr, MCInst const &Inst,
655  unsigned opNum) {
656  if (Inst.getOperand(opNum).isReg()) {
657  switch (Inst.getOperand(opNum).getReg()) {
658  default:
659  llvm_unreachable("Not Duplexable Register");
660  break;
661  case Hexagon::R0:
662  case Hexagon::R1:
663  case Hexagon::R2:
664  case Hexagon::R3:
665  case Hexagon::R4:
666  case Hexagon::R5:
667  case Hexagon::R6:
668  case Hexagon::R7:
669  case Hexagon::D0:
670  case Hexagon::D1:
671  case Hexagon::D2:
672  case Hexagon::D3:
673  case Hexagon::R16:
674  case Hexagon::R17:
675  case Hexagon::R18:
676  case Hexagon::R19:
677  case Hexagon::R20:
678  case Hexagon::R21:
679  case Hexagon::R22:
680  case Hexagon::R23:
681  case Hexagon::D8:
682  case Hexagon::D9:
683  case Hexagon::D10:
684  case Hexagon::D11:
685  case Hexagon::P0:
686  subInstPtr.addOperand(Inst.getOperand(opNum));
687  break;
688  }
689  } else
690  subInstPtr.addOperand(Inst.getOperand(opNum));
691 }
692 
694  MCInst Result;
695  bool Absolute;
696  int64_t Value;
697  switch (Inst.getOpcode()) {
698  default:
699  // dbgs() << "opcode: "<< Inst->getOpcode() << "\n";
700  llvm_unreachable("Unimplemented subinstruction \n");
701  break;
702  case Hexagon::A2_addi:
703  Absolute = Inst.getOperand(2).getExpr()->evaluateAsAbsolute(Value);
704  if (Absolute) {
705  if (Value == 1) {
706  Result.setOpcode(Hexagon::SA1_inc);
707  addOps(Result, Inst, 0);
708  addOps(Result, Inst, 1);
709  break;
710  } // 1,2 SUBInst $Rd = add($Rs, #1)
711  if (Value == -1) {
712  Result.setOpcode(Hexagon::SA1_dec);
713  addOps(Result, Inst, 0);
714  addOps(Result, Inst, 1);
715  addOps(Result, Inst, 2);
716  break;
717  } // 1,2 SUBInst $Rd = add($Rs,#-1)
718  if (Inst.getOperand(1).getReg() == Hexagon::R29) {
719  Result.setOpcode(Hexagon::SA1_addsp);
720  addOps(Result, Inst, 0);
721  addOps(Result, Inst, 2);
722  break;
723  } // 1,3 SUBInst $Rd = add(r29, #$u6_2)
724  }
725  Result.setOpcode(Hexagon::SA1_addi);
726  addOps(Result, Inst, 0);
727  addOps(Result, Inst, 1);
728  addOps(Result, Inst, 2);
729  break; // 1,2,3 SUBInst $Rx = add($Rx, #$s7)
730  case Hexagon::A2_add:
731  Result.setOpcode(Hexagon::SA1_addrx);
732  addOps(Result, Inst, 0);
733  addOps(Result, Inst, 1);
734  addOps(Result, Inst, 2);
735  break; // 1,2,3 SUBInst $Rx = add($_src_, $Rs)
736  case Hexagon::S2_allocframe:
737  Result.setOpcode(Hexagon::SS2_allocframe);
738  addOps(Result, Inst, 0);
739  break; // 1 SUBInst allocframe(#$u5_3)
740  case Hexagon::A2_andir:
741  if (minConstant(Inst, 2) == 255) {
742  Result.setOpcode(Hexagon::SA1_zxtb);
743  addOps(Result, Inst, 0);
744  addOps(Result, Inst, 1);
745  break; // 1,2 $Rd = and($Rs, #255)
746  } else {
747  Result.setOpcode(Hexagon::SA1_and1);
748  addOps(Result, Inst, 0);
749  addOps(Result, Inst, 1);
750  break; // 1,2 SUBInst $Rd = and($Rs, #1)
751  }
752  case Hexagon::C2_cmpeqi:
753  Result.setOpcode(Hexagon::SA1_cmpeqi);
754  addOps(Result, Inst, 1);
755  addOps(Result, Inst, 2);
756  break; // 2,3 SUBInst p0 = cmp.eq($Rs, #$u2)
757  case Hexagon::A4_combineii:
758  case Hexagon::A2_combineii:
759  Absolute = Inst.getOperand(1).getExpr()->evaluateAsAbsolute(Value);
760  assert(Absolute);(void)Absolute;
761  if (Value == 1) {
762  Result.setOpcode(Hexagon::SA1_combine1i);
763  addOps(Result, Inst, 0);
764  addOps(Result, Inst, 2);
765  break; // 1,3 SUBInst $Rdd = combine(#1, #$u2)
766  }
767  if (Value == 3) {
768  Result.setOpcode(Hexagon::SA1_combine3i);
769  addOps(Result, Inst, 0);
770  addOps(Result, Inst, 2);
771  break; // 1,3 SUBInst $Rdd = combine(#3, #$u2)
772  }
773  if (Value == 0) {
774  Result.setOpcode(Hexagon::SA1_combine0i);
775  addOps(Result, Inst, 0);
776  addOps(Result, Inst, 2);
777  break; // 1,3 SUBInst $Rdd = combine(#0, #$u2)
778  }
779  if (Value == 2) {
780  Result.setOpcode(Hexagon::SA1_combine2i);
781  addOps(Result, Inst, 0);
782  addOps(Result, Inst, 2);
783  break; // 1,3 SUBInst $Rdd = combine(#2, #$u2)
784  }
785  case Hexagon::A4_combineir:
786  Result.setOpcode(Hexagon::SA1_combinezr);
787  addOps(Result, Inst, 0);
788  addOps(Result, Inst, 2);
789  break; // 1,3 SUBInst $Rdd = combine(#0, $Rs)
790 
791  case Hexagon::A4_combineri:
792  Result.setOpcode(Hexagon::SA1_combinerz);
793  addOps(Result, Inst, 0);
794  addOps(Result, Inst, 1);
795  break; // 1,2 SUBInst $Rdd = combine($Rs, #0)
796  case Hexagon::L4_return_tnew_pnt:
797  case Hexagon::L4_return_tnew_pt:
798  Result.setOpcode(Hexagon::SL2_return_tnew);
799  break; // none SUBInst if (p0.new) dealloc_return:nt
800  case Hexagon::L4_return_fnew_pnt:
801  case Hexagon::L4_return_fnew_pt:
802  Result.setOpcode(Hexagon::SL2_return_fnew);
803  break; // none SUBInst if (!p0.new) dealloc_return:nt
804  case Hexagon::L4_return_f:
805  Result.setOpcode(Hexagon::SL2_return_f);
806  break; // none SUBInst if (!p0) dealloc_return
807  case Hexagon::L4_return_t:
808  Result.setOpcode(Hexagon::SL2_return_t);
809  break; // none SUBInst if (p0) dealloc_return
810  case Hexagon::L4_return:
811  Result.setOpcode(Hexagon::SL2_return);
812  break; // none SUBInst dealloc_return
813  case Hexagon::L2_deallocframe:
814  Result.setOpcode(Hexagon::SL2_deallocframe);
815  break; // none SUBInst deallocframe
816  case Hexagon::EH_RETURN_JMPR:
817  case Hexagon::J2_jumpr:
818  case Hexagon::PS_jmpret:
819  Result.setOpcode(Hexagon::SL2_jumpr31);
820  break; // none SUBInst jumpr r31
821  case Hexagon::J2_jumprf:
822  case Hexagon::PS_jmpretf:
823  Result.setOpcode(Hexagon::SL2_jumpr31_f);
824  break; // none SUBInst if (!p0) jumpr r31
825  case Hexagon::J2_jumprfnew:
826  case Hexagon::J2_jumprfnewpt:
827  case Hexagon::PS_jmpretfnewpt:
828  case Hexagon::PS_jmpretfnew:
829  Result.setOpcode(Hexagon::SL2_jumpr31_fnew);
830  break; // none SUBInst if (!p0.new) jumpr:nt r31
831  case Hexagon::J2_jumprt:
832  case Hexagon::PS_jmprett:
833  Result.setOpcode(Hexagon::SL2_jumpr31_t);
834  break; // none SUBInst if (p0) jumpr r31
835  case Hexagon::J2_jumprtnew:
836  case Hexagon::J2_jumprtnewpt:
837  case Hexagon::PS_jmprettnewpt:
838  case Hexagon::PS_jmprettnew:
839  Result.setOpcode(Hexagon::SL2_jumpr31_tnew);
840  break; // none SUBInst if (p0.new) jumpr:nt r31
841  case Hexagon::L2_loadrb_io:
842  Result.setOpcode(Hexagon::SL2_loadrb_io);
843  addOps(Result, Inst, 0);
844  addOps(Result, Inst, 1);
845  addOps(Result, Inst, 2);
846  break; // 1,2,3 SUBInst $Rd = memb($Rs + #$u3_0)
847  case Hexagon::L2_loadrd_io:
848  Result.setOpcode(Hexagon::SL2_loadrd_sp);
849  addOps(Result, Inst, 0);
850  addOps(Result, Inst, 2);
851  break; // 1,3 SUBInst $Rdd = memd(r29 + #$u5_3)
852  case Hexagon::L2_loadrh_io:
853  Result.setOpcode(Hexagon::SL2_loadrh_io);
854  addOps(Result, Inst, 0);
855  addOps(Result, Inst, 1);
856  addOps(Result, Inst, 2);
857  break; // 1,2,3 SUBInst $Rd = memh($Rs + #$u3_1)
858  case Hexagon::L2_loadrub_io:
859  Result.setOpcode(Hexagon::SL1_loadrub_io);
860  addOps(Result, Inst, 0);
861  addOps(Result, Inst, 1);
862  addOps(Result, Inst, 2);
863  break; // 1,2,3 SUBInst $Rd = memub($Rs + #$u4_0)
864  case Hexagon::L2_loadruh_io:
865  Result.setOpcode(Hexagon::SL2_loadruh_io);
866  addOps(Result, Inst, 0);
867  addOps(Result, Inst, 1);
868  addOps(Result, Inst, 2);
869  break; // 1,2,3 SUBInst $Rd = memuh($Rs + #$u3_1)
870  case Hexagon::L2_loadri_io:
871  if (Inst.getOperand(1).getReg() == Hexagon::R29) {
872  Result.setOpcode(Hexagon::SL2_loadri_sp);
873  addOps(Result, Inst, 0);
874  addOps(Result, Inst, 2);
875  break; // 2 1,3 SUBInst $Rd = memw(r29 + #$u5_2)
876  } else {
877  Result.setOpcode(Hexagon::SL1_loadri_io);
878  addOps(Result, Inst, 0);
879  addOps(Result, Inst, 1);
880  addOps(Result, Inst, 2);
881  break; // 1,2,3 SUBInst $Rd = memw($Rs + #$u4_2)
882  }
883  case Hexagon::S4_storeirb_io:
884  Absolute = Inst.getOperand(2).getExpr()->evaluateAsAbsolute(Value);
885  assert(Absolute);(void)Absolute;
886  if (Value == 0) {
887  Result.setOpcode(Hexagon::SS2_storebi0);
888  addOps(Result, Inst, 0);
889  addOps(Result, Inst, 1);
890  break; // 1,2 SUBInst memb($Rs + #$u4_0)=#0
891  } else if (Value == 1) {
892  Result.setOpcode(Hexagon::SS2_storebi1);
893  addOps(Result, Inst, 0);
894  addOps(Result, Inst, 1);
895  break; // 2 1,2 SUBInst memb($Rs + #$u4_0)=#1
896  }
897  case Hexagon::S2_storerb_io:
898  Result.setOpcode(Hexagon::SS1_storeb_io);
899  addOps(Result, Inst, 0);
900  addOps(Result, Inst, 1);
901  addOps(Result, Inst, 2);
902  break; // 1,2,3 SUBInst memb($Rs + #$u4_0) = $Rt
903  case Hexagon::S2_storerd_io:
904  Result.setOpcode(Hexagon::SS2_stored_sp);
905  addOps(Result, Inst, 1);
906  addOps(Result, Inst, 2);
907  break; // 2,3 SUBInst memd(r29 + #$s6_3) = $Rtt
908  case Hexagon::S2_storerh_io:
909  Result.setOpcode(Hexagon::SS2_storeh_io);
910  addOps(Result, Inst, 0);
911  addOps(Result, Inst, 1);
912  addOps(Result, Inst, 2);
913  break; // 1,2,3 SUBInst memb($Rs + #$u4_0) = $Rt
914  case Hexagon::S4_storeiri_io:
915  Absolute = Inst.getOperand(2).getExpr()->evaluateAsAbsolute(Value);
916  assert(Absolute);(void)Absolute;
917  if (Value == 0) {
918  Result.setOpcode(Hexagon::SS2_storewi0);
919  addOps(Result, Inst, 0);
920  addOps(Result, Inst, 1);
921  break; // 3 1,2 SUBInst memw($Rs + #$u4_2)=#0
922  } else if (Value == 1) {
923  Result.setOpcode(Hexagon::SS2_storewi1);
924  addOps(Result, Inst, 0);
925  addOps(Result, Inst, 1);
926  break; // 3 1,2 SUBInst memw($Rs + #$u4_2)=#1
927  } else if (Inst.getOperand(0).getReg() == Hexagon::R29) {
928  Result.setOpcode(Hexagon::SS2_storew_sp);
929  addOps(Result, Inst, 1);
930  addOps(Result, Inst, 2);
931  break; // 1 2,3 SUBInst memw(r29 + #$u5_2) = $Rt
932  }
933  case Hexagon::S2_storeri_io:
934  if (Inst.getOperand(0).getReg() == Hexagon::R29) {
935  Result.setOpcode(Hexagon::SS2_storew_sp);
936  addOps(Result, Inst, 1);
937  addOps(Result, Inst, 2); // 1,2,3 SUBInst memw(sp + #$u5_2) = $Rt
938  } else {
939  Result.setOpcode(Hexagon::SS1_storew_io);
940  addOps(Result, Inst, 0);
941  addOps(Result, Inst, 1);
942  addOps(Result, Inst, 2); // 1,2,3 SUBInst memw($Rs + #$u4_2) = $Rt
943  }
944  break;
945  case Hexagon::A2_sxtb:
946  Result.setOpcode(Hexagon::SA1_sxtb);
947  addOps(Result, Inst, 0);
948  addOps(Result, Inst, 1);
949  break; // 1,2 SUBInst $Rd = sxtb($Rs)
950  case Hexagon::A2_sxth:
951  Result.setOpcode(Hexagon::SA1_sxth);
952  addOps(Result, Inst, 0);
953  addOps(Result, Inst, 1);
954  break; // 1,2 SUBInst $Rd = sxth($Rs)
955  case Hexagon::A2_tfr:
956  Result.setOpcode(Hexagon::SA1_tfr);
957  addOps(Result, Inst, 0);
958  addOps(Result, Inst, 1);
959  break; // 1,2 SUBInst $Rd = $Rs
960  case Hexagon::C2_cmovenewif:
961  Result.setOpcode(Hexagon::SA1_clrfnew);
962  addOps(Result, Inst, 0);
963  addOps(Result, Inst, 1);
964  break; // 2 SUBInst if (!p0.new) $Rd = #0
965  case Hexagon::C2_cmovenewit:
966  Result.setOpcode(Hexagon::SA1_clrtnew);
967  addOps(Result, Inst, 0);
968  addOps(Result, Inst, 1);
969  break; // 2 SUBInst if (p0.new) $Rd = #0
970  case Hexagon::C2_cmoveif:
971  Result.setOpcode(Hexagon::SA1_clrf);
972  addOps(Result, Inst, 0);
973  addOps(Result, Inst, 1);
974  break; // 2 SUBInst if (!p0) $Rd = #0
975  case Hexagon::C2_cmoveit:
976  Result.setOpcode(Hexagon::SA1_clrt);
977  addOps(Result, Inst, 0);
978  addOps(Result, Inst, 1);
979  break; // 2 SUBInst if (p0) $Rd = #0
980  case Hexagon::A2_tfrsi:
981  Absolute = Inst.getOperand(1).getExpr()->evaluateAsAbsolute(Value);
982  if (Absolute && Value == -1) {
983  Result.setOpcode(Hexagon::SA1_setin1);
984  addOps(Result, Inst, 0);
985  addOps(Result, Inst, 1);
986  break; // 2 1 SUBInst $Rd = #-1
987  } else {
988  Result.setOpcode(Hexagon::SA1_seti);
989  addOps(Result, Inst, 0);
990  addOps(Result, Inst, 1);
991  break; // 1,2 SUBInst $Rd = #$u6
992  }
993  case Hexagon::A2_zxtb:
994  Result.setOpcode(Hexagon::SA1_zxtb);
995  addOps(Result, Inst, 0);
996  addOps(Result, Inst, 1);
997  break; // 1,2 $Rd = and($Rs, #255)
998 
999  case Hexagon::A2_zxth:
1000  Result.setOpcode(Hexagon::SA1_zxth);
1001  addOps(Result, Inst, 0);
1002  addOps(Result, Inst, 1);
1003  break; // 1,2 SUBInst $Rd = zxth($Rs)
1004  }
1005  return Result;
1006 }
1007 
1008 static bool isStoreInst(unsigned opCode) {
1009  switch (opCode) {
1010  case Hexagon::S2_storeri_io:
1011  case Hexagon::S2_storerb_io:
1012  case Hexagon::S2_storerh_io:
1013  case Hexagon::S2_storerd_io:
1014  case Hexagon::S4_storeiri_io:
1015  case Hexagon::S4_storeirb_io:
1016  case Hexagon::S2_allocframe:
1017  return true;
1018  default:
1019  return false;
1020  }
1021 }
1022 
1025  MCSubtargetInfo const &STI,
1026  MCInst const &MCB) {
1027  assert(isBundle(MCB));
1028  SmallVector<DuplexCandidate, 8> duplexToTry;
1029  // Use an "order matters" version of isDuplexPair.
1030  unsigned numInstrInPacket = MCB.getNumOperands();
1031 
1032  for (unsigned distance = 1; distance < numInstrInPacket; ++distance) {
1034  k = j + distance;
1035  (j < numInstrInPacket) && (k < numInstrInPacket); ++j, ++k) {
1036 
1037  // Check if reversible.
1038  bool bisReversable = true;
1039  if (isStoreInst(MCB.getOperand(j).getInst()->getOpcode()) &&
1040  isStoreInst(MCB.getOperand(k).getInst()->getOpcode())) {
1041  DEBUG(dbgs() << "skip out of order write pair: " << k << "," << j
1042  << "\n");
1043  bisReversable = false;
1044  }
1045  if (HexagonMCInstrInfo::isMemReorderDisabled(MCB)) // }:mem_noshuf
1046  bisReversable = false;
1047 
1048  // Try in order.
1049  if (isOrderedDuplexPair(
1050  MCII, *MCB.getOperand(k).getInst(),
1052  *MCB.getOperand(j).getInst(),
1054  bisReversable, STI)) {
1055  // Get iClass.
1056  unsigned iClass = iClassOfDuplexPair(
1059 
1060  // Save off pairs for duplex checking.
1061  duplexToTry.push_back(DuplexCandidate(j, k, iClass));
1062  DEBUG(dbgs() << "adding pair: " << j << "," << k << ":"
1063  << MCB.getOperand(j).getInst()->getOpcode() << ","
1064  << MCB.getOperand(k).getInst()->getOpcode() << "\n");
1065  continue;
1066  } else {
1067  DEBUG(dbgs() << "skipping pair: " << j << "," << k << ":"
1068  << MCB.getOperand(j).getInst()->getOpcode() << ","
1069  << MCB.getOperand(k).getInst()->getOpcode() << "\n");
1070  }
1071 
1072  // Try reverse.
1073  if (bisReversable) {
1074  if (isOrderedDuplexPair(
1075  MCII, *MCB.getOperand(j).getInst(),
1077  *MCB.getOperand(k).getInst(),
1079  bisReversable, STI)) {
1080  // Get iClass.
1081  unsigned iClass = iClassOfDuplexPair(
1084 
1085  // Save off pairs for duplex checking.
1086  duplexToTry.push_back(DuplexCandidate(k, j, iClass));
1087  DEBUG(dbgs() << "adding pair:" << k << "," << j << ":"
1088  << MCB.getOperand(j).getInst()->getOpcode() << ","
1089  << MCB.getOperand(k).getInst()->getOpcode() << "\n");
1090  } else {
1091  DEBUG(dbgs() << "skipping pair: " << k << "," << j << ":"
1092  << MCB.getOperand(j).getInst()->getOpcode() << ","
1093  << MCB.getOperand(k).getInst()->getOpcode() << "\n");
1094  }
1095  }
1096  }
1097  }
1098  return duplexToTry;
1099 }
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:243
#define R4(n)
bool subInstWouldBeExtended(MCInst const &potentialDuplex)
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:234
bool isReg() const
Definition: MCInst.h:58
bool isDuplexPair(MCInst const &MIa, MCInst const &MIb)
Symmetrical. See if these two instructions are fit for duplex pair.
static const std::pair< unsigned, unsigned > opcodeData[]
bool isIntRegForSubInst(unsigned Reg)
LLVM_NODISCARD bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
Definition: StringRef.h:176
bool isBundle(MCInst const &MCI)
unsigned second
bool isDblRegForSubInst(unsigned Reg)
#define R2(n)
StringRef getCPU() const
getCPU - Return the CPU string.
unsigned getReg() const
Returns the register number.
Definition: MCInst.h:65
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:159
bool isDuplexPairMatch(unsigned Ga, unsigned Gb)
const MCExpr * getExpr() const
Definition: MCInst.h:96
unsigned getDuplexCandidateGroup(MCInst const &MI)
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
static void addOps(MCInst &subInstPtr, MCInst const &Inst, unsigned opNum)
void setOpcode(unsigned Op)
Definition: MCInst.h:167
size_t const bundleInstructionsOffset
#define R6(n)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
int64_t minConstant(MCInst const &MCI, size_t Index)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:132
unsigned getOpcode() const
Definition: MCInst.h:168
static bool isDuplexPairMatch(unsigned Ga, unsigned Gb)
bool isMemReorderDisabled(MCInst const &MCI)
MCInst deriveSubInst(MCInst const &Inst)
llvm_unreachable("Unknown RegBank!")
bool hasExtenderForIndex(MCInst const &MCB, size_t Index)
unsigned getNumOperands() const
Definition: MCInst.h:175
MCSubtargetInfo - Generic base class for all target subtargets.
const MCInst * getInst() const
Definition: MCInst.h:106
static bool isStoreInst(unsigned opCode)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Definition: Value.h:73
SmallVector< DuplexCandidate, 8 > getDuplexPossibilties(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCB)
#define DEBUG(X)
Definition: Debug.h:118
void addOperand(const MCOperand &Op)
Definition: MCInst.h:177
unsigned iClassOfDuplexPair(unsigned Ga, unsigned Gb)
const MCOperand & getOperand(unsigned i) const
Definition: MCInst.h:173
bool isOrderedDuplexPair(MCInstrInfo const &MCII, MCInst const &MIa, bool ExtendedA, MCInst const &MIb, bool ExtendedB, bool bisReversable, MCSubtargetInfo const &STI)
non-Symmetrical. See if these two instructions are fit for duplex pair.