1*9880d681SAndroid Build Coastguard Worker //===- HexagonMCInstrInfo.cpp - Utility functions on Hexagon MCInsts ------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // Utility functions for Hexagon specific MCInst queries
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINSTRINFO_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINSTRINFO_H
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker #include "HexagonMCExpr.h"
18*9880d681SAndroid Build Coastguard Worker #include "llvm/MC/MCInst.h"
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker namespace llvm {
21*9880d681SAndroid Build Coastguard Worker class HexagonMCChecker;
22*9880d681SAndroid Build Coastguard Worker class MCContext;
23*9880d681SAndroid Build Coastguard Worker class MCInstrDesc;
24*9880d681SAndroid Build Coastguard Worker class MCInstrInfo;
25*9880d681SAndroid Build Coastguard Worker class MCInst;
26*9880d681SAndroid Build Coastguard Worker class MCOperand;
27*9880d681SAndroid Build Coastguard Worker class MCSubtargetInfo;
28*9880d681SAndroid Build Coastguard Worker namespace HexagonII {
29*9880d681SAndroid Build Coastguard Worker enum class MemAccessSize;
30*9880d681SAndroid Build Coastguard Worker }
31*9880d681SAndroid Build Coastguard Worker class DuplexCandidate {
32*9880d681SAndroid Build Coastguard Worker public:
33*9880d681SAndroid Build Coastguard Worker unsigned packetIndexI, packetIndexJ, iClass;
DuplexCandidate(unsigned i,unsigned j,unsigned iClass)34*9880d681SAndroid Build Coastguard Worker DuplexCandidate(unsigned i, unsigned j, unsigned iClass)
35*9880d681SAndroid Build Coastguard Worker : packetIndexI(i), packetIndexJ(j), iClass(iClass) {}
36*9880d681SAndroid Build Coastguard Worker };
37*9880d681SAndroid Build Coastguard Worker namespace HexagonMCInstrInfo {
38*9880d681SAndroid Build Coastguard Worker size_t const innerLoopOffset = 0;
39*9880d681SAndroid Build Coastguard Worker int64_t const innerLoopMask = 1 << innerLoopOffset;
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker size_t const outerLoopOffset = 1;
42*9880d681SAndroid Build Coastguard Worker int64_t const outerLoopMask = 1 << outerLoopOffset;
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker // do not reorder memory load/stores by default load/stores are re-ordered
45*9880d681SAndroid Build Coastguard Worker // and by default loads can be re-ordered
46*9880d681SAndroid Build Coastguard Worker size_t const memReorderDisabledOffset = 2;
47*9880d681SAndroid Build Coastguard Worker int64_t const memReorderDisabledMask = 1 << memReorderDisabledOffset;
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker // allow re-ordering of memory stores by default stores cannot be re-ordered
50*9880d681SAndroid Build Coastguard Worker size_t const memStoreReorderEnabledOffset = 3;
51*9880d681SAndroid Build Coastguard Worker int64_t const memStoreReorderEnabledMask = 1 << memStoreReorderEnabledOffset;
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Worker size_t const bundleInstructionsOffset = 1;
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker void addConstant(MCInst &MI, uint64_t Value, MCContext &Context);
56*9880d681SAndroid Build Coastguard Worker void addConstExtender(MCContext &Context, MCInstrInfo const &MCII, MCInst &MCB,
57*9880d681SAndroid Build Coastguard Worker MCInst const &MCI);
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Worker // Returns a iterator range of instructions in this bundle
60*9880d681SAndroid Build Coastguard Worker iterator_range<MCInst::const_iterator> bundleInstructions(MCInst const &MCI);
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard Worker // Returns the number of instructions in the bundle
63*9880d681SAndroid Build Coastguard Worker size_t bundleSize(MCInst const &MCI);
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Worker // Put the packet in to canonical form, compound, duplex, pad, and shuffle
66*9880d681SAndroid Build Coastguard Worker bool canonicalizePacket(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
67*9880d681SAndroid Build Coastguard Worker MCContext &Context, MCInst &MCB,
68*9880d681SAndroid Build Coastguard Worker HexagonMCChecker *Checker);
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Worker // Clamp off upper 26 bits of extendable operand for emission
71*9880d681SAndroid Build Coastguard Worker void clampExtended(MCInstrInfo const &MCII, MCContext &Context, MCInst &MCI);
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard Worker MCInst createBundle();
74*9880d681SAndroid Build Coastguard Worker
75*9880d681SAndroid Build Coastguard Worker // Return the extender for instruction at Index or nullptr if none
76*9880d681SAndroid Build Coastguard Worker MCInst const *extenderForIndex(MCInst const &MCB, size_t Index);
77*9880d681SAndroid Build Coastguard Worker void extendIfNeeded(MCContext &Context, MCInstrInfo const &MCII, MCInst &MCB,
78*9880d681SAndroid Build Coastguard Worker MCInst const &MCI);
79*9880d681SAndroid Build Coastguard Worker
80*9880d681SAndroid Build Coastguard Worker // Create a duplex instruction given the two subinsts
81*9880d681SAndroid Build Coastguard Worker MCInst *deriveDuplex(MCContext &Context, unsigned iClass, MCInst const &inst0,
82*9880d681SAndroid Build Coastguard Worker MCInst const &inst1);
83*9880d681SAndroid Build Coastguard Worker MCInst deriveExtender(MCInstrInfo const &MCII, MCInst const &Inst,
84*9880d681SAndroid Build Coastguard Worker MCOperand const &MO);
85*9880d681SAndroid Build Coastguard Worker
86*9880d681SAndroid Build Coastguard Worker // Convert this instruction in to a duplex subinst
87*9880d681SAndroid Build Coastguard Worker MCInst deriveSubInst(MCInst const &Inst);
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Worker // Return the extender for instruction at Index or nullptr if none
90*9880d681SAndroid Build Coastguard Worker MCInst const *extenderForIndex(MCInst const &MCB, size_t Index);
91*9880d681SAndroid Build Coastguard Worker
92*9880d681SAndroid Build Coastguard Worker // Return memory access size
93*9880d681SAndroid Build Coastguard Worker HexagonII::MemAccessSize getAccessSize(MCInstrInfo const &MCII,
94*9880d681SAndroid Build Coastguard Worker MCInst const &MCI);
95*9880d681SAndroid Build Coastguard Worker
96*9880d681SAndroid Build Coastguard Worker // Return number of bits in the constant extended operand.
97*9880d681SAndroid Build Coastguard Worker unsigned getBitCount(MCInstrInfo const &MCII, MCInst const &MCI);
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Worker // Return constant extended operand number.
100*9880d681SAndroid Build Coastguard Worker unsigned short getCExtOpNum(MCInstrInfo const &MCII, MCInst const &MCI);
101*9880d681SAndroid Build Coastguard Worker
102*9880d681SAndroid Build Coastguard Worker MCInstrDesc const &getDesc(MCInstrInfo const &MCII, MCInst const &MCI);
103*9880d681SAndroid Build Coastguard Worker
104*9880d681SAndroid Build Coastguard Worker // Return which duplex group this instruction belongs to
105*9880d681SAndroid Build Coastguard Worker unsigned getDuplexCandidateGroup(MCInst const &MI);
106*9880d681SAndroid Build Coastguard Worker
107*9880d681SAndroid Build Coastguard Worker // Return a list of all possible instruction duplex combinations
108*9880d681SAndroid Build Coastguard Worker SmallVector<DuplexCandidate, 8> getDuplexPossibilties(MCInstrInfo const &MCII,
109*9880d681SAndroid Build Coastguard Worker MCInst const &MCB);
110*9880d681SAndroid Build Coastguard Worker unsigned getDuplexRegisterNumbering(unsigned Reg);
111*9880d681SAndroid Build Coastguard Worker
112*9880d681SAndroid Build Coastguard Worker MCExpr const &getExpr(MCExpr const &Expr);
113*9880d681SAndroid Build Coastguard Worker
114*9880d681SAndroid Build Coastguard Worker // Return the index of the extendable operand
115*9880d681SAndroid Build Coastguard Worker unsigned short getExtendableOp(MCInstrInfo const &MCII, MCInst const &MCI);
116*9880d681SAndroid Build Coastguard Worker
117*9880d681SAndroid Build Coastguard Worker // Return a reference to the extendable operand
118*9880d681SAndroid Build Coastguard Worker MCOperand const &getExtendableOperand(MCInstrInfo const &MCII,
119*9880d681SAndroid Build Coastguard Worker MCInst const &MCI);
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Worker // Return the implicit alignment of the extendable operand
122*9880d681SAndroid Build Coastguard Worker unsigned getExtentAlignment(MCInstrInfo const &MCII, MCInst const &MCI);
123*9880d681SAndroid Build Coastguard Worker
124*9880d681SAndroid Build Coastguard Worker // Return the number of logical bits of the extendable operand
125*9880d681SAndroid Build Coastguard Worker unsigned getExtentBits(MCInstrInfo const &MCII, MCInst const &MCI);
126*9880d681SAndroid Build Coastguard Worker
127*9880d681SAndroid Build Coastguard Worker // Return the max value that a constant extendable operand can have
128*9880d681SAndroid Build Coastguard Worker // without being extended.
129*9880d681SAndroid Build Coastguard Worker int getMaxValue(MCInstrInfo const &MCII, MCInst const &MCI);
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard Worker // Return the min value that a constant extendable operand can have
132*9880d681SAndroid Build Coastguard Worker // without being extended.
133*9880d681SAndroid Build Coastguard Worker int getMinValue(MCInstrInfo const &MCII, MCInst const &MCI);
134*9880d681SAndroid Build Coastguard Worker
135*9880d681SAndroid Build Coastguard Worker // Return instruction name
136*9880d681SAndroid Build Coastguard Worker char const *getName(MCInstrInfo const &MCII, MCInst const &MCI);
137*9880d681SAndroid Build Coastguard Worker
138*9880d681SAndroid Build Coastguard Worker // Return the operand index for the new value.
139*9880d681SAndroid Build Coastguard Worker unsigned short getNewValueOp(MCInstrInfo const &MCII, MCInst const &MCI);
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard Worker // Return the operand that consumes or produces a new value.
142*9880d681SAndroid Build Coastguard Worker MCOperand const &getNewValueOperand(MCInstrInfo const &MCII, MCInst const &MCI);
143*9880d681SAndroid Build Coastguard Worker unsigned short getNewValueOp2(MCInstrInfo const &MCII, MCInst const &MCI);
144*9880d681SAndroid Build Coastguard Worker MCOperand const &getNewValueOperand2(MCInstrInfo const &MCII,
145*9880d681SAndroid Build Coastguard Worker MCInst const &MCI);
146*9880d681SAndroid Build Coastguard Worker
147*9880d681SAndroid Build Coastguard Worker int getSubTarget(MCInstrInfo const &MCII, MCInst const &MCI);
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Worker // Return the Hexagon ISA class for the insn.
150*9880d681SAndroid Build Coastguard Worker unsigned getType(MCInstrInfo const &MCII, MCInst const &MCI);
151*9880d681SAndroid Build Coastguard Worker
152*9880d681SAndroid Build Coastguard Worker /// Return the slots used by the insn.
153*9880d681SAndroid Build Coastguard Worker unsigned getUnits(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
154*9880d681SAndroid Build Coastguard Worker MCInst const &MCI);
155*9880d681SAndroid Build Coastguard Worker
156*9880d681SAndroid Build Coastguard Worker // Does the packet have an extender for the instruction at Index
157*9880d681SAndroid Build Coastguard Worker bool hasExtenderForIndex(MCInst const &MCB, size_t Index);
158*9880d681SAndroid Build Coastguard Worker
159*9880d681SAndroid Build Coastguard Worker bool hasImmExt(MCInst const &MCI);
160*9880d681SAndroid Build Coastguard Worker
161*9880d681SAndroid Build Coastguard Worker // Return whether the instruction is a legal new-value producer.
162*9880d681SAndroid Build Coastguard Worker bool hasNewValue(MCInstrInfo const &MCII, MCInst const &MCI);
163*9880d681SAndroid Build Coastguard Worker bool hasNewValue2(MCInstrInfo const &MCII, MCInst const &MCI);
164*9880d681SAndroid Build Coastguard Worker
165*9880d681SAndroid Build Coastguard Worker // Return the instruction at Index
166*9880d681SAndroid Build Coastguard Worker MCInst const &instruction(MCInst const &MCB, size_t Index);
167*9880d681SAndroid Build Coastguard Worker
168*9880d681SAndroid Build Coastguard Worker // Returns whether this MCInst is a wellformed bundle
169*9880d681SAndroid Build Coastguard Worker bool isBundle(MCInst const &MCI);
170*9880d681SAndroid Build Coastguard Worker
171*9880d681SAndroid Build Coastguard Worker // Return whether the insn is an actual insn.
172*9880d681SAndroid Build Coastguard Worker bool isCanon(MCInstrInfo const &MCII, MCInst const &MCI);
173*9880d681SAndroid Build Coastguard Worker bool isCompound(MCInstrInfo const &MCII, MCInst const &MCI);
174*9880d681SAndroid Build Coastguard Worker
175*9880d681SAndroid Build Coastguard Worker // Return the duplex iclass given the two duplex classes
176*9880d681SAndroid Build Coastguard Worker unsigned iClassOfDuplexPair(unsigned Ga, unsigned Gb);
177*9880d681SAndroid Build Coastguard Worker
178*9880d681SAndroid Build Coastguard Worker int64_t minConstant(MCInst const &MCI, size_t Index);
179*9880d681SAndroid Build Coastguard Worker template <unsigned N, unsigned S>
inRange(MCInst const & MCI,size_t Index)180*9880d681SAndroid Build Coastguard Worker bool inRange(MCInst const &MCI, size_t Index) {
181*9880d681SAndroid Build Coastguard Worker return isShiftedUInt<N, S>(minConstant(MCI, Index));
182*9880d681SAndroid Build Coastguard Worker }
183*9880d681SAndroid Build Coastguard Worker template <unsigned N, unsigned S>
inSRange(MCInst const & MCI,size_t Index)184*9880d681SAndroid Build Coastguard Worker bool inSRange(MCInst const &MCI, size_t Index) {
185*9880d681SAndroid Build Coastguard Worker return isShiftedInt<N, S>(minConstant(MCI, Index));
186*9880d681SAndroid Build Coastguard Worker }
inRange(MCInst const & MCI,size_t Index)187*9880d681SAndroid Build Coastguard Worker template <unsigned N> bool inRange(MCInst const &MCI, size_t Index) {
188*9880d681SAndroid Build Coastguard Worker return isUInt<N>(minConstant(MCI, Index));
189*9880d681SAndroid Build Coastguard Worker }
190*9880d681SAndroid Build Coastguard Worker
191*9880d681SAndroid Build Coastguard Worker // Return whether the instruction needs to be constant extended.
192*9880d681SAndroid Build Coastguard Worker bool isConstExtended(MCInstrInfo const &MCII, MCInst const &MCI);
193*9880d681SAndroid Build Coastguard Worker
194*9880d681SAndroid Build Coastguard Worker // Is this double register suitable for use in a duplex subinst
195*9880d681SAndroid Build Coastguard Worker bool isDblRegForSubInst(unsigned Reg);
196*9880d681SAndroid Build Coastguard Worker
197*9880d681SAndroid Build Coastguard Worker // Is this a duplex instruction
198*9880d681SAndroid Build Coastguard Worker bool isDuplex(MCInstrInfo const &MCII, MCInst const &MCI);
199*9880d681SAndroid Build Coastguard Worker
200*9880d681SAndroid Build Coastguard Worker // Can these instructions be duplexed
201*9880d681SAndroid Build Coastguard Worker bool isDuplexPair(MCInst const &MIa, MCInst const &MIb);
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard Worker // Can these duplex classes be combine in to a duplex instruction
204*9880d681SAndroid Build Coastguard Worker bool isDuplexPairMatch(unsigned Ga, unsigned Gb);
205*9880d681SAndroid Build Coastguard Worker
206*9880d681SAndroid Build Coastguard Worker // Return true if the insn may be extended based on the operand value.
207*9880d681SAndroid Build Coastguard Worker bool isExtendable(MCInstrInfo const &MCII, MCInst const &MCI);
208*9880d681SAndroid Build Coastguard Worker
209*9880d681SAndroid Build Coastguard Worker // Return whether the instruction must be always extended.
210*9880d681SAndroid Build Coastguard Worker bool isExtended(MCInstrInfo const &MCII, MCInst const &MCI);
211*9880d681SAndroid Build Coastguard Worker
212*9880d681SAndroid Build Coastguard Worker /// Return whether it is a floating-point insn.
213*9880d681SAndroid Build Coastguard Worker bool isFloat(MCInstrInfo const &MCII, MCInst const &MCI);
214*9880d681SAndroid Build Coastguard Worker
215*9880d681SAndroid Build Coastguard Worker // Returns whether this instruction is an immediate extender
216*9880d681SAndroid Build Coastguard Worker bool isImmext(MCInst const &MCI);
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard Worker // Returns whether this bundle is an endloop0
219*9880d681SAndroid Build Coastguard Worker bool isInnerLoop(MCInst const &MCI);
220*9880d681SAndroid Build Coastguard Worker
221*9880d681SAndroid Build Coastguard Worker // Is this an integer register
222*9880d681SAndroid Build Coastguard Worker bool isIntReg(unsigned Reg);
223*9880d681SAndroid Build Coastguard Worker
224*9880d681SAndroid Build Coastguard Worker // Is this register suitable for use in a duplex subinst
225*9880d681SAndroid Build Coastguard Worker bool isIntRegForSubInst(unsigned Reg);
226*9880d681SAndroid Build Coastguard Worker bool isMemReorderDisabled(MCInst const &MCI);
227*9880d681SAndroid Build Coastguard Worker bool isMemStoreReorderEnabled(MCInst const &MCI);
228*9880d681SAndroid Build Coastguard Worker
229*9880d681SAndroid Build Coastguard Worker // Return whether the insn is a new-value consumer.
230*9880d681SAndroid Build Coastguard Worker bool isNewValue(MCInstrInfo const &MCII, MCInst const &MCI);
231*9880d681SAndroid Build Coastguard Worker
232*9880d681SAndroid Build Coastguard Worker // Return true if the operand can be constant extended.
233*9880d681SAndroid Build Coastguard Worker bool isOperandExtended(MCInstrInfo const &MCII, MCInst const &MCI,
234*9880d681SAndroid Build Coastguard Worker unsigned short OperandNum);
235*9880d681SAndroid Build Coastguard Worker
236*9880d681SAndroid Build Coastguard Worker // Can these two instructions be duplexed
237*9880d681SAndroid Build Coastguard Worker bool isOrderedDuplexPair(MCInstrInfo const &MCII, MCInst const &MIa,
238*9880d681SAndroid Build Coastguard Worker bool ExtendedA, MCInst const &MIb, bool ExtendedB,
239*9880d681SAndroid Build Coastguard Worker bool bisReversable);
240*9880d681SAndroid Build Coastguard Worker
241*9880d681SAndroid Build Coastguard Worker // Returns whether this bundle is an endloop1
242*9880d681SAndroid Build Coastguard Worker bool isOuterLoop(MCInst const &MCI);
243*9880d681SAndroid Build Coastguard Worker
244*9880d681SAndroid Build Coastguard Worker // Return whether this instruction is predicated
245*9880d681SAndroid Build Coastguard Worker bool isPredicated(MCInstrInfo const &MCII, MCInst const &MCI);
246*9880d681SAndroid Build Coastguard Worker bool isPredicateLate(MCInstrInfo const &MCII, MCInst const &MCI);
247*9880d681SAndroid Build Coastguard Worker bool isPredicatedNew(MCInstrInfo const &MCII, MCInst const &MCI);
248*9880d681SAndroid Build Coastguard Worker
249*9880d681SAndroid Build Coastguard Worker // Return whether the predicate sense is true
250*9880d681SAndroid Build Coastguard Worker bool isPredicatedTrue(MCInstrInfo const &MCII, MCInst const &MCI);
251*9880d681SAndroid Build Coastguard Worker
252*9880d681SAndroid Build Coastguard Worker // Is this a predicate register
253*9880d681SAndroid Build Coastguard Worker bool isPredReg(unsigned Reg);
254*9880d681SAndroid Build Coastguard Worker
255*9880d681SAndroid Build Coastguard Worker // Return whether the insn is a prefix.
256*9880d681SAndroid Build Coastguard Worker bool isPrefix(MCInstrInfo const &MCII, MCInst const &MCI);
257*9880d681SAndroid Build Coastguard Worker
258*9880d681SAndroid Build Coastguard Worker // Return whether the insn is solo, i.e., cannot be in a packet.
259*9880d681SAndroid Build Coastguard Worker bool isSolo(MCInstrInfo const &MCII, MCInst const &MCI);
260*9880d681SAndroid Build Coastguard Worker
261*9880d681SAndroid Build Coastguard Worker /// Return whether the insn can be packaged only with A and X-type insns.
262*9880d681SAndroid Build Coastguard Worker bool isSoloAX(MCInstrInfo const &MCII, MCInst const &MCI);
263*9880d681SAndroid Build Coastguard Worker
264*9880d681SAndroid Build Coastguard Worker /// Return whether the insn can be packaged only with an A-type insn in slot #1.
265*9880d681SAndroid Build Coastguard Worker bool isSoloAin1(MCInstrInfo const &MCII, MCInst const &MCI);
266*9880d681SAndroid Build Coastguard Worker bool isSubInstruction(MCInst const &MCI);
267*9880d681SAndroid Build Coastguard Worker bool isVector(MCInstrInfo const &MCII, MCInst const &MCI);
268*9880d681SAndroid Build Coastguard Worker bool mustExtend(MCExpr const &Expr);
269*9880d681SAndroid Build Coastguard Worker bool mustNotExtend(MCExpr const &Expr);
270*9880d681SAndroid Build Coastguard Worker
271*9880d681SAndroid Build Coastguard Worker // Pad the bundle with nops to satisfy endloop requirements
272*9880d681SAndroid Build Coastguard Worker void padEndloop(MCContext &Context, MCInst &MCI);
273*9880d681SAndroid Build Coastguard Worker
274*9880d681SAndroid Build Coastguard Worker bool prefersSlot3(MCInstrInfo const &MCII, MCInst const &MCI);
275*9880d681SAndroid Build Coastguard Worker
276*9880d681SAndroid Build Coastguard Worker // Replace the instructions inside MCB, represented by Candidate
277*9880d681SAndroid Build Coastguard Worker void replaceDuplex(MCContext &Context, MCInst &MCB, DuplexCandidate Candidate);
278*9880d681SAndroid Build Coastguard Worker
279*9880d681SAndroid Build Coastguard Worker bool s23_2_reloc(MCExpr const &Expr);
280*9880d681SAndroid Build Coastguard Worker // Marks a bundle as endloop0
281*9880d681SAndroid Build Coastguard Worker void setInnerLoop(MCInst &MCI);
282*9880d681SAndroid Build Coastguard Worker void setMemReorderDisabled(MCInst &MCI);
283*9880d681SAndroid Build Coastguard Worker void setMemStoreReorderEnabled(MCInst &MCI);
284*9880d681SAndroid Build Coastguard Worker void setMustExtend(MCExpr const &Expr, bool Val = true);
285*9880d681SAndroid Build Coastguard Worker void setMustNotExtend(MCExpr const &Expr, bool Val = true);
286*9880d681SAndroid Build Coastguard Worker void setS23_2_reloc(MCExpr const &Expr, bool Val = true);
287*9880d681SAndroid Build Coastguard Worker
288*9880d681SAndroid Build Coastguard Worker // Marks a bundle as endloop1
289*9880d681SAndroid Build Coastguard Worker void setOuterLoop(MCInst &MCI);
290*9880d681SAndroid Build Coastguard Worker
291*9880d681SAndroid Build Coastguard Worker // Would duplexing this instruction create a requirement to extend
292*9880d681SAndroid Build Coastguard Worker bool subInstWouldBeExtended(MCInst const &potentialDuplex);
293*9880d681SAndroid Build Coastguard Worker unsigned SubregisterBit(unsigned Consumer, unsigned Producer,
294*9880d681SAndroid Build Coastguard Worker unsigned Producer2);
295*9880d681SAndroid Build Coastguard Worker
296*9880d681SAndroid Build Coastguard Worker // Attempt to find and replace compound pairs
297*9880d681SAndroid Build Coastguard Worker void tryCompound(MCInstrInfo const &MCII, MCContext &Context, MCInst &MCI);
298*9880d681SAndroid Build Coastguard Worker }
299*9880d681SAndroid Build Coastguard Worker }
300*9880d681SAndroid Build Coastguard Worker
301*9880d681SAndroid Build Coastguard Worker #endif // LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONMCINSTRINFO_H
302