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

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: Improve wording of a comment and reorder function in crosstest 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/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 Cdq, 148 Cdq,
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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 virtual void dump(const Cfg *Func) const; 991 virtual void dump(const Cfg *Func) const;
970 static bool classof(const Inst *Inst) { return isClassof(Inst, Movp); } 992 static bool classof(const Inst *Inst) { return isClassof(Inst, Movp); }
971 993
972 private: 994 private:
973 InstX8632Movp(Cfg *Func, Variable *Dest, Operand *Source); 995 InstX8632Movp(Cfg *Func, Variable *Dest, Operand *Source);
974 InstX8632Movp(const InstX8632Movp &) LLVM_DELETED_FUNCTION; 996 InstX8632Movp(const InstX8632Movp &) LLVM_DELETED_FUNCTION;
975 InstX8632Movp &operator=(const InstX8632Movp &) LLVM_DELETED_FUNCTION; 997 InstX8632Movp &operator=(const InstX8632Movp &) LLVM_DELETED_FUNCTION;
976 virtual ~InstX8632Movp() {} 998 virtual ~InstX8632Movp() {}
977 }; 999 };
978 1000
1001 class InstX8632StoreP : public InstX8632 {
1002 public:
1003 static InstX8632StoreP *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
1004 return new (Func->allocate<InstX8632StoreP>())
1005 InstX8632StoreP(Func, Value, Mem);
1006 }
1007 virtual void emit(const Cfg *Func) const;
1008 virtual void dump(const Cfg *Func) const;
1009 static bool classof(const Inst *Inst) { return isClassof(Inst, StoreP); }
1010
1011 private:
1012 InstX8632StoreP(Cfg *Func, Operand *Value, OperandX8632 *Mem);
1013 InstX8632StoreP(const InstX8632StoreP &) LLVM_DELETED_FUNCTION;
1014 InstX8632StoreP &operator=(const InstX8632StoreP &) LLVM_DELETED_FUNCTION;
1015 virtual ~InstX8632StoreP() {}
1016 };
1017
979 // This is essentially a "movq" instruction with an OperandX8632Mem 1018 // This is essentially a "movq" instruction with an OperandX8632Mem
980 // operand instead of Variable as the destination. It's important 1019 // operand instead of Variable as the destination. It's important
981 // for liveness that there is no Dest operand. 1020 // for liveness that there is no Dest operand.
982 class InstX8632StoreQ : public InstX8632 { 1021 class InstX8632StoreQ : public InstX8632 {
983 public: 1022 public:
984 static InstX8632StoreQ *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { 1023 static InstX8632StoreQ *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
985 return new (Func->allocate<InstX8632StoreQ>()) 1024 return new (Func->allocate<InstX8632StoreQ>())
986 InstX8632StoreQ(Func, Value, Mem); 1025 InstX8632StoreQ(Func, Value, Mem);
987 } 1026 }
988 virtual void emit(const Cfg *Func) const; 1027 virtual void emit(const Cfg *Func) const;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const; 1250 template <> void InstX8632Pmuludq::emit(const Cfg *Func) const;
1212 template <> void InstX8632Psll::emit(const Cfg *Func) const; 1251 template <> void InstX8632Psll::emit(const Cfg *Func) const;
1213 template <> void InstX8632Psra::emit(const Cfg *Func) const; 1252 template <> void InstX8632Psra::emit(const Cfg *Func) const;
1214 template <> void InstX8632Psub::emit(const Cfg *Func) const; 1253 template <> void InstX8632Psub::emit(const Cfg *Func) const;
1215 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const; 1254 template <> void InstX8632Sqrtss::emit(const Cfg *Func) const;
1216 template <> void InstX8632Subss::emit(const Cfg *Func) const; 1255 template <> void InstX8632Subss::emit(const Cfg *Func) const;
1217 1256
1218 } // end of namespace Ice 1257 } // end of namespace Ice
1219 1258
1220 #endif // SUBZERO_SRC_ICEINSTX8632_H 1259 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698