OLD | NEW |
1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 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 /// \file | 10 /// \file |
11 /// \brief Declares the TargetLoweringARM32 class, which implements the | 11 /// \brief Declares the TargetLoweringARM32 class, which implements the |
12 /// TargetLowering interface for the ARM 32-bit architecture. | 12 /// TargetLowering interface for the ARM 32-bit architecture. |
13 /// | 13 /// |
14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
15 | 15 |
16 #ifndef SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 16 #ifndef SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
17 #define SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 17 #define SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
18 | 18 |
| 19 #include "IceAssemblerARM32.h" |
19 #include "IceDefs.h" | 20 #include "IceDefs.h" |
20 #include "IceInstARM32.h" | 21 #include "IceInstARM32.h" |
21 #include "IceRegistersARM32.h" | 22 #include "IceRegistersARM32.h" |
22 #include "IceTargetLowering.h" | 23 #include "IceTargetLowering.h" |
23 | 24 |
24 #include "llvm/ADT/SmallBitVector.h" | 25 #include "llvm/ADT/SmallBitVector.h" |
25 | 26 |
26 namespace Ice { | 27 namespace Ice { |
27 | 28 |
28 // Class encapsulating ARM cpu features / instruction set. | 29 // Class encapsulating ARM cpu features / instruction set. |
(...skipping 19 matching lines...) Expand all Loading... |
48 ARM32InstructionSet InstructionSet = ARM32InstructionSet::Begin; | 49 ARM32InstructionSet InstructionSet = ARM32InstructionSet::Begin; |
49 }; | 50 }; |
50 | 51 |
51 // The target lowering logic for ARM32. | 52 // The target lowering logic for ARM32. |
52 class TargetARM32 : public TargetLowering { | 53 class TargetARM32 : public TargetLowering { |
53 TargetARM32() = delete; | 54 TargetARM32() = delete; |
54 TargetARM32(const TargetARM32 &) = delete; | 55 TargetARM32(const TargetARM32 &) = delete; |
55 TargetARM32 &operator=(const TargetARM32 &) = delete; | 56 TargetARM32 &operator=(const TargetARM32 &) = delete; |
56 | 57 |
57 public: | 58 public: |
| 59 ~TargetARM32() = default; |
| 60 |
58 static void staticInit(); | 61 static void staticInit(); |
59 // TODO(jvoung): return a unique_ptr. | 62 // TODO(jvoung): return a unique_ptr. |
60 static TargetARM32 *create(Cfg *Func) { return new TargetARM32(Func); } | 63 static std::unique_ptr<::Ice::TargetLowering> create(Cfg *Func) { |
| 64 return makeUnique<TargetARM32>(Func); |
| 65 } |
| 66 |
| 67 std::unique_ptr<::Ice::Assembler> createAssembler() const override { |
| 68 return makeUnique<ARM32::AssemblerARM32>(); |
| 69 } |
61 | 70 |
62 void initNodeForLowering(CfgNode *Node) override { | 71 void initNodeForLowering(CfgNode *Node) override { |
63 Computations.forgetProducers(); | 72 Computations.forgetProducers(); |
64 Computations.recordProducers(Node); | 73 Computations.recordProducers(Node); |
65 Computations.dump(Func); | 74 Computations.dump(Func); |
66 } | 75 } |
67 | 76 |
68 void translateOm1() override; | 77 void translateOm1() override; |
69 void translateO2() override; | 78 void translateO2() override; |
70 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; | 79 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 CfgVector<SizeT> I64Args; | 1059 CfgVector<SizeT> I64Args; |
1051 | 1060 |
1052 void discardUnavailableVFPRegs(CfgVector<SizeT> *Regs); | 1061 void discardUnavailableVFPRegs(CfgVector<SizeT> *Regs); |
1053 llvm::SmallBitVector VFPRegsUsed; | 1062 llvm::SmallBitVector VFPRegsUsed; |
1054 CfgVector<SizeT> FP32Args; | 1063 CfgVector<SizeT> FP32Args; |
1055 CfgVector<SizeT> FP64Args; | 1064 CfgVector<SizeT> FP64Args; |
1056 CfgVector<SizeT> Vec128Args; | 1065 CfgVector<SizeT> Vec128Args; |
1057 }; | 1066 }; |
1058 | 1067 |
1059 private: | 1068 private: |
1060 ~TargetARM32() override = default; | 1069 ENABLE_MAKE_UNIQUE; |
1061 | 1070 |
1062 OperandARM32Mem *formAddressingMode(Type Ty, Cfg *Func, const Inst *LdSt, | 1071 OperandARM32Mem *formAddressingMode(Type Ty, Cfg *Func, const Inst *LdSt, |
1063 Operand *Base); | 1072 Operand *Base); |
1064 | 1073 |
1065 void postambleCtpop64(const InstCall *Instr); | 1074 void postambleCtpop64(const InstCall *Instr); |
1066 void preambleDivRem(const InstCall *Instr); | 1075 void preambleDivRem(const InstCall *Instr); |
1067 std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Inst)> | 1076 std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Inst)> |
1068 ARM32HelpersPreamble; | 1077 ARM32HelpersPreamble; |
1069 std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Inst)> | 1078 std::unordered_map<Operand *, void (TargetARM32::*)(const InstCall *Inst)> |
1070 ARM32HelpersPostamble; | 1079 ARM32HelpersPostamble; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 | 1202 |
1194 private: | 1203 private: |
1195 ~TargetHeaderARM32() = default; | 1204 ~TargetHeaderARM32() = default; |
1196 | 1205 |
1197 TargetARM32Features CPUFeatures; | 1206 TargetARM32Features CPUFeatures; |
1198 }; | 1207 }; |
1199 | 1208 |
1200 } // end of namespace Ice | 1209 } // end of namespace Ice |
1201 | 1210 |
1202 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 1211 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
OLD | NEW |