diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp index ca8630c3cb92..230baad096ff 100755 --- a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -143,6 +143,22 @@ void X86ATTAsmPrinter::printOp(const MachineOperand &MO, bool isCallOp) { } } +void X86ATTAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op, + MVT::ValueType VT) { + unsigned char value = MI->getOperand(Op).getImmedValue(); + assert(value <= 7 && "Invalid ssecc argument!"); + switch (value) { + case 0: O << "eq"; break; + case 1: O << "lt"; break; + case 2: O << "le"; break; + case 3: O << "unord"; break; + case 4: O << "neq"; break; + case 5: O << "nlt"; break; + case 6: O << "nle"; break; + case 7: O << "ord"; break; + } +} + void X86ATTAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){ assert(isMem(MI, Op) && "Invalid memory reference!"); diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.h b/llvm/lib/Target/X86/X86ATTAsmPrinter.h index ee91e8e0659a..be5f0ddfbb39 100755 --- a/llvm/lib/Target/X86/X86ATTAsmPrinter.h +++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.h @@ -51,6 +51,7 @@ struct X86ATTAsmPrinter : public X86SharedAsmPrinter { void printMachineInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO, bool isCallOperand = false); + void printSSECC(const MachineInstr *MI, unsigned Op, MVT::ValueType VT); void printMemReference(const MachineInstr *MI, unsigned Op); bool runOnMachineFunction(MachineFunction &F); }; diff --git a/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp b/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp index 91982977c4b0..9cf7c29d77d1 100755 --- a/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp @@ -58,6 +58,22 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) { return false; } +void X86IntelAsmPrinter::printSSECC(const MachineInstr *MI, unsigned Op, + MVT::ValueType VT) { + unsigned char value = MI->getOperand(Op).getImmedValue(); + assert(value <= 7 && "Invalid ssecc argument!"); + switch (value) { + case 0: O << "eq"; break; + case 1: O << "lt"; break; + case 2: O << "le"; break; + case 3: O << "unord"; break; + case 4: O << "neq"; break; + case 5: O << "nlt"; break; + case 6: O << "nle"; break; + case 7: O << "ord"; break; + } +} + void X86IntelAsmPrinter::printOp(const MachineOperand &MO, bool elideOffsetKeyword /* = false */) { const MRegisterInfo &RI = *TM.getRegisterInfo(); diff --git a/llvm/lib/Target/X86/X86IntelAsmPrinter.h b/llvm/lib/Target/X86/X86IntelAsmPrinter.h index 4dec56aeaf26..7d81e6b226f6 100755 --- a/llvm/lib/Target/X86/X86IntelAsmPrinter.h +++ b/llvm/lib/Target/X86/X86IntelAsmPrinter.h @@ -70,6 +70,7 @@ struct X86IntelAsmPrinter : public X86SharedAsmPrinter { void printMachineInstruction(const MachineInstr *MI); void printOp(const MachineOperand &MO, bool elideOffsetKeyword = false); + void printSSECC(const MachineInstr *MI, unsigned Op, MVT::ValueType VT); void printMemReference(const MachineInstr *MI, unsigned Op); bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M);