| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 const X86InstructionSet InstructionSet; | 476 const X86InstructionSet InstructionSet; |
| 477 bool IsEbpBasedFrame; | 477 bool IsEbpBasedFrame; |
| 478 bool NeedsStackAlignment; | 478 bool NeedsStackAlignment; |
| 479 size_t FrameSizeLocals; | 479 size_t FrameSizeLocals; |
| 480 size_t SpillAreaSizeBytes; | 480 size_t SpillAreaSizeBytes; |
| 481 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 481 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
| 482 llvm::SmallBitVector ScratchRegs; | 482 llvm::SmallBitVector ScratchRegs; |
| 483 llvm::SmallBitVector RegsUsed; | 483 llvm::SmallBitVector RegsUsed; |
| 484 SizeT NextLabelNumber; | 484 SizeT NextLabelNumber; |
| 485 VarList PhysicalRegisters[IceType_NUM]; | 485 VarList PhysicalRegisters[IceType_NUM]; |
| 486 VarList FakeKilledScratchRegisters; | |
| 487 static IceString RegNames[]; | 486 static IceString RegNames[]; |
| 488 | 487 |
| 489 private: | 488 private: |
| 490 ~TargetX8632() override {} | 489 ~TargetX8632() override {} |
| 491 // Ideally, this initialization would be done in the constructor, | |
| 492 // but we need to defer it until after the initial CFG is built, | |
| 493 // because some of the bitcode reader tests rely on the order that | |
| 494 // Variables are created and their default printable names. | |
| 495 void initFakeKilledScratchRegisters() { | |
| 496 for (SizeT I = 0; I < ScratchRegs.size(); ++I) | |
| 497 if (ScratchRegs[I]) | |
| 498 FakeKilledScratchRegisters.push_back(getPhysicalRegister(I)); | |
| 499 } | |
| 500 template <typename T> void emitConstantPool() const; | 490 template <typename T> void emitConstantPool() const; |
| 501 }; | 491 }; |
| 502 | 492 |
| 503 class TargetGlobalInitX8632 : public TargetGlobalInitLowering { | 493 class TargetGlobalInitX8632 : public TargetGlobalInitLowering { |
| 504 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete; | 494 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete; |
| 505 TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete; | 495 TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete; |
| 506 | 496 |
| 507 public: | 497 public: |
| 508 static TargetGlobalInitLowering *create(GlobalContext *Ctx) { | 498 static TargetGlobalInitLowering *create(GlobalContext *Ctx) { |
| 509 return new TargetGlobalInitX8632(Ctx); | 499 return new TargetGlobalInitX8632(Ctx); |
| 510 } | 500 } |
| 511 | 501 |
| 512 virtual void lower(const VariableDeclaration &Var) final; | 502 virtual void lower(const VariableDeclaration &Var) final; |
| 513 | 503 |
| 514 protected: | 504 protected: |
| 515 TargetGlobalInitX8632(GlobalContext *Ctx); | 505 TargetGlobalInitX8632(GlobalContext *Ctx); |
| 516 | 506 |
| 517 private: | 507 private: |
| 518 ~TargetGlobalInitX8632() override {} | 508 ~TargetGlobalInitX8632() override {} |
| 519 }; | 509 }; |
| 520 | 510 |
| 521 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; | 511 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; |
| 522 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; | 512 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; |
| 523 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 513 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
| 524 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 514 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
| 525 | 515 |
| 526 } // end of namespace Ice | 516 } // end of namespace Ice |
| 527 | 517 |
| 528 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 518 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
| OLD | NEW |