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

Side by Side Diff: src/IceTargetLoweringMIPS32.h

Issue 1435363002: Merge fixed alloca stack adjustments into the prolog (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Final code review comments Created 5 years, 1 month 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
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 RegClass RC = Var->getRegClass(); 47 RegClass RC = Var->getRegClass();
48 assert(RC < RC_Target); 48 assert(RC < RC_Target);
49 return TypeToRegisterSet[RC]; 49 return TypeToRegisterSet[RC];
50 } 50 }
51 const llvm::SmallBitVector &getAliasesForRegister(SizeT Reg) const override { 51 const llvm::SmallBitVector &getAliasesForRegister(SizeT Reg) const override {
52 return RegisterAliases[Reg]; 52 return RegisterAliases[Reg];
53 } 53 }
54 bool hasFramePointer() const override { return UsesFramePointer; } 54 bool hasFramePointer() const override { return UsesFramePointer; }
55 void setHasFramePointer() override { UsesFramePointer = true; } 55 void setHasFramePointer() override { UsesFramePointer = true; }
56 SizeT getStackReg() const override { return RegMIPS32::Reg_SP; } 56 SizeT getStackReg() const override { return RegMIPS32::Reg_SP; }
57 SizeT getFrameReg() const override { return RegMIPS32::Reg_FP; }
57 SizeT getFrameOrStackReg() const override { 58 SizeT getFrameOrStackReg() const override {
58 return UsesFramePointer ? RegMIPS32::Reg_FP : RegMIPS32::Reg_SP; 59 return UsesFramePointer ? getFrameReg() : getStackReg();
59 } 60 }
60 size_t typeWidthInBytesOnStack(Type Ty) const override { 61 size_t typeWidthInBytesOnStack(Type Ty) const override {
61 // Round up to the next multiple of 4 bytes. In particular, i1, i8, and i16 62 // Round up to the next multiple of 4 bytes. In particular, i1, i8, and i16
62 // are rounded up to 4 bytes. 63 // are rounded up to 4 bytes.
63 return (typeWidthInBytes(Ty) + 3) & ~3; 64 return (typeWidthInBytes(Ty) + 3) & ~3;
64 } 65 }
65 uint32_t getStackAlignment() const override { 66 uint32_t getStackAlignment() const override {
66 // TODO(sehr): what is the stack alignment? 67 // TODO(sehr): what is the stack alignment?
67 return 1; 68 return 1;
68 } 69 }
70 void reserveFixedAllocaArea(size_t Size, size_t Align) override {
71 // TODO(sehr): Implement fixed stack layout.
72 (void)Size;
73 (void)Align;
74 llvm::report_fatal_error("Not yet implemented");
75 }
76 int32_t getFrameFixedAllocaOffset() const override {
77 // TODO(sehr): Implement fixed stack layout.
78 llvm::report_fatal_error("Not yet implemented");
79 return 0;
80 }
69 81
70 bool shouldSplitToVariable64On32(Type Ty) const override { 82 bool shouldSplitToVariable64On32(Type Ty) const override {
71 return Ty == IceType_i64; 83 return Ty == IceType_i64;
72 } 84 }
73 85
74 // TODO(ascull): what is the best size of MIPS? 86 // TODO(ascull): what is the best size of MIPS?
75 SizeT getMinJumpTableSize() const override { return 3; } 87 SizeT getMinJumpTableSize() const override { return 3; }
76 void emitJumpTable(const Cfg *Func, 88 void emitJumpTable(const Cfg *Func,
77 const InstJumpTable *JumpTable) const override; 89 const InstJumpTable *JumpTable) const override;
78 90
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 protected: 294 protected:
283 explicit TargetHeaderMIPS32(GlobalContext *Ctx); 295 explicit TargetHeaderMIPS32(GlobalContext *Ctx);
284 296
285 private: 297 private:
286 ~TargetHeaderMIPS32() = default; 298 ~TargetHeaderMIPS32() = default;
287 }; 299 };
288 300
289 } // end of namespace Ice 301 } // end of namespace Ice
290 302
291 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 303 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698