Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: src/IceTargetLoweringMIPS32.h

Issue 1257283004: Iasm and obj lowering for advanced switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete; 142 TargetDataMIPS32 &operator=(const TargetDataMIPS32 &) = delete;
141 143
142 public: 144 public:
143 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) { 145 static std::unique_ptr<TargetDataLowering> create(GlobalContext *Ctx) {
144 return std::unique_ptr<TargetDataLowering>(new TargetDataMIPS32(Ctx)); 146 return std::unique_ptr<TargetDataLowering>(new TargetDataMIPS32(Ctx));
145 } 147 }
146 148
147 void lowerGlobals(const VariableDeclarationList &Vars, 149 void lowerGlobals(const VariableDeclarationList &Vars,
148 const IceString &SectionSuffix) override; 150 const IceString &SectionSuffix) override;
149 void lowerConstants() override; 151 void lowerConstants() override;
152 void lowerJumpTables() override;
150 153
151 protected: 154 protected:
152 explicit TargetDataMIPS32(GlobalContext *Ctx); 155 explicit TargetDataMIPS32(GlobalContext *Ctx);
153 156
154 private: 157 private:
155 ~TargetDataMIPS32() override = default; 158 ~TargetDataMIPS32() override = default;
156 template <typename T> static void emitConstantPool(GlobalContext *Ctx); 159 template <typename T> static void emitConstantPool(GlobalContext *Ctx);
157 }; 160 };
158 161
159 class TargetHeaderMIPS32 final : public TargetHeaderLowering { 162 class TargetHeaderMIPS32 final : public TargetHeaderLowering {
160 TargetHeaderMIPS32() = delete; 163 TargetHeaderMIPS32() = delete;
161 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete; 164 TargetHeaderMIPS32(const TargetHeaderMIPS32 &) = delete;
162 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete; 165 TargetHeaderMIPS32 &operator=(const TargetHeaderMIPS32 &) = delete;
163 166
164 public: 167 public:
165 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) { 168 static std::unique_ptr<TargetHeaderLowering> create(GlobalContext *Ctx) {
166 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx)); 169 return std::unique_ptr<TargetHeaderLowering>(new TargetHeaderMIPS32(Ctx));
167 } 170 }
168 171
169 protected: 172 protected:
170 explicit TargetHeaderMIPS32(GlobalContext *Ctx); 173 explicit TargetHeaderMIPS32(GlobalContext *Ctx);
171 174
172 private: 175 private:
173 ~TargetHeaderMIPS32() = default; 176 ~TargetHeaderMIPS32() = default;
174 }; 177 };
175 178
176 } // end of namespace Ice 179 } // end of namespace Ice
177 180
178 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 181 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698