| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 Operand *Desired); | 101 Operand *Desired); |
| 102 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, | 102 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, |
| 103 Operand *Val); | 103 Operand *Val); |
| 104 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, | 104 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, |
| 105 Operand *SecondVal); | 105 Operand *SecondVal); |
| 106 | 106 |
| 107 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); | 107 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); |
| 108 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, | 108 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
| 109 Variable *Dest, Operand *Ptr, Operand *Val); | 109 Variable *Dest, Operand *Ptr, Operand *Val); |
| 110 | 110 |
| 111 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); |
| 112 |
| 111 // Operand legalization helpers. To deal with address mode | 113 // Operand legalization helpers. To deal with address mode |
| 112 // constraints, the helpers will create a new Operand and emit | 114 // constraints, the helpers will create a new Operand and emit |
| 113 // instructions that guarantee that the Operand kind is one of those | 115 // instructions that guarantee that the Operand kind is one of those |
| 114 // indicated by the LegalMask (a bitmask of allowed kinds). If the | 116 // indicated by the LegalMask (a bitmask of allowed kinds). If the |
| 115 // input Operand is known to already meet the constraints, it may be | 117 // input Operand is known to already meet the constraints, it may be |
| 116 // simply returned as the result, without creating any new | 118 // simply returned as the result, without creating any new |
| 117 // instructions or operands. | 119 // instructions or operands. |
| 118 enum OperandLegalization { | 120 enum OperandLegalization { |
| 119 Legal_None = 0, | 121 Legal_None = 0, |
| 120 Legal_Reg = 1 << 0, // physical register, not stack location | 122 Legal_Reg = 1 << 0, // physical register, not stack location |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 207 } |
| 206 void _cdq(Variable *Dest, Operand *Src0) { | 208 void _cdq(Variable *Dest, Operand *Src0) { |
| 207 Context.insert(InstX8632Cdq::create(Func, Dest, Src0)); | 209 Context.insert(InstX8632Cdq::create(Func, Dest, Src0)); |
| 208 } | 210 } |
| 209 void _cmov(Variable *Dest, Operand *Src0, InstX8632::BrCond Condition) { | 211 void _cmov(Variable *Dest, Operand *Src0, InstX8632::BrCond Condition) { |
| 210 Context.insert(InstX8632Cmov::create(Func, Dest, Src0, Condition)); | 212 Context.insert(InstX8632Cmov::create(Func, Dest, Src0, Condition)); |
| 211 } | 213 } |
| 212 void _cmp(Operand *Src0, Operand *Src1) { | 214 void _cmp(Operand *Src0, Operand *Src1) { |
| 213 Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); | 215 Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); |
| 214 } | 216 } |
| 217 void _cmpps(Variable *Dest, Operand *Src0, |
| 218 InstX8632Cmpps::CmppsCond Condition) { |
| 219 Context.insert(InstX8632Cmpps::create(Func, Dest, Src0, Condition)); |
| 220 } |
| 215 void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, | 221 void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, |
| 216 bool Locked) { | 222 bool Locked) { |
| 217 Context.insert( | 223 Context.insert( |
| 218 InstX8632Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); | 224 InstX8632Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); |
| 219 // Mark eax as possibly modified by cmpxchg. | 225 // Mark eax as possibly modified by cmpxchg. |
| 220 Context.insert( | 226 Context.insert( |
| 221 InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); | 227 InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); |
| 222 } | 228 } |
| 223 void _cmpxchg8b(OperandX8632 *Addr, Variable *Edx, Variable *Eax, | 229 void _cmpxchg8b(OperandX8632 *Addr, Variable *Edx, Variable *Eax, |
| 224 Variable *Ecx, Variable *Ebx, bool Locked) { | 230 Variable *Ecx, Variable *Ebx, bool Locked) { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 virtual ~TargetGlobalInitX8632() {} | 461 virtual ~TargetGlobalInitX8632() {} |
| 456 }; | 462 }; |
| 457 | 463 |
| 458 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 464 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
| 459 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 465 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 460 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 466 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 461 | 467 |
| 462 } // end of namespace Ice | 468 } // end of namespace Ice |
| 463 | 469 |
| 464 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 470 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |