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/IceInst.cpp

Issue 401523003: Lower insertelement and extractelement. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 6 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
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 12ca16c4caa0c6fbf14858941294e9cae54722a6..004b5550baab037ed52cfab41cad584766990a34 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -267,6 +267,13 @@ InstCast::InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source)
addSource(Source);
}
+InstExtractElement::InstExtractElement(Cfg *Func, Variable *Dest,
+ Operand *Source1, Operand *Source2)
+ : Inst(Func, Inst::ExtractElement, 2, Dest) {
+ addSource(Source1);
+ addSource(Source2);
+}
+
InstFcmp::InstFcmp(Cfg *Func, FCond Condition, Variable *Dest, Operand *Source1,
Operand *Source2)
: Inst(Func, Inst::Fcmp, 2, Dest), Condition(Condition) {
@@ -281,6 +288,15 @@ InstIcmp::InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1,
addSource(Source2);
}
+InstInsertElement::InstInsertElement(Cfg *Func, Variable *Dest,
+ Operand *Source1, Operand *Source2,
+ Operand *Source3)
+ : Inst(Func, Inst::InsertElement, 3, Dest) {
+ addSource(Source1);
+ addSource(Source2);
+ addSource(Source3);
+}
+
InstLoad::InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr)
: Inst(Func, Inst::Load, 1, Dest) {
addSource(SourceAddr);
@@ -586,6 +602,31 @@ void InstIcmp::dump(const Cfg *Func) const {
dumpSources(Func);
}
+void InstExtractElement::dump(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrDump();
+ dumpDest(Func);
+ Str << " = extractelement ";
+ Str << getSrc(0)->getType() << " ";
+ getSrc(0)->dump(Func);
+ Str << ", ";
+ Str << getSrc(1)->getType() << " ";
+ getSrc(1)->dump(Func);
+};
+
+void InstInsertElement::dump(const Cfg *Func) const {
+ Ostream &Str = Func->getContext()->getStrDump();
+ dumpDest(Func);
+ Str << " = insertelement ";
+ Str << getSrc(0)->getType() << " ";
+ getSrc(0)->dump(Func);
+ Str << ", ";
+ Str << getSrc(1)->getType() << " ";
+ getSrc(1)->dump(Func);
+ Str << ", ";
+ Str << getSrc(2)->getType() << " ";
+ getSrc(2)->dump(Func);
+};
+
void InstFcmp::dump(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrDump();
dumpDest(Func);
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698