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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 virtual void lowerStore(const InstStore *Inst); | 92 virtual void lowerStore(const InstStore *Inst); |
93 virtual void lowerSwitch(const InstSwitch *Inst); | 93 virtual void lowerSwitch(const InstSwitch *Inst); |
94 virtual void lowerUnreachable(const InstUnreachable *Inst); | 94 virtual void lowerUnreachable(const InstUnreachable *Inst); |
95 virtual void doAddressOptLoad(); | 95 virtual void doAddressOptLoad(); |
96 virtual void doAddressOptStore(); | 96 virtual void doAddressOptStore(); |
97 | 97 |
98 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, | 98 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, |
99 Operand *Desired); | 99 Operand *Desired); |
100 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, | 100 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, |
101 Operand *Val); | 101 Operand *Val); |
| 102 void lowerCtlz(Variable *Dest, Operand *Val); |
| 103 void lowerCttz(Variable *Dest, Operand *Val); |
102 | 104 |
103 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); | 105 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); |
104 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, | 106 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
105 Variable *Dest, Operand *Ptr, Operand *Val); | 107 Variable *Dest, Operand *Ptr, Operand *Val); |
106 | 108 |
107 // Operand legalization helpers. To deal with address mode | 109 // Operand legalization helpers. To deal with address mode |
108 // constraints, the helpers will create a new Operand and emit | 110 // constraints, the helpers will create a new Operand and emit |
109 // instructions that guarantee that the Operand kind is one of those | 111 // instructions that guarantee that the Operand kind is one of those |
110 // indicated by the LegalMask (a bitmask of allowed kinds). If the | 112 // indicated by the LegalMask (a bitmask of allowed kinds). If the |
111 // input Operand is known to already meet the constraints, it may be | 113 // input Operand is known to already meet the constraints, it may be |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 158 } |
157 void _addps(Variable *Dest, Operand *Src0) { | 159 void _addps(Variable *Dest, Operand *Src0) { |
158 Context.insert(InstX8632Addps::create(Func, Dest, Src0)); | 160 Context.insert(InstX8632Addps::create(Func, Dest, Src0)); |
159 } | 161 } |
160 void _addss(Variable *Dest, Operand *Src0) { | 162 void _addss(Variable *Dest, Operand *Src0) { |
161 Context.insert(InstX8632Addss::create(Func, Dest, Src0)); | 163 Context.insert(InstX8632Addss::create(Func, Dest, Src0)); |
162 } | 164 } |
163 void _and(Variable *Dest, Operand *Src0) { | 165 void _and(Variable *Dest, Operand *Src0) { |
164 Context.insert(InstX8632And::create(Func, Dest, Src0)); | 166 Context.insert(InstX8632And::create(Func, Dest, Src0)); |
165 } | 167 } |
166 void _br(InstX8632Br::BrCond Condition, CfgNode *TargetTrue, | 168 void _br(InstX8632::BrCond Condition, CfgNode *TargetTrue, |
167 CfgNode *TargetFalse) { | 169 CfgNode *TargetFalse) { |
168 Context.insert( | 170 Context.insert( |
169 InstX8632Br::create(Func, TargetTrue, TargetFalse, Condition)); | 171 InstX8632Br::create(Func, TargetTrue, TargetFalse, Condition)); |
170 } | 172 } |
171 void _br(CfgNode *Target) { | 173 void _br(CfgNode *Target) { |
172 Context.insert(InstX8632Br::create(Func, Target)); | 174 Context.insert(InstX8632Br::create(Func, Target)); |
173 } | 175 } |
174 void _br(InstX8632Br::BrCond Condition, CfgNode *Target) { | 176 void _br(InstX8632::BrCond Condition, CfgNode *Target) { |
175 Context.insert(InstX8632Br::create(Func, Target, Condition)); | 177 Context.insert(InstX8632Br::create(Func, Target, Condition)); |
176 } | 178 } |
177 void _br(InstX8632Br::BrCond Condition, InstX8632Label *Label) { | 179 void _br(InstX8632::BrCond Condition, InstX8632Label *Label) { |
178 Context.insert(InstX8632Br::create(Func, Label, Condition)); | 180 Context.insert(InstX8632Br::create(Func, Label, Condition)); |
179 } | 181 } |
| 182 void _bsf(Variable *Dest, Operand *Src0) { |
| 183 Context.insert(InstX8632Bsf::create(Func, Dest, Src0)); |
| 184 } |
| 185 void _bsr(Variable *Dest, Operand *Src0) { |
| 186 Context.insert(InstX8632Bsr::create(Func, Dest, Src0)); |
| 187 } |
180 void _cdq(Variable *Dest, Operand *Src0) { | 188 void _cdq(Variable *Dest, Operand *Src0) { |
181 Context.insert(InstX8632Cdq::create(Func, Dest, Src0)); | 189 Context.insert(InstX8632Cdq::create(Func, Dest, Src0)); |
182 } | 190 } |
| 191 void _cmov(Variable *Dest, Operand *Src0, InstX8632::BrCond Condition) { |
| 192 Context.insert(InstX8632Cmov::create(Func, Dest, Src0, Condition)); |
| 193 } |
183 void _cmp(Operand *Src0, Operand *Src1) { | 194 void _cmp(Operand *Src0, Operand *Src1) { |
184 Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); | 195 Context.insert(InstX8632Icmp::create(Func, Src0, Src1)); |
185 } | 196 } |
186 void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, | 197 void _cmpxchg(Operand *DestOrAddr, Variable *Eax, Variable *Desired, |
187 bool Locked) { | 198 bool Locked) { |
188 Context.insert( | 199 Context.insert( |
189 InstX8632Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); | 200 InstX8632Cmpxchg::create(Func, DestOrAddr, Eax, Desired, Locked)); |
190 // Mark eax as possibly modified by cmpxchg. | 201 // Mark eax as possibly modified by cmpxchg. |
191 Context.insert( | 202 Context.insert( |
192 InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); | 203 InstFakeDef::create(Func, Eax, llvm::dyn_cast<Variable>(DestOrAddr))); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 virtual ~TargetGlobalInitX8632() {} | 380 virtual ~TargetGlobalInitX8632() {} |
370 }; | 381 }; |
371 | 382 |
372 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 383 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
373 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 384 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
374 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 385 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
375 | 386 |
376 } // end of namespace Ice | 387 } // end of namespace Ice |
377 | 388 |
378 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 389 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |