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 1118353005: Subzero: Use a setcc sequence for better icmp lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 8 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/IceInstX8632.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.cpp
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index fc31921d7819c033e2a71245c61e9cbbb96d81b8..b2532783c9a0e67f8e34ff8d63001fd59a674b6d 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -339,6 +339,9 @@ InstX8632Ret::InstX8632Ret(Cfg *Func, Variable *Source)
addSource(Source);
}
+InstX8632Setcc::InstX8632Setcc(Cfg *Func, Variable *Dest, CondX86::BrCond Cond)
+ : InstX8632(Func, InstX8632::Setcc, 0, Dest), Condition(Cond) {}
+
InstX8632Xadd::InstX8632Xadd(Cfg *Func, Operand *Dest, Variable *Source,
bool Locked)
: InstX8632Lockable(Func, InstX8632::Xadd, 2,
@@ -2726,6 +2729,35 @@ void InstX8632Ret::dump(const Cfg *Func) const {
dumpSources(Func);
}
+void InstX8632Setcc::emit(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Func->getContext()->getStrEmit();
+ Str << "\tset" << InstX8632BrAttributes[Condition].DisplayString << "\t";
+ Dest->emit(Func);
+}
+
+void InstX8632Setcc::emitIAS(const Cfg *Func) const {
+ assert(Condition != CondX86::Br_None);
+ assert(getDest()->getType() == IceType_i1);
+ assert(getSrcSize() == 0);
+ X8632::AssemblerX8632 *Asm = Func->getAssembler<X8632::AssemblerX8632>();
+ if (getDest()->hasReg())
+ Asm->setcc(Condition, RegX8632::getEncodedByteReg(getDest()->getRegNum()));
+ else
+ Asm->setcc(Condition, static_cast<TargetX8632 *>(Func->getTarget())
+ ->stackVarToAsmOperand(getDest()));
+ return;
+}
+
+void InstX8632Setcc::dump(const Cfg *Func) const {
+ if (!ALLOW_DUMP)
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ Str << "setcc." << InstX8632BrAttributes[Condition].DisplayString << " ";
+ dumpDest(Func);
+}
+
void InstX8632Xadd::emit(const Cfg *Func) const {
if (!ALLOW_DUMP)
return;
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698