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

Unified Diff: src/IceInstX8632.h

Issue 476323004: Start adding an integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: make fixups part of address 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.h
diff --git a/src/IceInstX8632.h b/src/IceInstX8632.h
index 918b77411dd90e52fba975320db678253832f463..f35f005842f31dc993735796f6039e4b21064dc3 100644
--- a/src/IceInstX8632.h
+++ b/src/IceInstX8632.h
@@ -16,6 +16,7 @@
#ifndef SUBZERO_SRC_ICEINSTX8632_H
#define SUBZERO_SRC_ICEINSTX8632_H
+#include "assembler_ia32.h"
#include "IceDefs.h"
#include "IceInst.h"
#include "IceInstX8632.def"
@@ -71,6 +72,7 @@ public:
Variable *getIndex() const { return Index; }
uint16_t getShift() const { return Shift; }
SegmentRegisters getSegmentRegister() const { return SegmentReg; }
+ x86::Address convertToAsmAddress(Assembler *Asm) const;
virtual void emit(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
@@ -228,6 +230,7 @@ public:
static const char *getWidthString(Type Ty);
virtual void emit(const Cfg *Func) const = 0;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
protected:
@@ -352,6 +355,7 @@ public:
InstX8632AdjustStack(Func, Amount);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
@@ -372,6 +376,7 @@ public:
}
Operand *getCallTarget() const { return getSrc(0); }
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Call); }
@@ -397,6 +402,7 @@ public:
getSrc(0)->emit(Func);
Str << "\n";
}
+ virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
@@ -434,6 +440,7 @@ public:
getSrc(0)->emit(Func);
Str << "\n";
}
+ virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
@@ -469,6 +476,7 @@ public:
virtual void emit(const Cfg *Func) const {
emitTwoAddress(Opcode, this, Func, ShiftHack);
}
+ virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
@@ -508,6 +516,7 @@ public:
getSrc(2)->emit(Func);
Str << "\n";
}
+ virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
@@ -549,6 +558,7 @@ public:
getSrc(1)->emit(Func);
Str << "\n";
}
+ virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
@@ -586,6 +596,7 @@ public:
return checkForRedundantAssign(getDest(), getSrc(0));
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const { emit(Func); }
virtual void dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
Str << Opcode << "." << getDest()->getType() << " ";
@@ -761,6 +772,7 @@ public:
InstX8632Cmov(Func, Dest, Source, Cond);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Cmov); }
@@ -790,6 +802,7 @@ public:
InstX8632Cmpps(Func, Dest, Source, Condition);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Cmpps); }
@@ -884,6 +897,7 @@ public:
InstX8632Icmp(Func, Src1, Src2);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Icmp); }
@@ -902,6 +916,7 @@ public:
InstX8632Ucomiss(Func, Src1, Src2);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Ucomiss); }
@@ -1030,6 +1045,7 @@ public:
InstX8632Movsx(Func, Dest, Source);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Movsx); }
@@ -1049,6 +1065,7 @@ public:
InstX8632Movzx(Func, Dest, Source);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Movzx); }
@@ -1069,6 +1086,7 @@ public:
return new (Func->allocate<InstX8632Nop>()) InstX8632Nop(Func, Variant);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Nop); }
@@ -1121,6 +1139,7 @@ public:
return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Pop); }
@@ -1160,6 +1179,7 @@ public:
return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source);
}
virtual void emit(const Cfg *Func) const;
+ virtual void emitIAS(const Cfg *Func) const;
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return isClassof(Inst, Ret); }
@@ -1244,6 +1264,27 @@ template <> void InstX8632Psub::emit(const Cfg *Func) const;
template <> void InstX8632Sqrtss::emit(const Cfg *Func) const;
template <> void InstX8632Subss::emit(const Cfg *Func) const;
+// Same with emitIAS() methods.
+template <> void InstX8632Adc::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Add::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Addps::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Addss::emitIAS(const Cfg *Func) const;
+template <> void InstX8632And::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Cbwdq::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Divps::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Divss::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Mulps::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Mulss::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Padd::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Psub::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Or::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Sbb::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Sqrtss::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Sub::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Subps::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Subss::emitIAS(const Cfg *Func) const;
+template <> void InstX8632Xor::emitIAS(const Cfg *Func) const;
+
} // end of namespace Ice
#endif // SUBZERO_SRC_ICEINSTX8632_H
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698