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

Unified Diff: src/IceTargetLoweringX8664.h

Issue 1257643004: Subzero. Buildable, non-functional TargetLoweringX8664. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes naming bug in IceInstX8632.h Created 5 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/IceTargetLoweringX8664.h
diff --git a/src/IceTargetLoweringX8664.h b/src/IceTargetLoweringX8664.h
index 791343ac482a442d6b206513d52e1f35d25ae066..d145b491176ecf059f4805303f0fa8cf0214fc4a 100644
--- a/src/IceTargetLoweringX8664.h
+++ b/src/IceTargetLoweringX8664.h
@@ -16,22 +16,50 @@
#ifndef SUBZERO_SRC_ICETARGETLOWERINGX8664_H
#define SUBZERO_SRC_ICETARGETLOWERINGX8664_H
+#include "IceAssemblerX8664.h"
#include "IceCfg.h"
#include "IceGlobalContext.h"
+#include "IceInstX8664.h"
#include "IceTargetLowering.h"
+#include "IceTargetLoweringX8664Traits.h"
+#include "IceTargetLoweringX86Base.h"
namespace Ice {
-class TargetX8664 : public TargetLowering {
+class TargetX8664 final
+ : public ::Ice::X86Internal::TargetX86Base<TargetX8664> {
TargetX8664() = delete;
TargetX8664(const TargetX8664 &) = delete;
TargetX8664 &operator=(const TargetX8664 &) = delete;
public:
- static TargetX8664 *create(Cfg *Func);
+ static TargetX8664 *create(Cfg *Func) { return new TargetX8664(Func); }
private:
- explicit TargetX8664(Cfg *Func) : TargetLowering(Func) {}
+ friend class ::Ice::X86Internal::TargetX86Base<TargetX8664>;
+
+ explicit TargetX8664(Cfg *Func)
+ : ::Ice::X86Internal::TargetX86Base<TargetX8664>(Func) {}
+
+ Operand *createNaClReadTPSrcOperand() {
+ Variable *TDB = callNaClReadTp();
+ Variable *RZP = materializeRZP();
+ Constant *TPOffset = Ctx->getConstantInt8(0x20);
jvoung (off chromium) 2015/07/30 21:16:22 Hmm this magic offset doesn't seem particularly fa
John 2015/07/31 21:05:54 I got confused with the comments in native_client
+ return Traits::X86OperandMem::create(Func, IceType_i32, RZP, TPOffset, TDB);
+ }
+
+ Variable *callNaClReadTp() {
+ Variable *TDB = makeReg(IceType_i32);
+ InstCall *Call = makeHelperCall(H_call_read_tp, TDB, 0);
+ lowerCall(Call);
+ return TDB;
+ }
+
+ Variable *materializeRZP() {
+ Variable *RZP = makeReg(IceType_i32, Traits::RegisterSet::Reg_r15d);
jvoung (off chromium) 2015/07/30 21:16:22 Should this use getPhysicalRegister() and RZP mark
John 2015/07/31 21:05:54 N/A anymore (this method was removed.) As to RZP
jvoung (off chromium) 2015/07/31 21:21:05 Okay sounds fine for this CL. Just raising awarene
John 2015/07/31 21:29:06 You are awesome at finding things that will be pa
+ Context.insert(InstFakeDef::create(Func, RZP));
+ return RZP;
+ }
};
class TargetDataX8664 : public TargetDataLowering {
@@ -55,6 +83,7 @@ private:
ENABLE_MAKE_UNIQUE;
explicit TargetDataX8664(GlobalContext *Ctx) : TargetDataLowering(Ctx) {}
+ template <typename T> static void emitConstantPool(GlobalContext *Ctx);
};
class TargetHeaderX8664 : public TargetHeaderLowering {

Powered by Google App Engine
This is Rietveld 408576698