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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 virtual void lowerLoad(const InstLoad *Inst); | 90 virtual void lowerLoad(const InstLoad *Inst); |
91 virtual void lowerPhi(const InstPhi *Inst); | 91 virtual void lowerPhi(const InstPhi *Inst); |
92 virtual void lowerRet(const InstRet *Inst); | 92 virtual void lowerRet(const InstRet *Inst); |
93 virtual void lowerSelect(const InstSelect *Inst); | 93 virtual void lowerSelect(const InstSelect *Inst); |
94 virtual void lowerStore(const InstStore *Inst); | 94 virtual void lowerStore(const InstStore *Inst); |
95 virtual void lowerSwitch(const InstSwitch *Inst); | 95 virtual void lowerSwitch(const InstSwitch *Inst); |
96 virtual void lowerUnreachable(const InstUnreachable *Inst); | 96 virtual void lowerUnreachable(const InstUnreachable *Inst); |
97 virtual void doAddressOptLoad(); | 97 virtual void doAddressOptLoad(); |
98 virtual void doAddressOptStore(); | 98 virtual void doAddressOptStore(); |
99 | 99 |
| 100 // Naive lowering of cmpxchg. |
100 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, | 101 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, |
101 Operand *Desired); | 102 Operand *Desired); |
| 103 // Attempt a more optimized lowering of cmpxchg. Returns true if optimized. |
| 104 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, |
| 105 Operand *Expected, Operand *Desired); |
102 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, | 106 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, |
103 Operand *Val); | 107 Operand *Val); |
104 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, | 108 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, |
105 Operand *SecondVal); | 109 Operand *SecondVal); |
106 | 110 |
107 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); | 111 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); |
108 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, | 112 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
109 Variable *Dest, Operand *Ptr, Operand *Val); | 113 Variable *Dest, Operand *Ptr, Operand *Val); |
110 | 114 |
111 // Operand legalization helpers. To deal with address mode | 115 // Operand legalization helpers. To deal with address mode |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 virtual ~TargetGlobalInitX8632() {} | 459 virtual ~TargetGlobalInitX8632() {} |
456 }; | 460 }; |
457 | 461 |
458 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 462 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
459 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 463 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
460 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 464 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
461 | 465 |
462 } // end of namespace Ice | 466 } // end of namespace Ice |
463 | 467 |
464 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 468 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |