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; |