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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 const Type FunctionPointerType = IceType_i32; | 139 const Type FunctionPointerType = IceType_i32; |
140 Constant *CallTarget = | 140 Constant *CallTarget = |
141 Ctx->getConstantSym(FunctionPointerType, 0, Name, SuppressMangling); | 141 Ctx->getConstantSym(FunctionPointerType, 0, Name, SuppressMangling); |
142 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); | 142 InstCall *Call = InstCall::create(Func, MaxSrcs, Dest, CallTarget); |
143 return Call; | 143 return Call; |
144 } | 144 } |
145 static Type stackSlotType(); | 145 static Type stackSlotType(); |
146 | 146 |
147 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); | 147 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
148 | 148 |
| 149 // Returns a vector in a register with the given constant entries. |
| 150 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 151 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 152 |
149 // The following are helpers that insert lowered x86 instructions | 153 // The following are helpers that insert lowered x86 instructions |
150 // with minimal syntactic overhead, so that the lowering code can | 154 // with minimal syntactic overhead, so that the lowering code can |
151 // look as close to assembly as practical. | 155 // look as close to assembly as practical. |
152 void _adc(Variable *Dest, Operand *Src0) { | 156 void _adc(Variable *Dest, Operand *Src0) { |
153 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); | 157 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
154 } | 158 } |
155 void _add(Variable *Dest, Operand *Src0) { | 159 void _add(Variable *Dest, Operand *Src0) { |
156 Context.insert(InstX8632Add::create(Func, Dest, Src0)); | 160 Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
157 } | 161 } |
158 void _addps(Variable *Dest, Operand *Src0) { | 162 void _addps(Variable *Dest, Operand *Src0) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 258 } |
255 void _mulss(Variable *Dest, Operand *Src0) { | 259 void _mulss(Variable *Dest, Operand *Src0) { |
256 Context.insert(InstX8632Mulss::create(Func, Dest, Src0)); | 260 Context.insert(InstX8632Mulss::create(Func, Dest, Src0)); |
257 } | 261 } |
258 void _neg(Variable *SrcDest) { | 262 void _neg(Variable *SrcDest) { |
259 Context.insert(InstX8632Neg::create(Func, SrcDest)); | 263 Context.insert(InstX8632Neg::create(Func, SrcDest)); |
260 } | 264 } |
261 void _or(Variable *Dest, Operand *Src0) { | 265 void _or(Variable *Dest, Operand *Src0) { |
262 Context.insert(InstX8632Or::create(Func, Dest, Src0)); | 266 Context.insert(InstX8632Or::create(Func, Dest, Src0)); |
263 } | 267 } |
| 268 void _pand(Variable *Dest, Operand *Src0) { |
| 269 Context.insert(InstX8632Pand::create(Func, Dest, Src0)); |
| 270 } |
| 271 void _pcmpeq(Variable *Dest, Operand *Src0) { |
| 272 Context.insert(InstX8632Pcmpeq::create(Func, Dest, Src0)); |
| 273 } |
| 274 void _pcmpgt(Variable *Dest, Operand *Src0) { |
| 275 Context.insert(InstX8632Pcmpgt::create(Func, Dest, Src0)); |
| 276 } |
264 void _pop(Variable *Dest) { | 277 void _pop(Variable *Dest) { |
265 Context.insert(InstX8632Pop::create(Func, Dest)); | 278 Context.insert(InstX8632Pop::create(Func, Dest)); |
266 } | 279 } |
267 void _push(Operand *Src0, bool SuppressStackAdjustment = false) { | 280 void _push(Operand *Src0, bool SuppressStackAdjustment = false) { |
268 Context.insert(InstX8632Push::create(Func, Src0, SuppressStackAdjustment)); | 281 Context.insert(InstX8632Push::create(Func, Src0, SuppressStackAdjustment)); |
269 } | 282 } |
| 283 void _psll(Variable *Dest, Operand *Src0) { |
| 284 Context.insert(InstX8632Psll::create(Func, Dest, Src0)); |
| 285 } |
| 286 void _psra(Variable *Dest, Operand *Src0) { |
| 287 Context.insert(InstX8632Psra::create(Func, Dest, Src0)); |
| 288 } |
| 289 void _psub(Variable *Dest, Operand *Src0) { |
| 290 Context.insert(InstX8632Psub::create(Func, Dest, Src0)); |
| 291 } |
270 void _pxor(Variable *Dest, Operand *Src0) { | 292 void _pxor(Variable *Dest, Operand *Src0) { |
271 Context.insert(InstX8632Pxor::create(Func, Dest, Src0)); | 293 Context.insert(InstX8632Pxor::create(Func, Dest, Src0)); |
272 } | 294 } |
273 void _ret(Variable *Src0 = NULL) { | 295 void _ret(Variable *Src0 = NULL) { |
274 Context.insert(InstX8632Ret::create(Func, Src0)); | 296 Context.insert(InstX8632Ret::create(Func, Src0)); |
275 } | 297 } |
276 void _sar(Variable *Dest, Operand *Src0) { | 298 void _sar(Variable *Dest, Operand *Src0) { |
277 Context.insert(InstX8632Sar::create(Func, Dest, Src0)); | 299 Context.insert(InstX8632Sar::create(Func, Dest, Src0)); |
278 } | 300 } |
279 void _sbb(Variable *Dest, Operand *Src0) { | 301 void _sbb(Variable *Dest, Operand *Src0) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 virtual ~TargetGlobalInitX8632() {} | 392 virtual ~TargetGlobalInitX8632() {} |
371 }; | 393 }; |
372 | 394 |
373 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 395 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
374 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 396 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
375 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 397 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
376 | 398 |
377 } // end of namespace Ice | 399 } // end of namespace Ice |
378 | 400 |
379 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 401 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |