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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const Type FunctionPointerType = IceType_i32; | 141 const Type FunctionPointerType = IceType_i32; |
142 Constant *CallTarget = | 142 Constant *CallTarget = |
143 Ctx->getConstantSym(FunctionPointerType, 0, Name, SuppressMangling); | 143 Ctx->getConstantSym(FunctionPointerType, 0, Name, SuppressMangling); |
144 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); | 144 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); |
145 return Call; | 145 return Call; |
146 } | 146 } |
147 static Type stackSlotType(); | 147 static Type stackSlotType(); |
148 | 148 |
149 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); | 149 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
150 | 150 |
| 151 // Returns a vector in a register with the given constant entries. |
| 152 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 153 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 154 |
151 // The following are helpers that insert lowered x86 instructions | 155 // The following are helpers that insert lowered x86 instructions |
152 // with minimal syntactic overhead, so that the lowering code can | 156 // with minimal syntactic overhead, so that the lowering code can |
153 // look as close to assembly as practical. | 157 // look as close to assembly as practical. |
154 void _adc(Variable *Dest, Operand *Src0) { | 158 void _adc(Variable *Dest, Operand *Src0) { |
155 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); | 159 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
156 } | 160 } |
157 void _add(Variable *Dest, Operand *Src0) { | 161 void _add(Variable *Dest, Operand *Src0) { |
158 Context.insert(InstX8632Add::create(Func, Dest, Src0)); | 162 Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
159 } | 163 } |
160 void _addps(Variable *Dest, Operand *Src0) { | 164 void _addps(Variable *Dest, Operand *Src0) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 269 } |
266 void _mulss(Variable *Dest, Operand *Src0) { | 270 void _mulss(Variable *Dest, Operand *Src0) { |
267 Context.insert(InstX8632Mulss::create(Func, Dest, Src0)); | 271 Context.insert(InstX8632Mulss::create(Func, Dest, Src0)); |
268 } | 272 } |
269 void _neg(Variable *SrcDest) { | 273 void _neg(Variable *SrcDest) { |
270 Context.insert(InstX8632Neg::create(Func, SrcDest)); | 274 Context.insert(InstX8632Neg::create(Func, SrcDest)); |
271 } | 275 } |
272 void _or(Variable *Dest, Operand *Src0) { | 276 void _or(Variable *Dest, Operand *Src0) { |
273 Context.insert(InstX8632Or::create(Func, Dest, Src0)); | 277 Context.insert(InstX8632Or::create(Func, Dest, Src0)); |
274 } | 278 } |
| 279 void _pand(Variable *Dest, Operand *Src0) { |
| 280 Context.insert(InstX8632Pand::create(Func, Dest, Src0)); |
| 281 } |
| 282 void _pcmpeq(Variable *Dest, Operand *Src0) { |
| 283 Context.insert(InstX8632Pcmpeq::create(Func, Dest, Src0)); |
| 284 } |
| 285 void _pcmpgt(Variable *Dest, Operand *Src0) { |
| 286 Context.insert(InstX8632Pcmpgt::create(Func, Dest, Src0)); |
| 287 } |
275 void _pop(Variable *Dest) { | 288 void _pop(Variable *Dest) { |
276 Context.insert(InstX8632Pop::create(Func, Dest)); | 289 Context.insert(InstX8632Pop::create(Func, Dest)); |
277 } | 290 } |
278 void _push(Operand *Src0, bool SuppressStackAdjustment = false) { | 291 void _push(Operand *Src0, bool SuppressStackAdjustment = false) { |
279 Context.insert(InstX8632Push::create(Func, Src0, SuppressStackAdjustment)); | 292 Context.insert(InstX8632Push::create(Func, Src0, SuppressStackAdjustment)); |
280 } | 293 } |
| 294 void _psll(Variable *Dest, Operand *Src0) { |
| 295 Context.insert(InstX8632Psll::create(Func, Dest, Src0)); |
| 296 } |
| 297 void _psra(Variable *Dest, Operand *Src0) { |
| 298 Context.insert(InstX8632Psra::create(Func, Dest, Src0)); |
| 299 } |
| 300 void _psub(Variable *Dest, Operand *Src0) { |
| 301 Context.insert(InstX8632Psub::create(Func, Dest, Src0)); |
| 302 } |
281 void _pxor(Variable *Dest, Operand *Src0) { | 303 void _pxor(Variable *Dest, Operand *Src0) { |
282 Context.insert(InstX8632Pxor::create(Func, Dest, Src0)); | 304 Context.insert(InstX8632Pxor::create(Func, Dest, Src0)); |
283 } | 305 } |
284 void _ret(Variable *Src0 = NULL) { | 306 void _ret(Variable *Src0 = NULL) { |
285 Context.insert(InstX8632Ret::create(Func, Src0)); | 307 Context.insert(InstX8632Ret::create(Func, Src0)); |
286 } | 308 } |
287 void _sar(Variable *Dest, Operand *Src0) { | 309 void _sar(Variable *Dest, Operand *Src0) { |
288 Context.insert(InstX8632Sar::create(Func, Dest, Src0)); | 310 Context.insert(InstX8632Sar::create(Func, Dest, Src0)); |
289 } | 311 } |
290 void _sbb(Variable *Dest, Operand *Src0) { | 312 void _sbb(Variable *Dest, Operand *Src0) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 virtual ~TargetGlobalInitX8632() {} | 403 virtual ~TargetGlobalInitX8632() {} |
382 }; | 404 }; |
383 | 405 |
384 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 406 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
385 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 407 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
386 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 408 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
387 | 409 |
388 } // end of namespace Ice | 410 } // end of namespace Ice |
389 | 411 |
390 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 412 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |