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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 504963002: Subzero: Fixes for Hello World and bisection debugging. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix lit test prefix names. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceClFlags.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 0423e3929c389649fb563dc97f828d5f4ed1468b..930836b0dad99613584fee79c795ced34c745d1a 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -18,6 +18,7 @@
#include "IceDefs.h"
#include "IceCfg.h"
#include "IceCfgNode.h"
+#include "IceClFlags.h"
#include "IceInstX8632.h"
#include "IceOperand.h"
#include "IceTargetLoweringX8632.def"
@@ -3052,13 +3053,19 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
return;
}
case Intrinsics::NaClReadTP: {
- Constant *Zero = Ctx->getConstantZero(IceType_i32);
- Operand *Src = OperandX8632Mem::create(Func, IceType_i32, NULL, Zero, NULL,
- 0, OperandX8632Mem::SegReg_GS);
- Variable *Dest = Instr->getDest();
- Variable *T = NULL;
- _mov(T, Src);
- _mov(Dest, T);
+ if (Ctx->getFlags().UseSandboxing) {
+ Constant *Zero = Ctx->getConstantZero(IceType_i32);
+ Operand *Src =
+ OperandX8632Mem::create(Func, IceType_i32, NULL, Zero, NULL,
+ 0, OperandX8632Mem::SegReg_GS);
+ Variable *Dest = Instr->getDest();
+ Variable *T = NULL;
+ _mov(T, Src);
+ _mov(Dest, T);
+ } else {
+ InstCall *Call = makeHelperCall("__nacl_read_tp", Instr->getDest(), 0);
+ lowerCall(Call);
+ }
return;
}
case Intrinsics::Setjmp: {
« no previous file with comments | « src/IceClFlags.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698