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

Unified Diff: src/IceInstX8632.cpp

Issue 321993002: Add a few Subzero intrinsics (not the atomic ones yet). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: doesn't matter if eax or not Created 6 years, 6 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/IceInstX8632.cpp
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index 5d3f01ba2834bfd35ddb5cb0040a63690675d7ef..592725f2a564a73fabb14118be155cc4a984d6b9 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -50,6 +50,15 @@ const struct TypeX8632Attributes_ {
const size_t TypeX8632AttributesSize =
llvm::array_lengthof(TypeX8632Attributes);
+const char *InstX8632SegmentRegNames[] = {
+#define X(val, name) \
+ name,
+ SEG_REGX8632_TABLE
+#undef X
+};
+const size_t InstX8632SegmentRegNamesSize =
+ llvm::array_lengthof(InstX8632SegmentRegNames);
+
} // end of anonymous namespace
const char *InstX8632::getWidthString(Type Ty) {
@@ -148,6 +157,10 @@ InstX8632Ucomiss::InstX8632Ucomiss(Cfg *Func, Operand *Src0, Operand *Src1)
addSource(Src1);
}
+InstX8632UD2::InstX8632UD2(Cfg *Func)
+ : InstX8632(Func, InstX8632::UD2, 0, NULL) {
+}
+
InstX8632Test::InstX8632Test(Cfg *Func, Operand *Src1, Operand *Src2)
: InstX8632(Func, InstX8632::Test, 2, NULL) {
addSource(Src1);
@@ -525,6 +538,17 @@ void InstX8632Ucomiss::dump(const Cfg *Func) const {
dumpSources(Func);
}
+void InstX8632UD2::emit(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrEmit();
+ assert(getSrcSize() == 0);
+ Str << "\tud2\n";
+}
+
+void InstX8632UD2::dump(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrDump();
+ Str << "ud2\n";
+}
+
void InstX8632Test::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
assert(getSrcSize() == 2);
@@ -826,6 +850,26 @@ void OperandX8632Mem::dump(const Cfg *Func) const {
Str << "]";
}
+void OperandX8632MemOffSeg::emit(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrEmit();
+ Str << TypeX8632Attributes[getType()].WidthString << " ";
+ assert(SegmentReg < InstX8632SegmentRegNamesSize);
+ Str << InstX8632SegmentRegNames[SegmentReg] << ":";
+ int64_t OffVal = 0;
+ if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) {
+ OffVal = CI->getValue();
+ } else {
+ assert (Offset == NULL && "Offset should be NULL or ConstantInteger");
+ OffVal = 0;
+ }
+ Str << "[" << OffVal << "]";
+}
+
+void OperandX8632MemOffSeg::dump(const Cfg *Func) const {
+ // Same as emit for now.
+ emit(Func);
+}
+
void VariableSplit::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit();
assert(Var->getLocalUseNode() == NULL ||

Powered by Google App Engine
This is Rietveld 408576698