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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 504073003: Revert "COmmit" (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 3 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 | « src/IceClFlags.h ('k') | src/llvm2ice.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/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
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 implements the TargetLoweringX8632 class, which 10 // This file implements the TargetLoweringX8632 class, which
11 // consists almost entirely of the lowering sequence for each 11 // consists almost entirely of the lowering sequence for each
12 // high-level instruction. It also implements 12 // high-level instruction. It also implements
13 // TargetX8632Fast::postLower() which does the simplest possible 13 // TargetX8632Fast::postLower() which does the simplest possible
14 // register allocation for the "fast" target. 14 // register allocation for the "fast" target.
15 // 15 //
16 //===----------------------------------------------------------------------===// 16 //===----------------------------------------------------------------------===//
17 17
18 #include "IceDefs.h" 18 #include "IceDefs.h"
19 #include "IceCfg.h" 19 #include "IceCfg.h"
20 #include "IceCfgNode.h" 20 #include "IceCfgNode.h"
21 #include "IceClFlags.h"
22 #include "IceInstX8632.h" 21 #include "IceInstX8632.h"
23 #include "IceOperand.h" 22 #include "IceOperand.h"
24 #include "IceTargetLoweringX8632.def" 23 #include "IceTargetLoweringX8632.def"
25 #include "IceTargetLoweringX8632.h" 24 #include "IceTargetLoweringX8632.h"
26 #include "llvm/ADT/DenseMap.h" 25 #include "llvm/ADT/DenseMap.h"
27 #include "llvm/Support/CommandLine.h" 26 #include "llvm/Support/CommandLine.h"
28 27
29 #include <strings.h> 28 #include <strings.h>
30 29
31 namespace Ice { 30 namespace Ice {
(...skipping 3014 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 Variable *ValExt = Func->makeVariable(stackSlotType(), Context.getNode()); 3045 Variable *ValExt = Func->makeVariable(stackSlotType(), Context.getNode());
3047 lowerCast(InstCast::create(Func, InstCast::Zext, ValExt, ValOp)); 3046 lowerCast(InstCast::create(Func, InstCast::Zext, ValExt, ValOp));
3048 InstCall *Call = makeHelperCall("memset", NULL, 3); 3047 InstCall *Call = makeHelperCall("memset", NULL, 3);
3049 Call->addArg(Instr->getArg(0)); 3048 Call->addArg(Instr->getArg(0));
3050 Call->addArg(ValExt); 3049 Call->addArg(ValExt);
3051 Call->addArg(Instr->getArg(2)); 3050 Call->addArg(Instr->getArg(2));
3052 lowerCall(Call); 3051 lowerCall(Call);
3053 return; 3052 return;
3054 } 3053 }
3055 case Intrinsics::NaClReadTP: { 3054 case Intrinsics::NaClReadTP: {
3056 if (Ctx->getFlags().UseSandboxing) { 3055 Constant *Zero = Ctx->getConstantZero(IceType_i32);
3057 Constant *Zero = Ctx->getConstantZero(IceType_i32); 3056 Operand *Src = OperandX8632Mem::create(Func, IceType_i32, NULL, Zero, NULL,
3058 Operand *Src = 3057 0, OperandX8632Mem::SegReg_GS);
3059 OperandX8632Mem::create(Func, IceType_i32, NULL, Zero, NULL, 3058 Variable *Dest = Instr->getDest();
3060 0, OperandX8632Mem::SegReg_GS); 3059 Variable *T = NULL;
3061 Variable *Dest = Instr->getDest(); 3060 _mov(T, Src);
3062 Variable *T = NULL; 3061 _mov(Dest, T);
3063 _mov(T, Src);
3064 _mov(Dest, T);
3065 } else {
3066 InstCall *Call = makeHelperCall("__nacl_read_tp", Instr->getDest(), 0);
3067 lowerCall(Call);
3068 }
3069 return; 3062 return;
3070 } 3063 }
3071 case Intrinsics::Setjmp: { 3064 case Intrinsics::Setjmp: {
3072 InstCall *Call = makeHelperCall("setjmp", Instr->getDest(), 1); 3065 InstCall *Call = makeHelperCall("setjmp", Instr->getDest(), 1);
3073 Call->addArg(Instr->getArg(0)); 3066 Call->addArg(Instr->getArg(0));
3074 lowerCall(Call); 3067 lowerCall(Call);
3075 return; 3068 return;
3076 } 3069 }
3077 case Intrinsics::Sqrt: { 3070 case Intrinsics::Sqrt: {
3078 Operand *Src = legalize(Instr->getArg(0)); 3071 Operand *Src = legalize(Instr->getArg(0));
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
4383 Str << "\t.align\t" << Align << "\n"; 4376 Str << "\t.align\t" << Align << "\n";
4384 Str << MangledName << ":\n"; 4377 Str << MangledName << ":\n";
4385 for (SizeT i = 0; i < Size; ++i) { 4378 for (SizeT i = 0; i < Size; ++i) {
4386 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; 4379 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
4387 } 4380 }
4388 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; 4381 Str << "\t.size\t" << MangledName << ", " << Size << "\n";
4389 } 4382 }
4390 } 4383 }
4391 4384
4392 } // end of namespace Ice 4385 } // end of namespace Ice
OLDNEW
« 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