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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1592033002: Merge lowerCall and lowerRet between x86 and x64 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review comments Created 4 years, 11 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/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 explicit TargetX86Base(Cfg *Func); 191 explicit TargetX86Base(Cfg *Func);
192 192
193 void postLower() override; 193 void postLower() override;
194 194
195 void initSandbox() { 195 void initSandbox() {
196 dispatchToConcrete(&Traits::ConcreteTarget::initSandbox); 196 dispatchToConcrete(&Traits::ConcreteTarget::initSandbox);
197 } 197 }
198 198
199 void lowerAlloca(const InstAlloca *Inst) override; 199 void lowerAlloca(const InstAlloca *Inst) override;
200 void lowerArguments() override;
200 void lowerArithmetic(const InstArithmetic *Inst) override; 201 void lowerArithmetic(const InstArithmetic *Inst) override;
201 void lowerAssign(const InstAssign *Inst) override; 202 void lowerAssign(const InstAssign *Inst) override;
202 void lowerBr(const InstBr *Inst) override; 203 void lowerBr(const InstBr *Inst) override;
204 void lowerCall(const InstCall *Inst) override;
203 void lowerCast(const InstCast *Inst) override; 205 void lowerCast(const InstCast *Inst) override;
204 void lowerExtractElement(const InstExtractElement *Inst) override; 206 void lowerExtractElement(const InstExtractElement *Inst) override;
205 void lowerFcmp(const InstFcmp *Inst) override; 207 void lowerFcmp(const InstFcmp *Inst) override;
206 void lowerIcmp(const InstIcmp *Inst) override; 208 void lowerIcmp(const InstIcmp *Inst) override;
207 209
208 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; 210 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override;
209 void lowerInsertElement(const InstInsertElement *Inst) override; 211 void lowerInsertElement(const InstInsertElement *Inst) override;
210 void lowerLoad(const InstLoad *Inst) override; 212 void lowerLoad(const InstLoad *Inst) override;
211 void lowerPhi(const InstPhi *Inst) override; 213 void lowerPhi(const InstPhi *Inst) override;
214 void lowerRet(const InstRet *Inst) override;
212 void lowerSelect(const InstSelect *Inst) override; 215 void lowerSelect(const InstSelect *Inst) override;
213 void lowerStore(const InstStore *Inst) override; 216 void lowerStore(const InstStore *Inst) override;
214 void lowerSwitch(const InstSwitch *Inst) override; 217 void lowerSwitch(const InstSwitch *Inst) override;
215 void lowerUnreachable(const InstUnreachable *Inst) override; 218 void lowerUnreachable(const InstUnreachable *Inst) override;
216 void lowerOther(const Inst *Instr) override; 219 void lowerOther(const Inst *Instr) override;
217 void lowerRMW(const InstX86FakeRMW *RMW); 220 void lowerRMW(const InstX86FakeRMW *RMW);
218 void prelowerPhis() override; 221 void prelowerPhis() override;
219 uint32_t getCallStackArgumentsSizeBytes(const std::vector<Type> &ArgTypes, 222 uint32_t getCallStackArgumentsSizeBytes(const std::vector<Type> &ArgTypes,
220 Type ReturnType); 223 Type ReturnType);
221 uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override; 224 uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) override;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 275
273 using LowerBinOp = void (TargetX86Base::*)(Variable *, Operand *); 276 using LowerBinOp = void (TargetX86Base::*)(Variable *, Operand *);
274 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, 277 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi,
275 Variable *Dest, Operand *Ptr, Operand *Val); 278 Variable *Dest, Operand *Ptr, Operand *Val);
276 279
277 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); 280 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult);
278 281
279 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, 282 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest,
280 Operand *Src0, Operand *Src1); 283 Operand *Src0, Operand *Src1);
281 284
285 /// Emit just the call instruction (without argument or return variable
286 /// processing), sandboxing if needed.
287 virtual Inst *emitCallToTarget(Operand *CallTarget, Variable *ReturnReg) = 0;
288 /// Materialize the moves needed to return a value of the specified type.
289 virtual Variable *moveReturnValueToRegister(Operand *Value,
290 Type ReturnType) = 0;
291
282 /// Emit a fake use of esp to make sure esp stays alive for the entire 292 /// Emit a fake use of esp to make sure esp stays alive for the entire
283 /// function. Otherwise some esp adjustments get dead-code eliminated. 293 /// function. Otherwise some esp adjustments get dead-code eliminated.
284 void keepEspLiveAtExit() { 294 void keepEspLiveAtExit() {
285 Variable *esp = 295 Variable *esp =
286 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType); 296 Func->getTarget()->getPhysicalRegister(getStackReg(), Traits::WordType);
287 Context.insert<InstFakeUse>(esp); 297 Context.insert<InstFakeUse>(esp);
288 } 298 }
289 299
290 /// Operand legalization helpers. To deal with address mode constraints, the 300 /// Operand legalization helpers. To deal with address mode constraints, the
291 /// helpers will create a new Operand and emit instructions that guarantee 301 /// helpers will create a new Operand and emit instructions that guarantee
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 1005
996 static FixupKind PcRelFixup; 1006 static FixupKind PcRelFixup;
997 static FixupKind AbsFixup; 1007 static FixupKind AbsFixup;
998 }; 1008 };
999 } // end of namespace X86NAMESPACE 1009 } // end of namespace X86NAMESPACE
1000 } // end of namespace Ice 1010 } // end of namespace Ice
1001 1011
1002 #include "IceTargetLoweringX86BaseImpl.h" 1012 #include "IceTargetLoweringX86BaseImpl.h"
1003 1013
1004 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 1014 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698