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

Side by Side Diff: src/IceInstX8632.h

Issue 444443002: Subzero: Align the stack at the point of function calls. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Comments round 3 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
« no previous file with comments | « crosstest/test_calling_conv_main.cpp ('k') | src/IceInstX8632.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/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===// 1 //===- subzero/src/IceInstX8632.h - Low-level x86 instructions --*- 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 InstX8632 and OperandX8632 classes and 10 // This file declares the InstX8632 and OperandX8632 classes and
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 }; 130 };
131 131
132 class InstX8632 : public InstTarget { 132 class InstX8632 : public InstTarget {
133 public: 133 public:
134 enum InstKindX8632 { 134 enum InstKindX8632 {
135 k__Start = Inst::Target, 135 k__Start = Inst::Target,
136 Adc, 136 Adc,
137 Add, 137 Add,
138 Addps, 138 Addps,
139 Addss, 139 Addss,
140 Adjuststack,
140 And, 141 And,
141 Blendvps, 142 Blendvps,
142 Br, 143 Br,
143 Bsf, 144 Bsf,
144 Bsr, 145 Bsr,
145 Bswap, 146 Bswap,
146 Call, 147 Call,
147 Cbwdq, 148 Cbwdq,
148 Cmov, 149 Cmov,
149 Cmpps, 150 Cmpps,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 Rol, 198 Rol,
198 Sar, 199 Sar,
199 Sbb, 200 Sbb,
200 Shl, 201 Shl,
201 Shld, 202 Shld,
202 Shr, 203 Shr,
203 Shrd, 204 Shrd,
204 Shufps, 205 Shufps,
205 Sqrtss, 206 Sqrtss,
206 Store, 207 Store,
208 StoreP,
207 StoreQ, 209 StoreQ,
208 Sub, 210 Sub,
209 Subps, 211 Subps,
210 Subss, 212 Subss,
211 Test, 213 Test,
212 Ucomiss, 214 Ucomiss,
213 UD2, 215 UD2,
214 Xadd, 216 Xadd,
215 Xchg, 217 Xchg,
216 Xor 218 Xor
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 InstX8632Label *Label, BrCond Condition); 335 InstX8632Label *Label, BrCond Condition);
334 InstX8632Br(const InstX8632Br &) LLVM_DELETED_FUNCTION; 336 InstX8632Br(const InstX8632Br &) LLVM_DELETED_FUNCTION;
335 InstX8632Br &operator=(const InstX8632Br &) LLVM_DELETED_FUNCTION; 337 InstX8632Br &operator=(const InstX8632Br &) LLVM_DELETED_FUNCTION;
336 virtual ~InstX8632Br() {} 338 virtual ~InstX8632Br() {}
337 BrCond Condition; 339 BrCond Condition;
338 CfgNode *TargetTrue; 340 CfgNode *TargetTrue;
339 CfgNode *TargetFalse; 341 CfgNode *TargetFalse;
340 InstX8632Label *Label; // Intra-block branch target 342 InstX8632Label *Label; // Intra-block branch target
341 }; 343 };
342 344
345 // AdjustStack instruction - subtracts esp by the given amount and
346 // updates the stack offset during code emission.
347 class InstX8632AdjustStack : public InstX8632 {
348 public:
349 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount) {
350 return new (Func->allocate<InstX8632AdjustStack>())
351 InstX8632AdjustStack(Func, Amount);
352 }
353 virtual void emit(const Cfg *Func) const;
354 virtual void dump(const Cfg *Func) const;
355 static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
356
357 private:
358 InstX8632AdjustStack(Cfg *Func, SizeT Amount);
359 InstX8632AdjustStack(const InstX8632AdjustStack &) LLVM_DELETED_FUNCTION;
360 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &)
361 LLVM_DELETED_FUNCTION;
362 SizeT Amount;
363 };
364
343 // Call instruction. Arguments should have already been pushed. 365 // Call instruction. Arguments should have already been pushed.
344 class InstX8632Call : public InstX8632 { 366 class InstX8632Call : public InstX8632 {
345 public: 367 public:
346 static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { 368 static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) {
347 return new (Func->allocate<InstX8632Call>()) 369 return new (Func->allocate<InstX8632Call>())
348 InstX8632Call(Func, Dest, CallTarget); 370 InstX8632Call(Func, Dest, CallTarget);
349 } 371 }
350 Operand *getCallTarget() const { return getSrc(0); } 372 Operand *getCallTarget() const { return getSrc(0); }
351 virtual void emit(const Cfg *Func) const; 373 virtual void emit(const Cfg *Func) const;
352 virtual void dump(const Cfg *Func) const; 374 virtual void dump(const Cfg *Func) const;
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 virtual void dump(const Cfg *Func) const; 975 virtual void dump(const Cfg *Func) const;
954 static bool classof(const Inst *Inst) { return isClassof(Inst, Movp); } 976 static bool classof(const Inst *Inst) { return isClassof(Inst, Movp); }
955 977
956 private: 978 private:
957 InstX8632Movp(Cfg *Func, Variable *Dest, Operand *Source); 979 InstX8632Movp(Cfg *Func, Variable *Dest, Operand *Source);
958 InstX8632Movp(const InstX8632Movp &) LLVM_DELETED_FUNCTION; 980 InstX8632Movp(const InstX8632Movp &) LLVM_DELETED_FUNCTION;
959 InstX8632Movp &operator=(const InstX8632Movp &) LLVM_DELETED_FUNCTION; 981 InstX8632Movp &operator=(const InstX8632Movp &) LLVM_DELETED_FUNCTION;
960 virtual ~InstX8632Movp() {} 982 virtual ~InstX8632Movp() {}
961 }; 983 };
962 984
985 class InstX8632StoreP : public InstX8632 {
986 public:
987 static InstX8632StoreP *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
988 return new (Func->allocate<InstX8632StoreP>())
989 InstX8632StoreP(Func, Value, Mem);
990 }
991 virtual void emit(const Cfg *Func) const;
992 virtual void dump(const Cfg *Func) const;
993 static bool classof(const Inst *Inst) { return isClassof(Inst, StoreP); }
994
995 private:
996 InstX8632StoreP(Cfg *Func, Operand *Value, OperandX8632 *Mem);
997 InstX8632StoreP(const InstX8632StoreP &) LLVM_DELETED_FUNCTION;
998 InstX8632StoreP &operator=(const InstX8632StoreP &) LLVM_DELETED_FUNCTION;
999 virtual ~InstX8632StoreP() {}
1000 };
1001
963 // This is essentially a "movq" instruction with an OperandX8632Mem 1002 // This is essentially a "movq" instruction with an OperandX8632Mem
964 // operand instead of Variable as the destination. It's important 1003 // operand instead of Variable as the destination. It's important
965 // for liveness that there is no Dest operand. 1004 // for liveness that there is no Dest operand.
966 class InstX8632StoreQ : public InstX8632 { 1005 class InstX8632StoreQ : public InstX8632 {
967 public: 1006 public:
968 static InstX8632StoreQ *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { 1007 static InstX8632StoreQ *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
969 return new (Func->allocate<InstX8632StoreQ>()) 1008 return new (Func->allocate<InstX8632StoreQ>())
970 InstX8632StoreQ(Func, Value, Mem); 1009 InstX8632StoreQ(Func, Value, Mem);
971 } 1010 }
972 virtual void emit(const Cfg *Func) const; 1011 virtual void emit(const Cfg *Func) const;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const; 1235 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const;
1197 template <> void InstX8632Psll::emit(const Cfg *Func) const; 1236 template <> void InstX8632Psll::emit(const Cfg *Func) const;
1198 template <> void InstX8632Psra::emit(const Cfg *Func) const; 1237 template <> void InstX8632Psra::emit(const Cfg *Func) const;
1199 template <> void InstX8632Psub::emit(const Cfg *Func) const; 1238 template <> void InstX8632Psub::emit(const Cfg *Func) const;
1200 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; 1239 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const;
1201 template <> void InstX8632Subss::emit(const Cfg *Func) const; 1240 template <> void InstX8632Subss::emit(const Cfg *Func) const;
1202 1241
1203 } // end of namespace Ice 1242 } // end of namespace Ice
1204 1243
1205 #endif // SUBZERO_SRC_ICEINSTX8632_H 1244 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « crosstest/test_calling_conv_main.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698