27 using namespace Hexagon;
29 #define DEBUG_TYPE "hexagon-mccompound" 43 J4_tstbit0_fp0_jump_nt, J4_tstbit0_fp0_jump_t, J4_tstbit0_fp1_jump_nt,
44 J4_tstbit0_fp1_jump_t, J4_tstbit0_tp0_jump_nt, J4_tstbit0_tp0_jump_t,
45 J4_tstbit0_tp1_jump_nt, J4_tstbit0_tp1_jump_t};
47 J4_cmpeq_fp0_jump_nt, J4_cmpeq_fp0_jump_t, J4_cmpeq_fp1_jump_nt,
48 J4_cmpeq_fp1_jump_t, J4_cmpeq_tp0_jump_nt, J4_cmpeq_tp0_jump_t,
49 J4_cmpeq_tp1_jump_nt, J4_cmpeq_tp1_jump_t};
51 J4_cmpgt_fp0_jump_nt, J4_cmpgt_fp0_jump_t, J4_cmpgt_fp1_jump_nt,
52 J4_cmpgt_fp1_jump_t, J4_cmpgt_tp0_jump_nt, J4_cmpgt_tp0_jump_t,
53 J4_cmpgt_tp1_jump_nt, J4_cmpgt_tp1_jump_t};
55 J4_cmpgtu_fp0_jump_nt, J4_cmpgtu_fp0_jump_t, J4_cmpgtu_fp1_jump_nt,
56 J4_cmpgtu_fp1_jump_t, J4_cmpgtu_tp0_jump_nt, J4_cmpgtu_tp0_jump_t,
57 J4_cmpgtu_tp1_jump_nt, J4_cmpgtu_tp1_jump_t};
59 J4_cmpeqi_fp0_jump_nt, J4_cmpeqi_fp0_jump_t, J4_cmpeqi_fp1_jump_nt,
60 J4_cmpeqi_fp1_jump_t, J4_cmpeqi_tp0_jump_nt, J4_cmpeqi_tp0_jump_t,
61 J4_cmpeqi_tp1_jump_nt, J4_cmpeqi_tp1_jump_t};
63 J4_cmpgti_fp0_jump_nt, J4_cmpgti_fp0_jump_t, J4_cmpgti_fp1_jump_nt,
64 J4_cmpgti_fp1_jump_t, J4_cmpgti_tp0_jump_nt, J4_cmpgti_tp0_jump_t,
65 J4_cmpgti_tp1_jump_nt, J4_cmpgti_tp1_jump_t};
67 J4_cmpgtui_fp0_jump_nt, J4_cmpgtui_fp0_jump_t, J4_cmpgtui_fp1_jump_nt,
68 J4_cmpgtui_fp1_jump_t, J4_cmpgtui_tp0_jump_nt, J4_cmpgtui_tp0_jump_t,
69 J4_cmpgtui_tp1_jump_nt, J4_cmpgtui_tp1_jump_t};
71 J4_cmpeqn1_fp0_jump_nt, J4_cmpeqn1_fp0_jump_t, J4_cmpeqn1_fp1_jump_nt,
72 J4_cmpeqn1_fp1_jump_t, J4_cmpeqn1_tp0_jump_nt, J4_cmpeqn1_tp0_jump_t,
73 J4_cmpeqn1_tp1_jump_nt, J4_cmpeqn1_tp1_jump_t};
75 J4_cmpgtn1_fp0_jump_nt, J4_cmpgtn1_fp0_jump_t, J4_cmpgtn1_fp1_jump_nt,
76 J4_cmpgtn1_fp1_jump_t, J4_cmpgtn1_tp0_jump_nt, J4_cmpgtn1_tp0_jump_t,
77 J4_cmpgtn1_tp1_jump_nt, J4_cmpgtn1_tp1_jump_t,
82 unsigned DstReg, SrcReg, Src1Reg, Src2Reg;
93 case Hexagon::C2_cmpeq:
94 case Hexagon::C2_cmpgt:
95 case Hexagon::C2_cmpgtu:
101 if ((Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
106 case Hexagon::C2_cmpeqi:
107 case Hexagon::C2_cmpgti:
108 case Hexagon::C2_cmpgtui:
114 if ((Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
116 (HexagonMCInstrInfo::inRange<5>(MI, 2) ||
120 case Hexagon::A2_tfr:
130 case Hexagon::A2_tfrsi:
140 case Hexagon::S2_tstbit_i:
145 if ((Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) &&
154 case Hexagon::J2_jumptnew:
155 case Hexagon::J2_jumpfnew:
156 case Hexagon::J2_jumptnewpt:
157 case Hexagon::J2_jumpfnewpt:
159 if (Hexagon::P0 == Src1Reg || Hexagon::P1 == Src1Reg)
166 case Hexagon::J2_jump:
167 case Hexagon::RESTORE_DEALLOC_RET_JMP_V4:
178 unsigned PredReg = Predicate.
getReg();
180 assert((PredReg == Hexagon::P0) || (PredReg == Hexagon::P1) ||
181 (PredReg == Hexagon::P2) || (PredReg == Hexagon::P3));
187 case Hexagon::J2_jumpfnew:
189 case Hexagon::J2_jumpfnewpt:
191 case Hexagon::J2_jumptnew:
193 case Hexagon::J2_jumptnewpt:
200 MCInst *CompoundInsn =
nullptr;
201 unsigned compoundOpcode;
211 case Hexagon::A2_tfrsi:
213 compoundOpcode = J4_jumpseti;
222 case Hexagon::A2_tfr:
226 compoundOpcode = J4_jumpsetr;
235 case Hexagon::C2_cmpeq:
248 case Hexagon::C2_cmpgt:
261 case Hexagon::C2_cmpgtu:
274 case Hexagon::C2_cmpeqi:
292 case Hexagon::C2_cmpgti:
310 case Hexagon::C2_cmpgtui:
321 case Hexagon::S2_tstbit_i:
337 MCInst const &MIb,
bool IsExtendedB) {
344 (Opca == Hexagon::A2_tfr || Opca == Hexagon::A2_tfrsi))
353 bool JExtended =
false;
356 J != MCI.
end(); ++J) {
357 MCInst const *JumpInst = J->getInst();
364 bool BExtended =
false;
367 B != MCI.
end(); ++
B) {
368 MCInst const *Inst =
B->getInst();
369 if (JumpInst == Inst)
381 << JumpInst->
getOpcode() <<
" Compounds to " 383 J->setInst(CompoundInsn);
403 "Non-Bundle where Bundle expected");
418 MCInst OriginalBundle(MCI);
426 MCI = OriginalBundle;
This class represents lattice values for constants.
bool isIntRegForSubInst(unsigned Reg)
bool isBundle(MCInst const &MCI)
static const unsigned tstBitOpcode[8]
bool isImmext(MCInst const &MCI)
void tryCompound(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCContext &Context, MCInst &MCI)
tryCompound - Given a bundle check for compound insns when one is found update the contents fo the bu...
static const unsigned cmpeqBitOpcode[8]
unsigned getReg() const
Returns the register number.
Context object for machine code objects.
const MCExpr * getExpr() const
bool HexagonMCShuffle(MCContext &Context, bool Fatal, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
Instances of this class represent a single low-level machine instruction.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static const unsigned cmpgtuBitOpcode[8]
static unsigned getCompoundOp(MCInst const &HMCI)
getCompoundOp - Return the index from 0-7 into the above opcode lists.
static const unsigned cmpeqiBitOpcode[8]
Interface to description of machine instruction set.
static MCInst * getCompoundInsn(MCContext &Context, MCInst const &L, MCInst const &R)
SmallVectorImpl< MCOperand >::iterator iterator
static bool isOrderedCompoundPair(MCInst const &MIa, bool IsExtendedA, MCInst const &MIb, bool IsExtendedB)
Non-Symmetrical. See if these two instructions are fit for compound pair.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void setOpcode(unsigned Op)
size_t const bundleInstructionsOffset
static unsigned getCompoundCandidateGroup(MCInst const &MI, bool IsExtended)
const MCOperand & getOperand(unsigned i) const
static const unsigned cmpgtn1BitOpcode[8]
int64_t minConstant(MCInst const &MCI, size_t Index)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static const unsigned cmpeqn1BitOpcode[8]
Generic base class for all target subtargets.
static const unsigned cmpgtiBitOpcode[8]
static const unsigned cmpgtuiBitOpcode[8]
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
static const unsigned cmpgtBitOpcode[8]
void addOperand(const MCOperand &Op)
unsigned getType(MCInstrInfo const &MCII, MCInst const &MCI)
Return the Hexagon ISA class for the insn.
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.
static bool lookForCompound(MCInstrInfo const &MCII, MCContext &Context, MCInst &MCI)