| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// | 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 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 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return UsesFramePointer ? RegMIPS32::Reg_FP : RegMIPS32::Reg_SP; | 49 return UsesFramePointer ? RegMIPS32::Reg_FP : RegMIPS32::Reg_SP; |
| 50 } | 50 } |
| 51 size_t typeWidthInBytesOnStack(Type Ty) const override { | 51 size_t typeWidthInBytesOnStack(Type Ty) const override { |
| 52 // Round up to the next multiple of 4 bytes. In particular, i1, | 52 // Round up to the next multiple of 4 bytes. In particular, i1, |
| 53 // i8, and i16 are rounded up to 4 bytes. | 53 // i8, and i16 are rounded up to 4 bytes. |
| 54 return (typeWidthInBytes(Ty) + 3) & ~3; | 54 return (typeWidthInBytes(Ty) + 3) & ~3; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // TODO(ascull): what is the best size of MIPS? | 57 // TODO(ascull): what is the best size of MIPS? |
| 58 SizeT getMinJumpTableSize() const override { return 3; } | 58 SizeT getMinJumpTableSize() const override { return 3; } |
| 59 void emitJumpTable(const Cfg *Func, |
| 60 const InstJumpTable *JumpTable) const override; |
| 59 | 61 |
| 60 void emitVariable(const Variable *Var) const override; | 62 void emitVariable(const Variable *Var) const override; |
| 61 | 63 |
| 62 const char *getConstantPrefix() const final { return ""; } | 64 const char *getConstantPrefix() const final { return ""; } |
| 63 void emit(const ConstantUndef *C) const final { | 65 void emit(const ConstantUndef *C) const final { |
| 64 (void)C; | 66 (void)C; |
| 65 llvm::report_fatal_error("Not yet implemented"); | 67 llvm::report_fatal_error("Not yet implemented"); |
| 66 } | 68 } |
| 67 void emit(const ConstantInteger32 *C) const final { | 69 void emit(const ConstantInteger32 *C) const final { |
| 68 (void)C; | 70 (void)C; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete; | 140 TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete; |
| 139 | 141 |
| 140 public: | 142 public: |
| 141 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) { | 143 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) { |
| 142 return std::unique_ptr<TargetDataLowering>(new TargetDataMIPS32(Ctx)); | 144 return std::unique_ptr<TargetDataLowering>(new TargetDataMIPS32(Ctx)); |
| 143 } | 145 } |
| 144 | 146 |
| 145 void lowerGlobals(const VariableDeclarationList &Vars, | 147 void lowerGlobals(const VariableDeclarationList &Vars, |
| 146 const IceString &SectionSuffix) override; | 148 const IceString &SectionSuffix) override; |
| 147 void lowerConstants() override; | 149 void lowerConstants() override; |
| 150 void lowerJumpTables() override; |
| 148 | 151 |
| 149 protected: | 152 protected: |
| 150 explicit TargetDataMIPS32(GlobalContext *Ctx); | 153 explicit TargetDataMIPS32(GlobalContext *Ctx); |
| 151 | 154 |
| 152 private: | 155 private: |
| 153 ~TargetDataMIPS32() override = default; | 156 ~TargetDataMIPS32() override = default; |
| 154 template <typename T> static void emitConstantPool(GlobalContext *Ctx); | 157 template <typename T> static void emitConstantPool(GlobalContext *Ctx); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 class TargetHeaderMIPS32 final : public TargetHeaderLowering { | 160 class TargetHeaderMIPS32 final : public TargetHeaderLowering { |
| 158 TargetHeaderMIPS32() = delete; | 161 TargetHeaderMIPS32() = delete; |
| 159 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete; | 162 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete; |
| 160 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete; | 163 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete; |
| 161 | 164 |
| 162 public: | 165 public: |
| 163 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) { | 166 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) { |
| 164 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx)); | 167 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx)); |
| 165 } | 168 } |
| 166 | 169 |
| 167 protected: | 170 protected: |
| 168 explicit TargetHeaderMIPS32(GlobalContext *Ctx); | 171 explicit TargetHeaderMIPS32(GlobalContext *Ctx); |
| 169 | 172 |
| 170 private: | 173 private: |
| 171 ~TargetHeaderMIPS32() = default; | 174 ~TargetHeaderMIPS32() = default; |
| 172 }; | 175 }; |
| 173 | 176 |
| 174 } // end of namespace Ice | 177 } // end of namespace Ice |
| 175 | 178 |
| 176 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H | 179 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H |
| OLD | NEW |