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() = delete; |
28 TargetX8632(const TargetX8632 &) = delete; | 29 TargetX8632(const TargetX8632 &) = delete; |
29 TargetX8632 &operator=(const TargetX8632 &) = delete; | 30 TargetX8632 &operator=(const TargetX8632 &) = delete; |
30 | 31 |
31 public: | 32 public: |
32 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } | 33 static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } |
33 | 34 |
34 void translateOm1() override; | 35 void translateOm1() override; |
35 void translateO2() override; | 36 void translateO2() override; |
36 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; | 37 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; |
37 | 38 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 72 |
72 enum X86InstructionSet { | 73 enum X86InstructionSet { |
73 // SSE2 is the PNaCl baseline instruction set. | 74 // SSE2 is the PNaCl baseline instruction set. |
74 SSE2, | 75 SSE2, |
75 SSE4_1 | 76 SSE4_1 |
76 }; | 77 }; |
77 | 78 |
78 X86InstructionSet getInstructionSet() const { return InstructionSet; } | 79 X86InstructionSet getInstructionSet() const { return InstructionSet; } |
79 | 80 |
80 protected: | 81 protected: |
81 TargetX8632(Cfg *Func); | 82 explicit TargetX8632(Cfg *Func); |
82 | 83 |
83 void postLower() override; | 84 void postLower() override; |
84 | 85 |
85 void lowerAlloca(const InstAlloca *Inst) override; | 86 void lowerAlloca(const InstAlloca *Inst) override; |
86 void lowerArithmetic(const InstArithmetic *Inst) override; | 87 void lowerArithmetic(const InstArithmetic *Inst) override; |
87 void lowerAssign(const InstAssign *Inst) override; | 88 void lowerAssign(const InstAssign *Inst) override; |
88 void lowerBr(const InstBr *Inst) override; | 89 void lowerBr(const InstBr *Inst) override; |
89 void lowerCall(const InstCall *Inst) override; | 90 void lowerCall(const InstCall *Inst) override; |
90 void lowerCast(const InstCast *Inst) override; | 91 void lowerCast(const InstCast *Inst) override; |
91 void lowerExtractElement(const InstExtractElement *Inst) override; | 92 void lowerExtractElement(const InstExtractElement *Inst) override; |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 503 |
503 public: | 504 public: |
504 static TargetDataLowering *create(GlobalContext *Ctx) { | 505 static TargetDataLowering *create(GlobalContext *Ctx) { |
505 return new TargetDataX8632(Ctx); | 506 return new TargetDataX8632(Ctx); |
506 } | 507 } |
507 | 508 |
508 void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const final; | 509 void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const final; |
509 void lowerConstants() const final; | 510 void lowerConstants() const final; |
510 | 511 |
511 protected: | 512 protected: |
512 TargetDataX8632(GlobalContext *Ctx); | 513 explicit TargetDataX8632(GlobalContext *Ctx); |
513 | 514 |
514 private: | 515 private: |
515 void lowerGlobal(const VariableDeclaration &Var) const; | 516 void lowerGlobal(const VariableDeclaration &Var) const; |
516 ~TargetDataX8632() override {} | 517 ~TargetDataX8632() override {} |
517 template <typename T> static void emitConstantPool(GlobalContext *Ctx); | 518 template <typename T> static void emitConstantPool(GlobalContext *Ctx); |
518 }; | 519 }; |
519 | 520 |
520 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; | 521 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; |
521 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; | 522 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; |
522 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; | 523 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; |
523 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; | 524 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; |
524 | 525 |
525 } // end of namespace Ice | 526 } // end of namespace Ice |
526 | 527 |
527 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H | 528 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H |
OLD | NEW |