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 |
11 // implements the TargetLowering interface for the x86-32 | 11 // implements the TargetLowering interface for the x86-32 |
12 // architecture. | 12 // architecture. |
13 // | 13 // |
14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
15 | 15 |
16 #ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 16 #ifndef SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
17 #define SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 17 #define SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
18 | 18 |
19 #include "assembler_ia32.h" | 19 #include "assembler_ia32.h" |
20 #include "IceDefs.h" | 20 #include "IceDefs.h" |
21 #include "IceInstX8632.h" | 21 #include "IceInstX8632.h" |
22 #include "IceRegistersX8632.h" | 22 #include "IceRegistersX8632.h" |
23 #include "IceTargetLowering.h" | 23 #include "IceTargetLowering.h" |
24 | 24 |
25 namespace Ice { | 25 namespace Ice { |
26 | 26 |
27 class TargetX8632 : public TargetLowering { | 27 class TargetX8632 : public TargetLowering { |
| 28 TargetX8632(const TargetX8632 &) = delete; |
| 29 TargetX8632 &operator=(const TargetX8632 &) = delete; |
| 30 |
28 public: | 31 public: |
29 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } | 32 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } |
30 | 33 |
31 void translateOm1() override; | 34 void translateOm1() override; |
32 void translateO2() override; | 35 void translateO2() override; |
33 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; | 36 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; |
34 | 37 |
35 Variable *getPhysicalRegister(SizeT RegNum) override; | 38 Variable *getPhysicalRegister(SizeT RegNum) override; |
36 IceString getRegName(SizeT RegNum, Type Ty) const override; | 39 IceString getRegName(SizeT RegNum, Type Ty) const override; |
37 llvm::SmallBitVector getRegisterSet(RegSetMask Include, | 40 llvm::SmallBitVector getRegisterSet(RegSetMask Include, |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 size_t SpillAreaSizeBytes; | 479 size_t SpillAreaSizeBytes; |
477 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 480 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
478 llvm::SmallBitVector ScratchRegs; | 481 llvm::SmallBitVector ScratchRegs; |
479 llvm::SmallBitVector RegsUsed; | 482 llvm::SmallBitVector RegsUsed; |
480 SizeT NextLabelNumber; | 483 SizeT NextLabelNumber; |
481 bool ComputedLiveRanges; | 484 bool ComputedLiveRanges; |
482 VarList PhysicalRegisters; | 485 VarList PhysicalRegisters; |
483 static IceString RegNames[]; | 486 static IceString RegNames[]; |
484 | 487 |
485 private: | 488 private: |
486 TargetX8632(const TargetX8632 &) = delete; | |
487 TargetX8632 &operator=(const TargetX8632 &) = delete; | |
488 ~TargetX8632() override {} | 489 ~TargetX8632() override {} |
489 template <typename T> void emitConstantPool() const; | 490 template <typename T> void emitConstantPool() const; |
490 }; | 491 }; |
491 | 492 |
492 class TargetGlobalInitX8632 : public TargetGlobalInitLowering { | 493 class TargetGlobalInitX8632 : public TargetGlobalInitLowering { |
| 494 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete; |
| 495 TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete; |
| 496 |
493 public: | 497 public: |
494 static TargetGlobalInitLowering *create(GlobalContext *Ctx) { | 498 static TargetGlobalInitLowering *create(GlobalContext *Ctx) { |
495 return new TargetGlobalInitX8632(Ctx); | 499 return new TargetGlobalInitX8632(Ctx); |
496 } | 500 } |
497 | 501 |
498 virtual void lower(const VariableDeclaration &Var) final; | 502 virtual void lower(const VariableDeclaration &Var) final; |
499 | 503 |
500 protected: | 504 protected: |
501 TargetGlobalInitX8632(GlobalContext *Ctx); | 505 TargetGlobalInitX8632(GlobalContext *Ctx); |
502 | 506 |
503 private: | 507 private: |
504 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete; | |
505 TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete; | |
506 ~TargetGlobalInitX8632() override {} | 508 ~TargetGlobalInitX8632() override {} |
507 }; | 509 }; |
508 | 510 |
509 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; | 511 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; |
510 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; | 512 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; |
511 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 513 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
512 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 514 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
513 | 515 |
514 } // end of namespace Ice | 516 } // end of namespace Ice |
515 | 517 |
516 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 518 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |