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

Side by Side Diff: src/IceTargetLoweringX8632.h

Issue 465413003: Subzero: Align spill locations to natural alignment. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Comments, round 1 Created 6 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/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
(...skipping 22 matching lines...) Expand all
33 virtual IceString getRegName(SizeT RegNum, Type Ty) const; 33 virtual IceString getRegName(SizeT RegNum, Type Ty) const;
34 virtual llvm::SmallBitVector getRegisterSet(RegSetMask Include, 34 virtual llvm::SmallBitVector getRegisterSet(RegSetMask Include,
35 RegSetMask Exclude) const; 35 RegSetMask Exclude) const;
36 virtual const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const { 36 virtual const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const {
37 return TypeToRegisterSet[Ty]; 37 return TypeToRegisterSet[Ty];
38 } 38 }
39 virtual bool hasFramePointer() const { return IsEbpBasedFrame; } 39 virtual bool hasFramePointer() const { return IsEbpBasedFrame; }
40 virtual SizeT getFrameOrStackReg() const { 40 virtual SizeT getFrameOrStackReg() const {
41 return IsEbpBasedFrame ? Reg_ebp : Reg_esp; 41 return IsEbpBasedFrame ? Reg_ebp : Reg_esp;
42 } 42 }
43 virtual size_t typeWidthInBytesOnStack(Type Ty) { 43 virtual size_t typeWidthInBytesOnStack(Type Ty) const {
44 // Round up to the next multiple of 4 bytes. In particular, i1, 44 // Round up to the next multiple of 4 bytes. In particular, i1,
45 // i8, and i16 are rounded up to 4 bytes. 45 // i8, and i16 are rounded up to 4 bytes.
46 return (typeWidthInBytes(Ty) + 3) & ~3; 46 return (typeWidthInBytes(Ty) + 3) & ~3;
47 } 47 }
48 virtual void emitVariable(const Variable *Var, const Cfg *Func) const; 48 virtual void emitVariable(const Variable *Var, const Cfg *Func) const;
49 virtual void lowerArguments(); 49 virtual void lowerArguments();
50 virtual void addProlog(CfgNode *Node); 50 virtual void addProlog(CfgNode *Node);
51 virtual void addEpilog(CfgNode *Node); 51 virtual void addEpilog(CfgNode *Node);
52 virtual void emitConstants() const; 52 virtual void emitConstants() const;
53 SizeT makeNextLabelNumber() { return NextLabelNumber++; } 53 SizeT makeNextLabelNumber() { return NextLabelNumber++; }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *); 119 typedef void (TargetX8632::*LowerBinOp)(Variable *, Operand *);
120 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, 120 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi,
121 Variable *Dest, Operand *Ptr, Operand *Val); 121 Variable *Dest, Operand *Ptr, Operand *Val);
122 122
123 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); 123 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult);
124 124
125 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, 125 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest,
126 Operand *Src0, Operand *Src1); 126 Operand *Src0, Operand *Src1);
127 127
128 void sortByAlignment(VarList &Dest, const VarList &Source) const;
129
128 // Operand legalization helpers. To deal with address mode 130 // Operand legalization helpers. To deal with address mode
129 // constraints, the helpers will create a new Operand and emit 131 // constraints, the helpers will create a new Operand and emit
130 // instructions that guarantee that the Operand kind is one of those 132 // instructions that guarantee that the Operand kind is one of those
131 // indicated by the LegalMask (a bitmask of allowed kinds). If the 133 // indicated by the LegalMask (a bitmask of allowed kinds). If the
132 // input Operand is known to already meet the constraints, it may be 134 // input Operand is known to already meet the constraints, it may be
133 // simply returned as the result, without creating any new 135 // simply returned as the result, without creating any new
134 // instructions or operands. 136 // instructions or operands.
135 enum OperandLegalization { 137 enum OperandLegalization {
136 Legal_None = 0, 138 Legal_None = 0,
137 Legal_Reg = 1 << 0, // physical register, not stack location 139 Legal_Reg = 1 << 0, // physical register, not stack location
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 virtual ~TargetGlobalInitX8632() {} 495 virtual ~TargetGlobalInitX8632() {}
494 }; 496 };
495 497
496 template <> void ConstantInteger::emit(GlobalContext *Ctx) const; 498 template <> void ConstantInteger::emit(GlobalContext *Ctx) const;
497 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; 499 template <> void ConstantFloat::emit(GlobalContext *Ctx) const;
498 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; 500 template <> void ConstantDouble::emit(GlobalContext *Ctx) const;
499 501
500 } // end of namespace Ice 502 } // end of namespace Ice
501 503
502 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H 504 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698