OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file declares the TargetLoweringX8632 class, which | 10 // This file declares the TargetLoweringX8632 class, which |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 Operand *Val); | 115 Operand *Val); |
116 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, | 116 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, |
117 Operand *SecondVal); | 117 Operand *SecondVal); |
118 | 118 |
119 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); | 119 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); |
120 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, | 120 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
121 Variable *Dest, Operand *Ptr, Operand *Val); | 121 Variable *Dest, Operand *Ptr, Operand *Val); |
122 | 122 |
123 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); | 123 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); |
124 | 124 |
| 125 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, |
| 126 Operand *Src0, Operand *Src1); |
| 127 |
125 // Operand legalization helpers. To deal with address mode | 128 // Operand legalization helpers. To deal with address mode |
126 // constraints, the helpers will create a new Operand and emit | 129 // constraints, the helpers will create a new Operand and emit |
127 // instructions that guarantee that the Operand kind is one of those | 130 // instructions that guarantee that the Operand kind is one of those |
128 // indicated by the LegalMask (a bitmask of allowed kinds). If the | 131 // indicated by the LegalMask (a bitmask of allowed kinds). If the |
129 // input Operand is known to already meet the constraints, it may be | 132 // input Operand is known to already meet the constraints, it may be |
130 // simply returned as the result, without creating any new | 133 // simply returned as the result, without creating any new |
131 // instructions or operands. | 134 // instructions or operands. |
132 enum OperandLegalization { | 135 enum OperandLegalization { |
133 Legal_None = 0, | 136 Legal_None = 0, |
134 Legal_Reg = 1 << 0, // physical register, not stack location | 137 Legal_Reg = 1 << 0, // physical register, not stack location |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 216 } |
214 void _bsf(Variable *Dest, Operand *Src0) { | 217 void _bsf(Variable *Dest, Operand *Src0) { |
215 Context.insert(InstX8632Bsf::create(Func, Dest, Src0)); | 218 Context.insert(InstX8632Bsf::create(Func, Dest, Src0)); |
216 } | 219 } |
217 void _bsr(Variable *Dest, Operand *Src0) { | 220 void _bsr(Variable *Dest, Operand *Src0) { |
218 Context.insert(InstX8632Bsr::create(Func, Dest, Src0)); | 221 Context.insert(InstX8632Bsr::create(Func, Dest, Src0)); |
219 } | 222 } |
220 void _bswap(Variable *SrcDest) { | 223 void _bswap(Variable *SrcDest) { |
221 Context.insert(InstX8632Bswap::create(Func, SrcDest)); | 224 Context.insert(InstX8632Bswap::create(Func, SrcDest)); |
222 } | 225 } |
223 void _cdq(Variable *Dest, Operand *Src0) { | 226 void _cbwdq(Variable *Dest, Operand *Src0) { |
224 Context.insert(InstX8632Cdq::create(Func, Dest, Src0)); | 227 Context.insert(InstX8632Cbwdq::create(Func, Dest, Src0)); |
225 } | 228 } |
226 void _cmov(Variable *Dest, Operand *Src0, InstX8632::BrCond Condition) { | 229 void _cmov(Variable *Dest, Operand *Src0, InstX8632::BrCond Condition) { |
227 Context.insert(InstX8632Cmov::create(Func, Dest, Src0, Condition)); | 230 Context.insert(InstX8632Cmov::create(Func, Dest, Src0, Condition)); |
228 } | 231 } |
229 void _cmp(Operand *Src0, Operand *Src1) { | 232 void _cmp(Operand *Src0, Operand *Src1) { |
230 Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); | 233 Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); |
231 } | 234 } |
232 void _cmpps(Variable *Dest, Operand *Src0, | 235 void _cmpps(Variable *Dest, Operand *Src0, |
233 InstX8632Cmpps::CmppsCond Condition) { | 236 InstX8632Cmpps::CmppsCond Condition) { |
234 Context.insert(InstX8632Cmpps::create(Func, Dest, Src0, Condition)); | 237 Context.insert(InstX8632Cmpps::create(Func, Dest, Src0, Condition)); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 virtual ~TargetGlobalInitX8632() {} | 486 virtual ~TargetGlobalInitX8632() {} |
484 }; | 487 }; |
485 | 488 |
486 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 489 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
487 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 490 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
488 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 491 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
489 | 492 |
490 } // end of namespace Ice | 493 } // end of namespace Ice |
491 | 494 |
492 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 495 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |