Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 1 | //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// |
| 2 | // |
| 3 | // The Subzero Code Generator |
| 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 file declares the TargetLoweringX8632 class, which |
| 11 | // implements the TargetLowering interface for the x86-32 |
| 12 | // architecture. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| 17 | #define SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| 18 | |
Jan Voung | 8acded0 | 2014-09-22 18:02:25 -0700 | [diff] [blame] | 19 | #include "assembler_ia32.h" |
Jim Stichnoth | a18cc9c | 2014-09-30 19:10:22 -0700 | [diff] [blame] | 20 | #include "IceDefs.h" |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 21 | #include "IceInstX8632.h" |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 22 | #include "IceRegistersX8632.h" |
Jim Stichnoth | a18cc9c | 2014-09-30 19:10:22 -0700 | [diff] [blame] | 23 | #include "IceTargetLowering.h" |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 24 | |
| 25 | namespace Ice { |
| 26 | |
| 27 | class TargetX8632 : public TargetLowering { |
Jim Stichnoth | 7b451a9 | 2014-10-15 14:39:23 -0700 | [diff] [blame] | 28 | TargetX8632(const TargetX8632 &) = delete; |
| 29 | TargetX8632 &operator=(const TargetX8632 &) = delete; |
| 30 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 31 | public: |
| 32 | static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } |
| 33 | |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 34 | void translateOm1() override; |
| 35 | void translateO2() override; |
| 36 | bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 37 | |
Jim Stichnoth | 3d44fe8 | 2014-11-01 10:10:18 -0700 | [diff] [blame] | 38 | SizeT getNumRegisters() const override { return RegX8632::Reg_NUM; } |
Jim Stichnoth | 98712a3 | 2014-10-24 10:59:02 -0700 | [diff] [blame] | 39 | Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override; |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 40 | IceString getRegName(SizeT RegNum, Type Ty) const override; |
| 41 | llvm::SmallBitVector getRegisterSet(RegSetMask Include, |
| 42 | RegSetMask Exclude) const override; |
| 43 | const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override { |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 44 | return TypeToRegisterSet[Ty]; |
| 45 | } |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 46 | bool hasFramePointer() const override { return IsEbpBasedFrame; } |
| 47 | SizeT getFrameOrStackReg() const override { |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 48 | return IsEbpBasedFrame ? RegX8632::Reg_ebp : RegX8632::Reg_esp; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 49 | } |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 50 | size_t typeWidthInBytesOnStack(Type Ty) const override { |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 51 | // Round up to the next multiple of 4 bytes. In particular, i1, |
| 52 | // i8, and i16 are rounded up to 4 bytes. |
| 53 | return (typeWidthInBytes(Ty) + 3) & ~3; |
| 54 | } |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 55 | void emitVariable(const Variable *Var) const override; |
| 56 | void lowerArguments() override; |
| 57 | void addProlog(CfgNode *Node) override; |
| 58 | void addEpilog(CfgNode *Node) override; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 59 | SizeT makeNextLabelNumber() { return NextLabelNumber++; } |
| 60 | // Ensure that a 64-bit Variable has been split into 2 32-bit |
| 61 | // Variables, creating them if necessary. This is needed for all |
| 62 | // I64 operations, and it is needed for pushing F64 arguments for |
| 63 | // function calls using the 32-bit push instruction (though the |
| 64 | // latter could be done by directly writing to the stack). |
| 65 | void split64(Variable *Var); |
Matt Wala | 45a0623 | 2014-07-09 16:33:22 -0700 | [diff] [blame] | 66 | void finishArgumentLowering(Variable *Arg, Variable *FramePtr, |
| 67 | size_t BasicFrameOffset, size_t &InArgsSizeBytes); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 68 | Operand *loOperand(Operand *Operand); |
| 69 | Operand *hiOperand(Operand *Operand); |
Jan Voung | 8acded0 | 2014-09-22 18:02:25 -0700 | [diff] [blame] | 70 | x86::Address stackVarToAsmOperand(const Variable *Var) const; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 71 | |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 72 | enum X86InstructionSet { |
| 73 | // SSE2 is the PNaCl baseline instruction set. |
| 74 | SSE2, |
| 75 | SSE4_1 |
| 76 | }; |
| 77 | |
| 78 | X86InstructionSet getInstructionSet() const { return InstructionSet; } |
| 79 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 80 | protected: |
| 81 | TargetX8632(Cfg *Func); |
| 82 | |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 83 | void postLower() override; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 84 | |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 85 | void lowerAlloca(const InstAlloca *Inst) override; |
| 86 | void lowerArithmetic(const InstArithmetic *Inst) override; |
| 87 | void lowerAssign(const InstAssign *Inst) override; |
| 88 | void lowerBr(const InstBr *Inst) override; |
| 89 | void lowerCall(const InstCall *Inst) override; |
| 90 | void lowerCast(const InstCast *Inst) override; |
| 91 | void lowerExtractElement(const InstExtractElement *Inst) override; |
| 92 | void lowerFcmp(const InstFcmp *Inst) override; |
| 93 | void lowerIcmp(const InstIcmp *Inst) override; |
| 94 | void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; |
| 95 | void lowerInsertElement(const InstInsertElement *Inst) override; |
| 96 | void lowerLoad(const InstLoad *Inst) override; |
| 97 | void lowerPhi(const InstPhi *Inst) override; |
| 98 | void lowerRet(const InstRet *Inst) override; |
| 99 | void lowerSelect(const InstSelect *Inst) override; |
| 100 | void lowerStore(const InstStore *Inst) override; |
| 101 | void lowerSwitch(const InstSwitch *Inst) override; |
| 102 | void lowerUnreachable(const InstUnreachable *Inst) override; |
Jim Stichnoth | 336f6c4 | 2014-10-30 15:01:31 -0700 | [diff] [blame] | 103 | void prelowerPhis() override; |
| 104 | void lowerPhiAssignments(CfgNode *Node, |
| 105 | const AssignList &Assignments) override; |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 106 | void doAddressOptLoad() override; |
| 107 | void doAddressOptStore() override; |
| 108 | void randomlyInsertNop(float Probability) override; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 109 | |
Jan Voung | c820ddf | 2014-07-29 14:38:51 -0700 | [diff] [blame] | 110 | // Naive lowering of cmpxchg. |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 111 | void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, |
| 112 | Operand *Desired); |
Jan Voung | c820ddf | 2014-07-29 14:38:51 -0700 | [diff] [blame] | 113 | // Attempt a more optimized lowering of cmpxchg. Returns true if optimized. |
| 114 | bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, |
| 115 | Operand *Expected, Operand *Desired); |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 116 | void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, |
| 117 | Operand *Val); |
Jan Voung | e4da26f | 2014-07-15 17:52:39 -0700 | [diff] [blame] | 118 | void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, |
| 119 | Operand *SecondVal); |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 120 | |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 121 | typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); |
| 122 | void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
| 123 | Variable *Dest, Operand *Ptr, Operand *Val); |
| 124 | |
Matt Wala | ce0ca8f | 2014-07-24 12:34:20 -0700 | [diff] [blame] | 125 | void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); |
| 126 | |
Matt Wala | afeaee4 | 2014-08-07 13:47:30 -0700 | [diff] [blame] | 127 | void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, |
| 128 | Operand *Src0, Operand *Src1); |
| 129 | |
Matt Wala | d4799f4 | 2014-08-14 14:24:12 -0700 | [diff] [blame] | 130 | void sortByAlignment(VarList &Dest, const VarList &Source) const; |
| 131 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 132 | // Operand legalization helpers. To deal with address mode |
| 133 | // constraints, the helpers will create a new Operand and emit |
| 134 | // instructions that guarantee that the Operand kind is one of those |
| 135 | // indicated by the LegalMask (a bitmask of allowed kinds). If the |
| 136 | // input Operand is known to already meet the constraints, it may be |
| 137 | // simply returned as the result, without creating any new |
| 138 | // instructions or operands. |
| 139 | enum OperandLegalization { |
| 140 | Legal_None = 0, |
| 141 | Legal_Reg = 1 << 0, // physical register, not stack location |
| 142 | Legal_Imm = 1 << 1, |
| 143 | Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12] |
| 144 | Legal_All = ~Legal_None |
| 145 | }; |
| 146 | typedef uint32_t LegalMask; |
Jim Stichnoth | dd16507 | 2014-11-02 09:41:45 -0800 | [diff] [blame] | 147 | Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 148 | int32_t RegNum = Variable::NoRegister); |
Jim Stichnoth | ad40353 | 2014-09-25 12:44:17 -0700 | [diff] [blame] | 149 | Variable *legalizeToVar(Operand *From, int32_t RegNum = Variable::NoRegister); |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 150 | // Turn a pointer operand into a memory operand that can be |
| 151 | // used by a real load/store operation. Legalizes the operand as well. |
| 152 | // This is a nop if the operand is already a legal memory operand. |
| 153 | OperandX8632Mem *FormMemoryOperand(Operand *Ptr, Type Ty); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 154 | |
| 155 | Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); |
Jan Voung | 261cae3 | 2015-02-01 10:31:03 -0800 | [diff] [blame] | 156 | // Make a call to an external helper function. |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 157 | InstCall *makeHelperCall(const IceString &Name, Variable *Dest, |
| 158 | SizeT MaxSrcs) { |
Jim Stichnoth | d2cb436 | 2014-11-20 11:24:42 -0800 | [diff] [blame] | 159 | const bool HasTailCall = false; |
Jan Voung | 261cae3 | 2015-02-01 10:31:03 -0800 | [diff] [blame] | 160 | Constant *CallTarget = Ctx->getConstantExternSym(Name); |
Jim Stichnoth | d2cb436 | 2014-11-20 11:24:42 -0800 | [diff] [blame] | 161 | InstCall *Call = |
| 162 | InstCall::create(Func, MaxSrcs, Dest, CallTarget, HasTailCall); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 163 | return Call; |
| 164 | } |
Jan Voung | 3bd9f1a | 2014-06-18 10:50:57 -0700 | [diff] [blame] | 165 | static Type stackSlotType(); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 166 | |
Matt Wala | 928f129 | 2014-07-07 16:50:46 -0700 | [diff] [blame] | 167 | Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
| 168 | |
Matt Wala | 83b8036 | 2014-07-16 10:21:30 -0700 | [diff] [blame] | 169 | // Returns a vector in a register with the given constant entries. |
| 170 | Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 171 | Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); |
Matt Wala | 9a0168a | 2014-07-23 14:56:10 -0700 | [diff] [blame] | 172 | Variable *makeVectorOfMinusOnes(Type Ty, |
| 173 | int32_t RegNum = Variable::NoRegister); |
| 174 | Variable *makeVectorOfHighOrderBits(Type Ty, |
| 175 | int32_t RegNum = Variable::NoRegister); |
Matt Wala | 83b8036 | 2014-07-16 10:21:30 -0700 | [diff] [blame] | 176 | |
Matt Wala | 4988923 | 2014-07-18 12:45:09 -0700 | [diff] [blame] | 177 | // Return a memory operand corresponding to a stack allocated Variable. |
| 178 | OperandX8632Mem *getMemoryOperandForStackSlot(Type Ty, Variable *Slot, |
| 179 | uint32_t Offset = 0); |
| 180 | |
Jim Stichnoth | e6d2478 | 2014-12-19 05:42:24 -0800 | [diff] [blame] | 181 | void makeRandomRegisterPermutation( |
| 182 | llvm::SmallVectorImpl<int32_t> &Permutation, |
Jan Voung | 3ce1a99 | 2015-02-03 08:27:44 -0800 | [diff] [blame^] | 183 | const llvm::SmallBitVector &ExcludeRegisters) const override; |
Jim Stichnoth | e6d2478 | 2014-12-19 05:42:24 -0800 | [diff] [blame] | 184 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 185 | // The following are helpers that insert lowered x86 instructions |
| 186 | // with minimal syntactic overhead, so that the lowering code can |
| 187 | // look as close to assembly as practical. |
| 188 | void _adc(Variable *Dest, Operand *Src0) { |
| 189 | Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
| 190 | } |
| 191 | void _add(Variable *Dest, Operand *Src0) { |
| 192 | Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
| 193 | } |
Matt Wala | 105b704 | 2014-08-11 19:56:19 -0700 | [diff] [blame] | 194 | void _adjust_stack(int32_t Amount) { |
Jim Stichnoth | 144cdce | 2014-09-22 16:02:59 -0700 | [diff] [blame] | 195 | Context.insert(InstX8632AdjustStack::create( |
| 196 | Func, Amount, getPhysicalRegister(RegX8632::Reg_esp))); |
Matt Wala | 105b704 | 2014-08-11 19:56:19 -0700 | [diff] [blame] | 197 | } |
Matt Wala | 8d1072e | 2014-07-11 15:43:51 -0700 | [diff] [blame] | 198 | void _addps(Variable *Dest, Operand *Src0) { |
| 199 | Context.insert(InstX8632Addps::create(Func, Dest, Src0)); |
| 200 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 201 | void _addss(Variable *Dest, Operand *Src0) { |
| 202 | Context.insert(InstX8632Addss::create(Func, Dest, Src0)); |
| 203 | } |
| 204 | void _and(Variable *Dest, Operand *Src0) { |
| 205 | Context.insert(InstX8632And::create(Func, Dest, Src0)); |
| 206 | } |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 207 | void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 208 | Context.insert(InstX8632Blendvps::create(Func, Dest, Src0, Src1)); |
| 209 | } |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 210 | void _br(CondX86::BrCond Condition, CfgNode *TargetTrue, |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 211 | CfgNode *TargetFalse) { |
| 212 | Context.insert( |
| 213 | InstX8632Br::create(Func, TargetTrue, TargetFalse, Condition)); |
| 214 | } |
| 215 | void _br(CfgNode *Target) { |
| 216 | Context.insert(InstX8632Br::create(Func, Target)); |
| 217 | } |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 218 | void _br(CondX86::BrCond Condition, CfgNode *Target) { |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 219 | Context.insert(InstX8632Br::create(Func, Target, Condition)); |
| 220 | } |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 221 | void _br(CondX86::BrCond Condition, InstX8632Label *Label) { |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 222 | Context.insert(InstX8632Br::create(Func, Label, Condition)); |
| 223 | } |
Jan Voung | e4da26f | 2014-07-15 17:52:39 -0700 | [diff] [blame] | 224 | void _bsf(Variable *Dest, Operand *Src0) { |
| 225 | Context.insert(InstX8632Bsf::create(Func, Dest, Src0)); |
| 226 | } |
| 227 | void _bsr(Variable *Dest, Operand *Src0) { |
| 228 | Context.insert(InstX8632Bsr::create(Func, Dest, Src0)); |
| 229 | } |
Jan Voung | 7fa813b | 2014-07-18 13:01:08 -0700 | [diff] [blame] | 230 | void _bswap(Variable *SrcDest) { |
| 231 | Context.insert(InstX8632Bswap::create(Func, SrcDest)); |
| 232 | } |
Matt Wala | afeaee4 | 2014-08-07 13:47:30 -0700 | [diff] [blame] | 233 | void _cbwdq(Variable *Dest, Operand *Src0) { |
| 234 | Context.insert(InstX8632Cbwdq::create(Func, Dest, Src0)); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 235 | } |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 236 | void _cmov(Variable *Dest, Operand *Src0, CondX86::BrCond Condition) { |
Jan Voung | e4da26f | 2014-07-15 17:52:39 -0700 | [diff] [blame] | 237 | Context.insert(InstX8632Cmov::create(Func, Dest, Src0, Condition)); |
| 238 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 239 | void _cmp(Operand *Src0, Operand *Src1) { |
| 240 | Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); |
| 241 | } |
Jan Voung | bd385e4 | 2014-09-18 18:18:10 -0700 | [diff] [blame] | 242 | void _cmpps(Variable *Dest, Operand *Src0, CondX86::CmppsCond Condition) { |
Matt Wala | ce0ca8f | 2014-07-24 12:34:20 -0700 | [diff] [blame] | 243 | Context.insert(InstX8632Cmpps::create(Func, Dest, Src0, Condition)); |
| 244 | } |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 245 | void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, |
| 246 | bool Locked) { |
| 247 | Context.insert( |
| 248 | InstX8632Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); |
| 249 | // Mark eax as possibly modified by cmpxchg. |
| 250 | Context.insert( |
| 251 | InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 252 | _set_dest_nonkillable(); |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 253 | } |
Jan Voung | 03532e5 | 2014-09-23 13:32:18 -0700 | [diff] [blame] | 254 | void _cmpxchg8b(OperandX8632Mem *Addr, Variable *Edx, Variable *Eax, |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 255 | Variable *Ecx, Variable *Ebx, bool Locked) { |
| 256 | Context.insert( |
| 257 | InstX8632Cmpxchg8b::create(Func, Addr, Edx, Eax, Ecx, Ebx, Locked)); |
| 258 | // Mark edx, and eax as possibly modified by cmpxchg8b. |
| 259 | Context.insert(InstFakeDef::create(Func, Edx)); |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 260 | _set_dest_nonkillable(); |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 261 | Context.insert(InstFakeDef::create(Func, Eax)); |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 262 | _set_dest_nonkillable(); |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 263 | } |
Jan Voung | 699bf02 | 2014-10-08 13:52:10 -0700 | [diff] [blame] | 264 | void _cvt(Variable *Dest, Operand *Src0, InstX8632Cvt::CvtVariant Variant) { |
| 265 | Context.insert(InstX8632Cvt::create(Func, Dest, Src0, Variant)); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 266 | } |
| 267 | void _div(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 268 | Context.insert(InstX8632Div::create(Func, Dest, Src0, Src1)); |
| 269 | } |
Matt Wala | 8d1072e | 2014-07-11 15:43:51 -0700 | [diff] [blame] | 270 | void _divps(Variable *Dest, Operand *Src0) { |
| 271 | Context.insert(InstX8632Divps::create(Func, Dest, Src0)); |
| 272 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 273 | void _divss(Variable *Dest, Operand *Src0) { |
| 274 | Context.insert(InstX8632Divss::create(Func, Dest, Src0)); |
| 275 | } |
| 276 | void _fld(Operand *Src0) { Context.insert(InstX8632Fld::create(Func, Src0)); } |
| 277 | void _fstp(Variable *Dest) { |
| 278 | Context.insert(InstX8632Fstp::create(Func, Dest)); |
| 279 | } |
| 280 | void _idiv(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 281 | Context.insert(InstX8632Idiv::create(Func, Dest, Src0, Src1)); |
| 282 | } |
| 283 | void _imul(Variable *Dest, Operand *Src0) { |
| 284 | Context.insert(InstX8632Imul::create(Func, Dest, Src0)); |
| 285 | } |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 286 | void _insertps(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 287 | Context.insert(InstX8632Insertps::create(Func, Dest, Src0, Src1)); |
| 288 | } |
Matt Wala | 4988923 | 2014-07-18 12:45:09 -0700 | [diff] [blame] | 289 | void _lea(Variable *Dest, Operand *Src0) { |
| 290 | Context.insert(InstX8632Lea::create(Func, Dest, Src0)); |
| 291 | } |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 292 | void _mfence() { Context.insert(InstX8632Mfence::create(Func)); } |
Jim Stichnoth | ae95320 | 2014-12-20 06:17:49 -0800 | [diff] [blame] | 293 | // If Dest=nullptr is passed in, then a new variable is created, |
| 294 | // marked as infinite register allocation weight, and returned |
| 295 | // through the in/out Dest argument. |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 296 | void _mov(Variable *&Dest, Operand *Src0, |
| 297 | int32_t RegNum = Variable::NoRegister) { |
Jim Stichnoth | ae95320 | 2014-12-20 06:17:49 -0800 | [diff] [blame] | 298 | if (Dest == nullptr) |
Jim Stichnoth | ad40353 | 2014-09-25 12:44:17 -0700 | [diff] [blame] | 299 | Dest = makeReg(Src0->getType(), RegNum); |
| 300 | Context.insert(InstX8632Mov::create(Func, Dest, Src0)); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 301 | } |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 302 | void _mov_nonkillable(Variable *Dest, Operand *Src0) { |
| 303 | Inst *NewInst = InstX8632Mov::create(Func, Dest, Src0); |
| 304 | NewInst->setDestNonKillable(); |
| 305 | Context.insert(NewInst); |
| 306 | } |
Matt Wala | 4988923 | 2014-07-18 12:45:09 -0700 | [diff] [blame] | 307 | void _movd(Variable *Dest, Operand *Src0) { |
| 308 | Context.insert(InstX8632Movd::create(Func, Dest, Src0)); |
| 309 | } |
Matt Wala | 928f129 | 2014-07-07 16:50:46 -0700 | [diff] [blame] | 310 | void _movp(Variable *Dest, Operand *Src0) { |
| 311 | Context.insert(InstX8632Movp::create(Func, Dest, Src0)); |
| 312 | } |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 313 | void _movq(Variable *Dest, Operand *Src0) { |
| 314 | Context.insert(InstX8632Movq::create(Func, Dest, Src0)); |
| 315 | } |
Jan Voung | e4dc61b | 2014-10-06 08:53:52 -0700 | [diff] [blame] | 316 | void _movss(Variable *Dest, Variable *Src0) { |
| 317 | Context.insert(InstX8632MovssRegs::create(Func, Dest, Src0)); |
Matt Wala | 4988923 | 2014-07-18 12:45:09 -0700 | [diff] [blame] | 318 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 319 | void _movsx(Variable *Dest, Operand *Src0) { |
| 320 | Context.insert(InstX8632Movsx::create(Func, Dest, Src0)); |
| 321 | } |
| 322 | void _movzx(Variable *Dest, Operand *Src0) { |
| 323 | Context.insert(InstX8632Movzx::create(Func, Dest, Src0)); |
| 324 | } |
| 325 | void _mul(Variable *Dest, Variable *Src0, Operand *Src1) { |
| 326 | Context.insert(InstX8632Mul::create(Func, Dest, Src0, Src1)); |
| 327 | } |
Matt Wala | 8d1072e | 2014-07-11 15:43:51 -0700 | [diff] [blame] | 328 | void _mulps(Variable *Dest, Operand *Src0) { |
| 329 | Context.insert(InstX8632Mulps::create(Func, Dest, Src0)); |
| 330 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 331 | void _mulss(Variable *Dest, Operand *Src0) { |
| 332 | Context.insert(InstX8632Mulss::create(Func, Dest, Src0)); |
| 333 | } |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 334 | void _neg(Variable *SrcDest) { |
| 335 | Context.insert(InstX8632Neg::create(Func, SrcDest)); |
| 336 | } |
Matt Wala | c330274 | 2014-08-15 16:21:56 -0700 | [diff] [blame] | 337 | void _nop(SizeT Variant) { |
| 338 | Context.insert(InstX8632Nop::create(Func, Variant)); |
| 339 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 340 | void _or(Variable *Dest, Operand *Src0) { |
| 341 | Context.insert(InstX8632Or::create(Func, Dest, Src0)); |
| 342 | } |
Matt Wala | 7fa22d8 | 2014-07-17 12:41:31 -0700 | [diff] [blame] | 343 | void _padd(Variable *Dest, Operand *Src0) { |
| 344 | Context.insert(InstX8632Padd::create(Func, Dest, Src0)); |
| 345 | } |
Matt Wala | 83b8036 | 2014-07-16 10:21:30 -0700 | [diff] [blame] | 346 | void _pand(Variable *Dest, Operand *Src0) { |
| 347 | Context.insert(InstX8632Pand::create(Func, Dest, Src0)); |
| 348 | } |
Matt Wala | 9cb61e2 | 2014-07-24 09:44:42 -0700 | [diff] [blame] | 349 | void _pandn(Variable *Dest, Operand *Src0) { |
| 350 | Context.insert(InstX8632Pandn::create(Func, Dest, Src0)); |
| 351 | } |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 352 | void _pblendvb(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 353 | Context.insert(InstX8632Pblendvb::create(Func, Dest, Src0, Src1)); |
| 354 | } |
Matt Wala | 83b8036 | 2014-07-16 10:21:30 -0700 | [diff] [blame] | 355 | void _pcmpeq(Variable *Dest, Operand *Src0) { |
| 356 | Context.insert(InstX8632Pcmpeq::create(Func, Dest, Src0)); |
| 357 | } |
| 358 | void _pcmpgt(Variable *Dest, Operand *Src0) { |
| 359 | Context.insert(InstX8632Pcmpgt::create(Func, Dest, Src0)); |
| 360 | } |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 361 | void _pextr(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 362 | Context.insert(InstX8632Pextr::create(Func, Dest, Src0, Src1)); |
Matt Wala | 4988923 | 2014-07-18 12:45:09 -0700 | [diff] [blame] | 363 | } |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 364 | void _pinsr(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 365 | Context.insert(InstX8632Pinsr::create(Func, Dest, Src0, Src1)); |
Matt Wala | 4988923 | 2014-07-18 12:45:09 -0700 | [diff] [blame] | 366 | } |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 367 | void _pmull(Variable *Dest, Operand *Src0) { |
| 368 | Context.insert(InstX8632Pmull::create(Func, Dest, Src0)); |
Matt Wala | 7fa22d8 | 2014-07-17 12:41:31 -0700 | [diff] [blame] | 369 | } |
| 370 | void _pmuludq(Variable *Dest, Operand *Src0) { |
| 371 | Context.insert(InstX8632Pmuludq::create(Func, Dest, Src0)); |
| 372 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 373 | void _pop(Variable *Dest) { |
| 374 | Context.insert(InstX8632Pop::create(Func, Dest)); |
| 375 | } |
Matt Wala | 7fa22d8 | 2014-07-17 12:41:31 -0700 | [diff] [blame] | 376 | void _por(Variable *Dest, Operand *Src0) { |
| 377 | Context.insert(InstX8632Por::create(Func, Dest, Src0)); |
| 378 | } |
| 379 | void _pshufd(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 380 | Context.insert(InstX8632Pshufd::create(Func, Dest, Src0, Src1)); |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 381 | } |
Matt Wala | 83b8036 | 2014-07-16 10:21:30 -0700 | [diff] [blame] | 382 | void _psll(Variable *Dest, Operand *Src0) { |
| 383 | Context.insert(InstX8632Psll::create(Func, Dest, Src0)); |
| 384 | } |
| 385 | void _psra(Variable *Dest, Operand *Src0) { |
| 386 | Context.insert(InstX8632Psra::create(Func, Dest, Src0)); |
| 387 | } |
| 388 | void _psub(Variable *Dest, Operand *Src0) { |
| 389 | Context.insert(InstX8632Psub::create(Func, Dest, Src0)); |
| 390 | } |
Jan Voung | 0b9eee5 | 2014-10-07 11:20:10 -0700 | [diff] [blame] | 391 | void _push(Variable *Src0) { |
| 392 | Context.insert(InstX8632Push::create(Func, Src0)); |
Matt Wala | 7fa22d8 | 2014-07-17 12:41:31 -0700 | [diff] [blame] | 393 | } |
Matt Wala | 8d1072e | 2014-07-11 15:43:51 -0700 | [diff] [blame] | 394 | void _pxor(Variable *Dest, Operand *Src0) { |
| 395 | Context.insert(InstX8632Pxor::create(Func, Dest, Src0)); |
| 396 | } |
Jim Stichnoth | ae95320 | 2014-12-20 06:17:49 -0800 | [diff] [blame] | 397 | void _ret(Variable *Src0 = nullptr) { |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 398 | Context.insert(InstX8632Ret::create(Func, Src0)); |
| 399 | } |
Jan Voung | 7fa813b | 2014-07-18 13:01:08 -0700 | [diff] [blame] | 400 | void _rol(Variable *Dest, Operand *Src0) { |
| 401 | Context.insert(InstX8632Rol::create(Func, Dest, Src0)); |
| 402 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 403 | void _sar(Variable *Dest, Operand *Src0) { |
| 404 | Context.insert(InstX8632Sar::create(Func, Dest, Src0)); |
| 405 | } |
| 406 | void _sbb(Variable *Dest, Operand *Src0) { |
| 407 | Context.insert(InstX8632Sbb::create(Func, Dest, Src0)); |
| 408 | } |
| 409 | void _shl(Variable *Dest, Operand *Src0) { |
| 410 | Context.insert(InstX8632Shl::create(Func, Dest, Src0)); |
| 411 | } |
| 412 | void _shld(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 413 | Context.insert(InstX8632Shld::create(Func, Dest, Src0, Src1)); |
| 414 | } |
| 415 | void _shr(Variable *Dest, Operand *Src0) { |
| 416 | Context.insert(InstX8632Shr::create(Func, Dest, Src0)); |
| 417 | } |
| 418 | void _shrd(Variable *Dest, Variable *Src0, Variable *Src1) { |
| 419 | Context.insert(InstX8632Shrd::create(Func, Dest, Src0, Src1)); |
| 420 | } |
Matt Wala | 7fa22d8 | 2014-07-17 12:41:31 -0700 | [diff] [blame] | 421 | void _shufps(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 422 | Context.insert(InstX8632Shufps::create(Func, Dest, Src0, Src1)); |
| 423 | } |
Jan Voung | f37fbbe | 2014-07-09 16:13:13 -0700 | [diff] [blame] | 424 | void _sqrtss(Variable *Dest, Operand *Src0) { |
| 425 | Context.insert(InstX8632Sqrtss::create(Func, Dest, Src0)); |
| 426 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 427 | void _store(Operand *Value, OperandX8632 *Mem) { |
| 428 | Context.insert(InstX8632Store::create(Func, Value, Mem)); |
| 429 | } |
Jan Voung | e4dc61b | 2014-10-06 08:53:52 -0700 | [diff] [blame] | 430 | void _storep(Variable *Value, OperandX8632Mem *Mem) { |
Matt Wala | 105b704 | 2014-08-11 19:56:19 -0700 | [diff] [blame] | 431 | Context.insert(InstX8632StoreP::create(Func, Value, Mem)); |
| 432 | } |
Jan Voung | e4dc61b | 2014-10-06 08:53:52 -0700 | [diff] [blame] | 433 | void _storeq(Variable *Value, OperandX8632Mem *Mem) { |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 434 | Context.insert(InstX8632StoreQ::create(Func, Value, Mem)); |
| 435 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 436 | void _sub(Variable *Dest, Operand *Src0) { |
| 437 | Context.insert(InstX8632Sub::create(Func, Dest, Src0)); |
| 438 | } |
Matt Wala | 8d1072e | 2014-07-11 15:43:51 -0700 | [diff] [blame] | 439 | void _subps(Variable *Dest, Operand *Src0) { |
| 440 | Context.insert(InstX8632Subps::create(Func, Dest, Src0)); |
| 441 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 442 | void _subss(Variable *Dest, Operand *Src0) { |
| 443 | Context.insert(InstX8632Subss::create(Func, Dest, Src0)); |
| 444 | } |
| 445 | void _test(Operand *Src0, Operand *Src1) { |
| 446 | Context.insert(InstX8632Test::create(Func, Src0, Src1)); |
| 447 | } |
| 448 | void _ucomiss(Operand *Src0, Operand *Src1) { |
| 449 | Context.insert(InstX8632Ucomiss::create(Func, Src0, Src1)); |
| 450 | } |
Jan Voung | 3bd9f1a | 2014-06-18 10:50:57 -0700 | [diff] [blame] | 451 | void _ud2() { Context.insert(InstX8632UD2::create(Func)); } |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 452 | void _xadd(Operand *Dest, Variable *Src, bool Locked) { |
| 453 | Context.insert(InstX8632Xadd::create(Func, Dest, Src, Locked)); |
| 454 | // The xadd exchanges Dest and Src (modifying Src). |
| 455 | // Model that update with a FakeDef. |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 456 | Context.insert( |
| 457 | InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 458 | _set_dest_nonkillable(); |
Jan Voung | a3a01a2 | 2014-07-14 10:32:41 -0700 | [diff] [blame] | 459 | } |
| 460 | void _xchg(Operand *Dest, Variable *Src) { |
| 461 | Context.insert(InstX8632Xchg::create(Func, Dest, Src)); |
| 462 | // The xchg modifies Dest and Src -- model that update with a FakeDef. |
| 463 | Context.insert( |
| 464 | InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 465 | _set_dest_nonkillable(); |
Jan Voung | 5cd240d | 2014-06-25 10:36:46 -0700 | [diff] [blame] | 466 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 467 | void _xor(Variable *Dest, Operand *Src0) { |
| 468 | Context.insert(InstX8632Xor::create(Func, Dest, Src0)); |
| 469 | } |
Jim Stichnoth | 4775255 | 2014-10-13 17:15:08 -0700 | [diff] [blame] | 470 | void _set_dest_nonkillable() { |
| 471 | Context.getLastInserted()->setDestNonKillable(); |
| 472 | } |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 473 | |
Matt Wala | 0a45051 | 2014-07-30 12:44:39 -0700 | [diff] [blame] | 474 | const X86InstructionSet InstructionSet; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 475 | bool IsEbpBasedFrame; |
Matt Wala | 105b704 | 2014-08-11 19:56:19 -0700 | [diff] [blame] | 476 | bool NeedsStackAlignment; |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 477 | size_t FrameSizeLocals; |
Matt Wala | d4799f4 | 2014-08-14 14:24:12 -0700 | [diff] [blame] | 478 | size_t SpillAreaSizeBytes; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 479 | llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 480 | llvm::SmallBitVector ScratchRegs; |
| 481 | llvm::SmallBitVector RegsUsed; |
| 482 | SizeT NextLabelNumber; |
Jim Stichnoth | 336f6c4 | 2014-10-30 15:01:31 -0700 | [diff] [blame] | 483 | VarList PhysicalRegisters[IceType_NUM]; |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 484 | static IceString RegNames[]; |
| 485 | |
| 486 | private: |
Jim Stichnoth | b56c8f4 | 2014-09-26 09:28:46 -0700 | [diff] [blame] | 487 | ~TargetX8632() override {} |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 488 | }; |
| 489 | |
Jan Voung | 72984d8 | 2015-01-29 14:42:38 -0800 | [diff] [blame] | 490 | class TargetDataX8632 : public TargetDataLowering { |
| 491 | TargetDataX8632() = delete; |
| 492 | TargetDataX8632(const TargetDataX8632 &) = delete; |
| 493 | TargetDataX8632 &operator=(const TargetDataX8632 &) = delete; |
Jim Stichnoth | 7b451a9 | 2014-10-15 14:39:23 -0700 | [diff] [blame] | 494 | |
Jim Stichnoth | de4ca71 | 2014-06-29 08:13:48 -0700 | [diff] [blame] | 495 | public: |
Jan Voung | 72984d8 | 2015-01-29 14:42:38 -0800 | [diff] [blame] | 496 | static TargetDataLowering *create(GlobalContext *Ctx) { |
| 497 | return new TargetDataX8632(Ctx); |
Jim Stichnoth | de4ca71 | 2014-06-29 08:13:48 -0700 | [diff] [blame] | 498 | } |
Karl Schimpf | e3f64d0 | 2014-10-07 10:38:22 -0700 | [diff] [blame] | 499 | |
Jan Voung | 72984d8 | 2015-01-29 14:42:38 -0800 | [diff] [blame] | 500 | void lowerGlobal(const VariableDeclaration &Var) const final; |
| 501 | void lowerGlobalsELF(const VariableDeclarationList &Vars) const final; |
| 502 | void lowerConstants(GlobalContext *Ctx) const final; |
Jim Stichnoth | de4ca71 | 2014-06-29 08:13:48 -0700 | [diff] [blame] | 503 | |
| 504 | protected: |
Jan Voung | 72984d8 | 2015-01-29 14:42:38 -0800 | [diff] [blame] | 505 | TargetDataX8632(GlobalContext *Ctx); |
Jim Stichnoth | de4ca71 | 2014-06-29 08:13:48 -0700 | [diff] [blame] | 506 | |
| 507 | private: |
Jan Voung | 72984d8 | 2015-01-29 14:42:38 -0800 | [diff] [blame] | 508 | ~TargetDataX8632() override {} |
Jim Stichnoth | fa4efea | 2015-01-27 05:06:03 -0800 | [diff] [blame] | 509 | template <typename T> static void emitConstantPool(GlobalContext *Ctx); |
Jim Stichnoth | de4ca71 | 2014-06-29 08:13:48 -0700 | [diff] [blame] | 510 | }; |
| 511 | |
Jan Voung | bc00463 | 2014-09-16 15:09:10 -0700 | [diff] [blame] | 512 | template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; |
| 513 | template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 514 | template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 515 | template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
Jim Stichnoth | f61d5b2 | 2014-05-23 13:31:24 -0700 | [diff] [blame] | 516 | |
Jim Stichnoth | 5bc2b1d | 2014-05-22 13:38:48 -0700 | [diff] [blame] | 517 | } // end of namespace Ice |
| 518 | |
| 519 | #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |