Add support for printing the sse scalar comparison instruction mnemonics.

llvm-svn: 22440
This commit is contained in:
Nate Begeman 2005-07-14 22:52:25 +00:00
parent 4f229d5197
commit 0f38dc4970
4 changed files with 34 additions and 0 deletions

View File

@ -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!");

View File

@ -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);
};

View File

@ -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();

View File

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