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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 396993009: Lower stacksave and restore intrinsics. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: line em up Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 45c31514e0eff1b61f8f5a97e3a96ca09307f93a..c9d9f239c89165ea79225a34ad4e2be7d2ca0972 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -2191,7 +2191,7 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
}
case Intrinsics::Memset: {
// The value operand needs to be extended to a stack slot size
- // because we "push" only works for a specific operand size.
+ // because "push" only works for a specific operand size.
Operand *ValOp = Instr->getArg(1);
assert(ValOp->getType() == IceType_i8);
Variable *ValExt = makeReg(stackSlotType());
@@ -2227,11 +2227,17 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
_mov(Dest, T);
return;
}
- case Intrinsics::Stacksave:
- case Intrinsics::Stackrestore:
- // TODO(jvoung): fill it in.
- Func->setError("Unhandled intrinsic");
+ case Intrinsics::Stacksave: {
+ Variable *esp = Func->getTarget()->getPhysicalRegister(Reg_esp);
+ Variable *Dest = Instr->getDest();
+ _mov(Dest, esp);
return;
+ }
+ case Intrinsics::Stackrestore: {
+ Variable *esp = Func->getTarget()->getPhysicalRegister(Reg_esp);
+ _mov(esp, Instr->getArg(0));
+ return;
+ }
case Intrinsics::Trap:
_ud2();
return;

Powered by Google App Engine
This is Rietveld 408576698