1f4a2713aSLionel Sambuc //===-- SystemZISelLowering.h - SystemZ DAG lowering interface --*- C++ -*-===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc // This file defines the interfaces that SystemZ uses to lower LLVM code into a
11f4a2713aSLionel Sambuc // selection DAG.
12f4a2713aSLionel Sambuc //
13f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
14f4a2713aSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZISELLOWERING_H
16*0a6a1f1dSLionel Sambuc #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZISELLOWERING_H
17f4a2713aSLionel Sambuc 
18f4a2713aSLionel Sambuc #include "SystemZ.h"
19f4a2713aSLionel Sambuc #include "llvm/CodeGen/MachineBasicBlock.h"
20f4a2713aSLionel Sambuc #include "llvm/CodeGen/SelectionDAG.h"
21f4a2713aSLionel Sambuc #include "llvm/Target/TargetLowering.h"
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc namespace llvm {
24f4a2713aSLionel Sambuc namespace SystemZISD {
25f4a2713aSLionel Sambuc enum {
26f4a2713aSLionel Sambuc   FIRST_NUMBER = ISD::BUILTIN_OP_END,
27f4a2713aSLionel Sambuc 
28f4a2713aSLionel Sambuc   // Return with a flag operand.  Operand 0 is the chain operand.
29f4a2713aSLionel Sambuc   RET_FLAG,
30f4a2713aSLionel Sambuc 
31f4a2713aSLionel Sambuc   // Calls a function.  Operand 0 is the chain operand and operand 1
32f4a2713aSLionel Sambuc   // is the target address.  The arguments start at operand 2.
33f4a2713aSLionel Sambuc   // There is an optional glue operand at the end.
34f4a2713aSLionel Sambuc   CALL,
35f4a2713aSLionel Sambuc   SIBCALL,
36f4a2713aSLionel Sambuc 
37f4a2713aSLionel Sambuc   // Wraps a TargetGlobalAddress that should be loaded using PC-relative
38f4a2713aSLionel Sambuc   // accesses (LARL).  Operand 0 is the address.
39f4a2713aSLionel Sambuc   PCREL_WRAPPER,
40f4a2713aSLionel Sambuc 
41f4a2713aSLionel Sambuc   // Used in cases where an offset is applied to a TargetGlobalAddress.
42f4a2713aSLionel Sambuc   // Operand 0 is the full TargetGlobalAddress and operand 1 is a
43f4a2713aSLionel Sambuc   // PCREL_WRAPPER for an anchor point.  This is used so that we can
44f4a2713aSLionel Sambuc   // cheaply refer to either the full address or the anchor point
45f4a2713aSLionel Sambuc   // as a register base.
46f4a2713aSLionel Sambuc   PCREL_OFFSET,
47f4a2713aSLionel Sambuc 
48*0a6a1f1dSLionel Sambuc   // Integer absolute.
49*0a6a1f1dSLionel Sambuc   IABS,
50*0a6a1f1dSLionel Sambuc 
51f4a2713aSLionel Sambuc   // Integer comparisons.  There are three operands: the two values
52f4a2713aSLionel Sambuc   // to compare, and an integer of type SystemZICMP.
53f4a2713aSLionel Sambuc   ICMP,
54f4a2713aSLionel Sambuc 
55f4a2713aSLionel Sambuc   // Floating-point comparisons.  The two operands are the values to compare.
56f4a2713aSLionel Sambuc   FCMP,
57f4a2713aSLionel Sambuc 
58f4a2713aSLionel Sambuc   // Test under mask.  The first operand is ANDed with the second operand
59f4a2713aSLionel Sambuc   // and the condition codes are set on the result.  The third operand is
60f4a2713aSLionel Sambuc   // a boolean that is true if the condition codes need to distinguish
61f4a2713aSLionel Sambuc   // between CCMASK_TM_MIXED_MSB_0 and CCMASK_TM_MIXED_MSB_1 (which the
62f4a2713aSLionel Sambuc   // register forms do but the memory forms don't).
63f4a2713aSLionel Sambuc   TM,
64f4a2713aSLionel Sambuc 
65f4a2713aSLionel Sambuc   // Branches if a condition is true.  Operand 0 is the chain operand;
66f4a2713aSLionel Sambuc   // operand 1 is the 4-bit condition-code mask, with bit N in
67f4a2713aSLionel Sambuc   // big-endian order meaning "branch if CC=N"; operand 2 is the
68f4a2713aSLionel Sambuc   // target block and operand 3 is the flag operand.
69f4a2713aSLionel Sambuc   BR_CCMASK,
70f4a2713aSLionel Sambuc 
71f4a2713aSLionel Sambuc   // Selects between operand 0 and operand 1.  Operand 2 is the
72f4a2713aSLionel Sambuc   // mask of condition-code values for which operand 0 should be
73f4a2713aSLionel Sambuc   // chosen over operand 1; it has the same form as BR_CCMASK.
74f4a2713aSLionel Sambuc   // Operand 3 is the flag operand.
75f4a2713aSLionel Sambuc   SELECT_CCMASK,
76f4a2713aSLionel Sambuc 
77f4a2713aSLionel Sambuc   // Evaluates to the gap between the stack pointer and the
78f4a2713aSLionel Sambuc   // base of the dynamically-allocatable area.
79f4a2713aSLionel Sambuc   ADJDYNALLOC,
80f4a2713aSLionel Sambuc 
81f4a2713aSLionel Sambuc   // Extracts the value of a 32-bit access register.  Operand 0 is
82f4a2713aSLionel Sambuc   // the number of the register.
83f4a2713aSLionel Sambuc   EXTRACT_ACCESS,
84f4a2713aSLionel Sambuc 
85f4a2713aSLionel Sambuc   // Wrappers around the ISD opcodes of the same name.  The output and
86f4a2713aSLionel Sambuc   // first input operands are GR128s.  The trailing numbers are the
87f4a2713aSLionel Sambuc   // widths of the second operand in bits.
88f4a2713aSLionel Sambuc   UMUL_LOHI64,
89f4a2713aSLionel Sambuc   SDIVREM32,
90f4a2713aSLionel Sambuc   SDIVREM64,
91f4a2713aSLionel Sambuc   UDIVREM32,
92f4a2713aSLionel Sambuc   UDIVREM64,
93f4a2713aSLionel Sambuc 
94f4a2713aSLionel Sambuc   // Use a series of MVCs to copy bytes from one memory location to another.
95f4a2713aSLionel Sambuc   // The operands are:
96f4a2713aSLionel Sambuc   // - the target address
97f4a2713aSLionel Sambuc   // - the source address
98f4a2713aSLionel Sambuc   // - the constant length
99f4a2713aSLionel Sambuc   //
100f4a2713aSLionel Sambuc   // This isn't a memory opcode because we'd need to attach two
101f4a2713aSLionel Sambuc   // MachineMemOperands rather than one.
102f4a2713aSLionel Sambuc   MVC,
103f4a2713aSLionel Sambuc 
104f4a2713aSLionel Sambuc   // Like MVC, but implemented as a loop that handles X*256 bytes
105f4a2713aSLionel Sambuc   // followed by straight-line code to handle the rest (if any).
106f4a2713aSLionel Sambuc   // The value of X is passed as an additional operand.
107f4a2713aSLionel Sambuc   MVC_LOOP,
108f4a2713aSLionel Sambuc 
109f4a2713aSLionel Sambuc   // Similar to MVC and MVC_LOOP, but for logic operations (AND, OR, XOR).
110f4a2713aSLionel Sambuc   NC,
111f4a2713aSLionel Sambuc   NC_LOOP,
112f4a2713aSLionel Sambuc   OC,
113f4a2713aSLionel Sambuc   OC_LOOP,
114f4a2713aSLionel Sambuc   XC,
115f4a2713aSLionel Sambuc   XC_LOOP,
116f4a2713aSLionel Sambuc 
117f4a2713aSLionel Sambuc   // Use CLC to compare two blocks of memory, with the same comments
118f4a2713aSLionel Sambuc   // as for MVC and MVC_LOOP.
119f4a2713aSLionel Sambuc   CLC,
120f4a2713aSLionel Sambuc   CLC_LOOP,
121f4a2713aSLionel Sambuc 
122f4a2713aSLionel Sambuc   // Use an MVST-based sequence to implement stpcpy().
123f4a2713aSLionel Sambuc   STPCPY,
124f4a2713aSLionel Sambuc 
125f4a2713aSLionel Sambuc   // Use a CLST-based sequence to implement strcmp().  The two input operands
126f4a2713aSLionel Sambuc   // are the addresses of the strings to compare.
127f4a2713aSLionel Sambuc   STRCMP,
128f4a2713aSLionel Sambuc 
129f4a2713aSLionel Sambuc   // Use an SRST-based sequence to search a block of memory.  The first
130f4a2713aSLionel Sambuc   // operand is the end address, the second is the start, and the third
131f4a2713aSLionel Sambuc   // is the character to search for.  CC is set to 1 on success and 2
132f4a2713aSLionel Sambuc   // on failure.
133f4a2713aSLionel Sambuc   SEARCH_STRING,
134f4a2713aSLionel Sambuc 
135f4a2713aSLionel Sambuc   // Store the CC value in bits 29 and 28 of an integer.
136f4a2713aSLionel Sambuc   IPM,
137f4a2713aSLionel Sambuc 
138*0a6a1f1dSLionel Sambuc   // Perform a serialization operation.  (BCR 15,0 or BCR 14,0.)
139*0a6a1f1dSLionel Sambuc   SERIALIZE,
140*0a6a1f1dSLionel Sambuc 
141f4a2713aSLionel Sambuc   // Wrappers around the inner loop of an 8- or 16-bit ATOMIC_SWAP or
142f4a2713aSLionel Sambuc   // ATOMIC_LOAD_<op>.
143f4a2713aSLionel Sambuc   //
144f4a2713aSLionel Sambuc   // Operand 0: the address of the containing 32-bit-aligned field
145f4a2713aSLionel Sambuc   // Operand 1: the second operand of <op>, in the high bits of an i32
146f4a2713aSLionel Sambuc   //            for everything except ATOMIC_SWAPW
147f4a2713aSLionel Sambuc   // Operand 2: how many bits to rotate the i32 left to bring the first
148f4a2713aSLionel Sambuc   //            operand into the high bits
149f4a2713aSLionel Sambuc   // Operand 3: the negative of operand 2, for rotating the other way
150f4a2713aSLionel Sambuc   // Operand 4: the width of the field in bits (8 or 16)
151f4a2713aSLionel Sambuc   ATOMIC_SWAPW = ISD::FIRST_TARGET_MEMORY_OPCODE,
152f4a2713aSLionel Sambuc   ATOMIC_LOADW_ADD,
153f4a2713aSLionel Sambuc   ATOMIC_LOADW_SUB,
154f4a2713aSLionel Sambuc   ATOMIC_LOADW_AND,
155f4a2713aSLionel Sambuc   ATOMIC_LOADW_OR,
156f4a2713aSLionel Sambuc   ATOMIC_LOADW_XOR,
157f4a2713aSLionel Sambuc   ATOMIC_LOADW_NAND,
158f4a2713aSLionel Sambuc   ATOMIC_LOADW_MIN,
159f4a2713aSLionel Sambuc   ATOMIC_LOADW_MAX,
160f4a2713aSLionel Sambuc   ATOMIC_LOADW_UMIN,
161f4a2713aSLionel Sambuc   ATOMIC_LOADW_UMAX,
162f4a2713aSLionel Sambuc 
163f4a2713aSLionel Sambuc   // A wrapper around the inner loop of an ATOMIC_CMP_SWAP.
164f4a2713aSLionel Sambuc   //
165f4a2713aSLionel Sambuc   // Operand 0: the address of the containing 32-bit-aligned field
166f4a2713aSLionel Sambuc   // Operand 1: the compare value, in the low bits of an i32
167f4a2713aSLionel Sambuc   // Operand 2: the swap value, in the low bits of an i32
168f4a2713aSLionel Sambuc   // Operand 3: how many bits to rotate the i32 left to bring the first
169f4a2713aSLionel Sambuc   //            operand into the high bits
170f4a2713aSLionel Sambuc   // Operand 4: the negative of operand 2, for rotating the other way
171f4a2713aSLionel Sambuc   // Operand 5: the width of the field in bits (8 or 16)
172f4a2713aSLionel Sambuc   ATOMIC_CMP_SWAPW,
173f4a2713aSLionel Sambuc 
174f4a2713aSLionel Sambuc   // Prefetch from the second operand using the 4-bit control code in
175f4a2713aSLionel Sambuc   // the first operand.  The code is 1 for a load prefetch and 2 for
176f4a2713aSLionel Sambuc   // a store prefetch.
177f4a2713aSLionel Sambuc   PREFETCH
178f4a2713aSLionel Sambuc };
179f4a2713aSLionel Sambuc 
180f4a2713aSLionel Sambuc // Return true if OPCODE is some kind of PC-relative address.
isPCREL(unsigned Opcode)181f4a2713aSLionel Sambuc inline bool isPCREL(unsigned Opcode) {
182f4a2713aSLionel Sambuc   return Opcode == PCREL_WRAPPER || Opcode == PCREL_OFFSET;
183f4a2713aSLionel Sambuc }
184*0a6a1f1dSLionel Sambuc } // end namespace SystemZISD
185f4a2713aSLionel Sambuc 
186f4a2713aSLionel Sambuc namespace SystemZICMP {
187f4a2713aSLionel Sambuc // Describes whether an integer comparison needs to be signed or unsigned,
188f4a2713aSLionel Sambuc // or whether either type is OK.
189f4a2713aSLionel Sambuc enum {
190f4a2713aSLionel Sambuc   Any,
191f4a2713aSLionel Sambuc   UnsignedOnly,
192f4a2713aSLionel Sambuc   SignedOnly
193f4a2713aSLionel Sambuc };
194*0a6a1f1dSLionel Sambuc } // end namespace SystemZICMP
195f4a2713aSLionel Sambuc 
196f4a2713aSLionel Sambuc class SystemZSubtarget;
197f4a2713aSLionel Sambuc class SystemZTargetMachine;
198f4a2713aSLionel Sambuc 
199f4a2713aSLionel Sambuc class SystemZTargetLowering : public TargetLowering {
200f4a2713aSLionel Sambuc public:
201*0a6a1f1dSLionel Sambuc   explicit SystemZTargetLowering(const TargetMachine &TM);
202f4a2713aSLionel Sambuc 
203f4a2713aSLionel Sambuc   // Override TargetLowering.
getScalarShiftAmountTy(EVT LHSTy)204*0a6a1f1dSLionel Sambuc   MVT getScalarShiftAmountTy(EVT LHSTy) const override {
205f4a2713aSLionel Sambuc     return MVT::i32;
206f4a2713aSLionel Sambuc   }
207*0a6a1f1dSLionel Sambuc   EVT getSetCCResultType(LLVMContext &, EVT) const override;
208*0a6a1f1dSLionel Sambuc   bool isFMAFasterThanFMulAndFAdd(EVT VT) const override;
209*0a6a1f1dSLionel Sambuc   bool isFPImmLegal(const APFloat &Imm, EVT VT) const override;
210*0a6a1f1dSLionel Sambuc   bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const override;
211*0a6a1f1dSLionel Sambuc   bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
212*0a6a1f1dSLionel Sambuc                                       unsigned Align,
213*0a6a1f1dSLionel Sambuc                                       bool *Fast) const override;
214*0a6a1f1dSLionel Sambuc   bool isTruncateFree(Type *, Type *) const override;
215*0a6a1f1dSLionel Sambuc   bool isTruncateFree(EVT, EVT) const override;
216*0a6a1f1dSLionel Sambuc   const char *getTargetNodeName(unsigned Opcode) const override;
217*0a6a1f1dSLionel Sambuc   std::pair<unsigned, const TargetRegisterClass *>
218f4a2713aSLionel Sambuc     getRegForInlineAsmConstraint(const std::string &Constraint,
219*0a6a1f1dSLionel Sambuc                                  MVT VT) const override;
220*0a6a1f1dSLionel Sambuc   TargetLowering::ConstraintType
221*0a6a1f1dSLionel Sambuc     getConstraintType(const std::string &Constraint) const override;
222*0a6a1f1dSLionel Sambuc   TargetLowering::ConstraintWeight
223f4a2713aSLionel Sambuc     getSingleConstraintMatchWeight(AsmOperandInfo &info,
224*0a6a1f1dSLionel Sambuc                                    const char *constraint) const override;
225*0a6a1f1dSLionel Sambuc   void LowerAsmOperandForConstraint(SDValue Op,
226f4a2713aSLionel Sambuc                                     std::string &Constraint,
227f4a2713aSLionel Sambuc                                     std::vector<SDValue> &Ops,
228*0a6a1f1dSLionel Sambuc                                     SelectionDAG &DAG) const override;
229*0a6a1f1dSLionel Sambuc   MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
230*0a6a1f1dSLionel Sambuc                                                  MachineBasicBlock *BB) const
231*0a6a1f1dSLionel Sambuc     override;
232*0a6a1f1dSLionel Sambuc   SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
233*0a6a1f1dSLionel Sambuc   bool allowTruncateForTailCall(Type *, Type *) const override;
234*0a6a1f1dSLionel Sambuc   bool mayBeEmittedAsTailCall(CallInst *CI) const override;
235*0a6a1f1dSLionel Sambuc   SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
236*0a6a1f1dSLionel Sambuc                                bool isVarArg,
237f4a2713aSLionel Sambuc                                const SmallVectorImpl<ISD::InputArg> &Ins,
238f4a2713aSLionel Sambuc                                SDLoc DL, SelectionDAG &DAG,
239*0a6a1f1dSLionel Sambuc                                SmallVectorImpl<SDValue> &InVals) const override;
240*0a6a1f1dSLionel Sambuc   SDValue LowerCall(CallLoweringInfo &CLI,
241*0a6a1f1dSLionel Sambuc                     SmallVectorImpl<SDValue> &InVals) const override;
242f4a2713aSLionel Sambuc 
243*0a6a1f1dSLionel Sambuc   SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
244f4a2713aSLionel Sambuc                       const SmallVectorImpl<ISD::OutputArg> &Outs,
245f4a2713aSLionel Sambuc                       const SmallVectorImpl<SDValue> &OutVals,
246*0a6a1f1dSLionel Sambuc                       SDLoc DL, SelectionDAG &DAG) const override;
247*0a6a1f1dSLionel Sambuc   SDValue prepareVolatileOrAtomicLoad(SDValue Chain, SDLoc DL,
248*0a6a1f1dSLionel Sambuc                                       SelectionDAG &DAG) const override;
249*0a6a1f1dSLionel Sambuc   SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
250f4a2713aSLionel Sambuc 
251f4a2713aSLionel Sambuc private:
252f4a2713aSLionel Sambuc   const SystemZSubtarget &Subtarget;
253f4a2713aSLionel Sambuc 
254f4a2713aSLionel Sambuc   // Implement LowerOperation for individual opcodes.
255f4a2713aSLionel Sambuc   SDValue lowerSETCC(SDValue Op, SelectionDAG &DAG) const;
256f4a2713aSLionel Sambuc   SDValue lowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
257f4a2713aSLionel Sambuc   SDValue lowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
258f4a2713aSLionel Sambuc   SDValue lowerGlobalAddress(GlobalAddressSDNode *Node,
259f4a2713aSLionel Sambuc                              SelectionDAG &DAG) const;
260f4a2713aSLionel Sambuc   SDValue lowerGlobalTLSAddress(GlobalAddressSDNode *Node,
261f4a2713aSLionel Sambuc                                 SelectionDAG &DAG) const;
262f4a2713aSLionel Sambuc   SDValue lowerBlockAddress(BlockAddressSDNode *Node,
263f4a2713aSLionel Sambuc                             SelectionDAG &DAG) const;
264f4a2713aSLionel Sambuc   SDValue lowerJumpTable(JumpTableSDNode *JT, SelectionDAG &DAG) const;
265f4a2713aSLionel Sambuc   SDValue lowerConstantPool(ConstantPoolSDNode *CP, SelectionDAG &DAG) const;
266f4a2713aSLionel Sambuc   SDValue lowerVASTART(SDValue Op, SelectionDAG &DAG) const;
267f4a2713aSLionel Sambuc   SDValue lowerVACOPY(SDValue Op, SelectionDAG &DAG) const;
268f4a2713aSLionel Sambuc   SDValue lowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
269f4a2713aSLionel Sambuc   SDValue lowerSMUL_LOHI(SDValue Op, SelectionDAG &DAG) const;
270f4a2713aSLionel Sambuc   SDValue lowerUMUL_LOHI(SDValue Op, SelectionDAG &DAG) const;
271f4a2713aSLionel Sambuc   SDValue lowerSDIVREM(SDValue Op, SelectionDAG &DAG) const;
272f4a2713aSLionel Sambuc   SDValue lowerUDIVREM(SDValue Op, SelectionDAG &DAG) const;
273f4a2713aSLionel Sambuc   SDValue lowerBITCAST(SDValue Op, SelectionDAG &DAG) const;
274f4a2713aSLionel Sambuc   SDValue lowerOR(SDValue Op, SelectionDAG &DAG) const;
275*0a6a1f1dSLionel Sambuc   SDValue lowerATOMIC_LOAD(SDValue Op, SelectionDAG &DAG) const;
276*0a6a1f1dSLionel Sambuc   SDValue lowerATOMIC_STORE(SDValue Op, SelectionDAG &DAG) const;
277*0a6a1f1dSLionel Sambuc   SDValue lowerATOMIC_LOAD_OP(SDValue Op, SelectionDAG &DAG,
278f4a2713aSLionel Sambuc                               unsigned Opcode) const;
279*0a6a1f1dSLionel Sambuc   SDValue lowerATOMIC_LOAD_SUB(SDValue Op, SelectionDAG &DAG) const;
280f4a2713aSLionel Sambuc   SDValue lowerATOMIC_CMP_SWAP(SDValue Op, SelectionDAG &DAG) const;
281*0a6a1f1dSLionel Sambuc   SDValue lowerLOAD_SEQUENCE_POINT(SDValue Op, SelectionDAG &DAG) const;
282f4a2713aSLionel Sambuc   SDValue lowerSTACKSAVE(SDValue Op, SelectionDAG &DAG) const;
283f4a2713aSLionel Sambuc   SDValue lowerSTACKRESTORE(SDValue Op, SelectionDAG &DAG) const;
284f4a2713aSLionel Sambuc   SDValue lowerPREFETCH(SDValue Op, SelectionDAG &DAG) const;
285f4a2713aSLionel Sambuc 
286f4a2713aSLionel Sambuc   // If the last instruction before MBBI in MBB was some form of COMPARE,
287f4a2713aSLionel Sambuc   // try to replace it with a COMPARE AND BRANCH just before MBBI.
288f4a2713aSLionel Sambuc   // CCMask and Target are the BRC-like operands for the branch.
289f4a2713aSLionel Sambuc   // Return true if the change was made.
290f4a2713aSLionel Sambuc   bool convertPrevCompareToBranch(MachineBasicBlock *MBB,
291f4a2713aSLionel Sambuc                                   MachineBasicBlock::iterator MBBI,
292f4a2713aSLionel Sambuc                                   unsigned CCMask,
293f4a2713aSLionel Sambuc                                   MachineBasicBlock *Target) const;
294f4a2713aSLionel Sambuc 
295f4a2713aSLionel Sambuc   // Implement EmitInstrWithCustomInserter for individual operation types.
296f4a2713aSLionel Sambuc   MachineBasicBlock *emitSelect(MachineInstr *MI,
297f4a2713aSLionel Sambuc                                 MachineBasicBlock *BB) const;
298f4a2713aSLionel Sambuc   MachineBasicBlock *emitCondStore(MachineInstr *MI,
299f4a2713aSLionel Sambuc                                    MachineBasicBlock *BB,
300f4a2713aSLionel Sambuc                                    unsigned StoreOpcode, unsigned STOCOpcode,
301f4a2713aSLionel Sambuc                                    bool Invert) const;
302f4a2713aSLionel Sambuc   MachineBasicBlock *emitExt128(MachineInstr *MI,
303f4a2713aSLionel Sambuc                                 MachineBasicBlock *MBB,
304f4a2713aSLionel Sambuc                                 bool ClearEven, unsigned SubReg) const;
305f4a2713aSLionel Sambuc   MachineBasicBlock *emitAtomicLoadBinary(MachineInstr *MI,
306f4a2713aSLionel Sambuc                                           MachineBasicBlock *BB,
307f4a2713aSLionel Sambuc                                           unsigned BinOpcode, unsigned BitSize,
308f4a2713aSLionel Sambuc                                           bool Invert = false) const;
309f4a2713aSLionel Sambuc   MachineBasicBlock *emitAtomicLoadMinMax(MachineInstr *MI,
310f4a2713aSLionel Sambuc                                           MachineBasicBlock *MBB,
311f4a2713aSLionel Sambuc                                           unsigned CompareOpcode,
312f4a2713aSLionel Sambuc                                           unsigned KeepOldMask,
313f4a2713aSLionel Sambuc                                           unsigned BitSize) const;
314f4a2713aSLionel Sambuc   MachineBasicBlock *emitAtomicCmpSwapW(MachineInstr *MI,
315f4a2713aSLionel Sambuc                                         MachineBasicBlock *BB) const;
316f4a2713aSLionel Sambuc   MachineBasicBlock *emitMemMemWrapper(MachineInstr *MI,
317f4a2713aSLionel Sambuc                                        MachineBasicBlock *BB,
318f4a2713aSLionel Sambuc                                        unsigned Opcode) const;
319f4a2713aSLionel Sambuc   MachineBasicBlock *emitStringWrapper(MachineInstr *MI,
320f4a2713aSLionel Sambuc                                        MachineBasicBlock *BB,
321f4a2713aSLionel Sambuc                                        unsigned Opcode) const;
322f4a2713aSLionel Sambuc };
323f4a2713aSLionel Sambuc } // end namespace llvm
324f4a2713aSLionel Sambuc 
325*0a6a1f1dSLionel Sambuc #endif
326