| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 // The following are helpers that insert lowered x86 instructions | 179 // The following are helpers that insert lowered x86 instructions |
| 180 // with minimal syntactic overhead, so that the lowering code can | 180 // with minimal syntactic overhead, so that the lowering code can |
| 181 // look as close to assembly as practical. | 181 // look as close to assembly as practical. |
| 182 void _adc(Variable *Dest, Operand *Src0) { | 182 void _adc(Variable *Dest, Operand *Src0) { |
| 183 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); | 183 Context.insert(InstX8632Adc::create(Func, Dest, Src0)); |
| 184 } | 184 } |
| 185 void _add(Variable *Dest, Operand *Src0) { | 185 void _add(Variable *Dest, Operand *Src0) { |
| 186 Context.insert(InstX8632Add::create(Func, Dest, Src0)); | 186 Context.insert(InstX8632Add::create(Func, Dest, Src0)); |
| 187 } | 187 } |
| 188 void _adjust_stack(int32_t Amount) { |
| 189 Context.insert(InstX8632AdjustStack::create(Func, Amount)); |
| 190 } |
| 188 void _addps(Variable *Dest, Operand *Src0) { | 191 void _addps(Variable *Dest, Operand *Src0) { |
| 189 Context.insert(InstX8632Addps::create(Func, Dest, Src0)); | 192 Context.insert(InstX8632Addps::create(Func, Dest, Src0)); |
| 190 } | 193 } |
| 191 void _addss(Variable *Dest, Operand *Src0) { | 194 void _addss(Variable *Dest, Operand *Src0) { |
| 192 Context.insert(InstX8632Addss::create(Func, Dest, Src0)); | 195 Context.insert(InstX8632Addss::create(Func, Dest, Src0)); |
| 193 } | 196 } |
| 194 void _and(Variable *Dest, Operand *Src0) { | 197 void _and(Variable *Dest, Operand *Src0) { |
| 195 Context.insert(InstX8632And::create(Func, Dest, Src0)); | 198 Context.insert(InstX8632And::create(Func, Dest, Src0)); |
| 196 } | 199 } |
| 197 void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) { | 200 void _blendvps(Variable *Dest, Operand *Src0, Operand *Src1) { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 } | 405 } |
| 403 void _shufps(Variable *Dest, Operand *Src0, Operand *Src1) { | 406 void _shufps(Variable *Dest, Operand *Src0, Operand *Src1) { |
| 404 Context.insert(InstX8632Shufps::create(Func, Dest, Src0, Src1)); | 407 Context.insert(InstX8632Shufps::create(Func, Dest, Src0, Src1)); |
| 405 } | 408 } |
| 406 void _sqrtss(Variable *Dest, Operand *Src0) { | 409 void _sqrtss(Variable *Dest, Operand *Src0) { |
| 407 Context.insert(InstX8632Sqrtss::create(Func, Dest, Src0)); | 410 Context.insert(InstX8632Sqrtss::create(Func, Dest, Src0)); |
| 408 } | 411 } |
| 409 void _store(Operand *Value, OperandX8632 *Mem) { | 412 void _store(Operand *Value, OperandX8632 *Mem) { |
| 410 Context.insert(InstX8632Store::create(Func, Value, Mem)); | 413 Context.insert(InstX8632Store::create(Func, Value, Mem)); |
| 411 } | 414 } |
| 415 void _storep(Operand *Value, OperandX8632 *Mem) { |
| 416 Context.insert(InstX8632StoreP::create(Func, Value, Mem)); |
| 417 } |
| 412 void _storeq(Operand *Value, OperandX8632 *Mem) { | 418 void _storeq(Operand *Value, OperandX8632 *Mem) { |
| 413 Context.insert(InstX8632StoreQ::create(Func, Value, Mem)); | 419 Context.insert(InstX8632StoreQ::create(Func, Value, Mem)); |
| 414 } | 420 } |
| 415 void _sub(Variable *Dest, Operand *Src0) { | 421 void _sub(Variable *Dest, Operand *Src0) { |
| 416 Context.insert(InstX8632Sub::create(Func, Dest, Src0)); | 422 Context.insert(InstX8632Sub::create(Func, Dest, Src0)); |
| 417 } | 423 } |
| 418 void _subps(Variable *Dest, Operand *Src0) { | 424 void _subps(Variable *Dest, Operand *Src0) { |
| 419 Context.insert(InstX8632Subps::create(Func, Dest, Src0)); | 425 Context.insert(InstX8632Subps::create(Func, Dest, Src0)); |
| 420 } | 426 } |
| 421 void _subss(Variable *Dest, Operand *Src0) { | 427 void _subss(Variable *Dest, Operand *Src0) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 440 // The xchg modifies Dest and Src -- model that update with a FakeDef. | 446 // The xchg modifies Dest and Src -- model that update with a FakeDef. |
| 441 Context.insert( | 447 Context.insert( |
| 442 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); | 448 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); |
| 443 } | 449 } |
| 444 void _xor(Variable *Dest, Operand *Src0) { | 450 void _xor(Variable *Dest, Operand *Src0) { |
| 445 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); | 451 Context.insert(InstX8632Xor::create(Func, Dest, Src0)); |
| 446 } | 452 } |
| 447 | 453 |
| 448 const X86InstructionSet InstructionSet; | 454 const X86InstructionSet InstructionSet; |
| 449 bool IsEbpBasedFrame; | 455 bool IsEbpBasedFrame; |
| 456 bool NeedsStackAlignment; |
| 450 size_t FrameSizeLocals; | 457 size_t FrameSizeLocals; |
| 451 size_t LocalsSizeBytes; | 458 size_t LocalsSizeBytes; |
| 452 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 459 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 453 llvm::SmallBitVector ScratchRegs; | 460 llvm::SmallBitVector ScratchRegs; |
| 454 llvm::SmallBitVector RegsUsed; | 461 llvm::SmallBitVector RegsUsed; |
| 455 SizeT NextLabelNumber; | 462 SizeT NextLabelNumber; |
| 456 bool ComputedLiveRanges; | 463 bool ComputedLiveRanges; |
| 457 VarList PhysicalRegisters; | 464 VarList PhysicalRegisters; |
| 458 static IceString RegNames[]; | 465 static IceString RegNames[]; |
| 459 | 466 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 483 virtual ~TargetGlobalInitX8632() {} | 490 virtual ~TargetGlobalInitX8632() {} |
| 484 }; | 491 }; |
| 485 | 492 |
| 486 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; | 493 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; |
| 487 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 494 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 488 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 495 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 489 | 496 |
| 490 } // end of namespace Ice | 497 } // end of namespace Ice |
| 491 | 498 |
| 492 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 499 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |