[X86] Merge printSSECC and printAVXCC. They only differed by an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227301 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2015-01-28 10:09:52 +00:00
parent d5bce3cab0
commit f3a2214da8
5 changed files with 10 additions and 36 deletions

View File

@ -72,7 +72,9 @@ void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
printAnnotation(OS, Annot);
}
static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
void X86ATTInstPrinter::printSSEAVXCC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm();
switch (Imm) {
default: llvm_unreachable("Invalid ssecc/avxcc argument!");
case 0: O << "eq"; break;
@ -110,20 +112,6 @@ static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
}
}
void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm();
assert((Imm & 0x7) == Imm); // Ensure valid immediate.
printSSEAVXCC(Imm, O);
}
void X86ATTInstPrinter::printAVXCC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm();
assert((Imm & 0x1f) == Imm); // Ensure valid immediate.
printSSEAVXCC(Imm, O);
}
void X86ATTInstPrinter::printRoundingControl(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm() & 0x3;

View File

@ -45,8 +45,7 @@ public:
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &OS);
void printSSECC(const MCInst *MI, unsigned Op, raw_ostream &OS);
void printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS);
void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS);
void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &OS);

View File

@ -50,7 +50,9 @@ void X86IntelInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
EmitAnyX86InstComments(MI, *CommentStream, getRegisterName);
}
static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
void X86IntelInstPrinter::printSSEAVXCC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm();
switch (Imm) {
default: llvm_unreachable("Invalid avxcc argument!");
case 0: O << "eq"; break;
@ -88,20 +90,6 @@ static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
}
}
void X86IntelInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm();
assert((Imm & 0x7) == Imm); // Ensure valid immediate.
printSSEAVXCC(Imm, O);
}
void X86IntelInstPrinter::printAVXCC(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm();
assert((Imm & 0x1f) == Imm); // Ensure valid immediate.
printSSEAVXCC(Imm, O);
}
void X86IntelInstPrinter::printRoundingControl(const MCInst *MI, unsigned Op,
raw_ostream &O) {
int64_t Imm = MI->getOperand(Op).getImm() & 0x3;

View File

@ -36,8 +36,7 @@ public:
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
void printSSECC(const MCInst *MI, unsigned Op, raw_ostream &O);
void printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);

View File

@ -539,7 +539,7 @@ def offset64_64 : X86MemOffsOperand<i64imm, "printMemOffs64",
X86MemOffs64_64AsmOperand>;
def SSECC : Operand<i8> {
let PrintMethod = "printSSECC";
let PrintMethod = "printSSEAVXCC";
let OperandType = "OPERAND_IMMEDIATE";
}
@ -548,7 +548,7 @@ def i8immZExt3 : ImmLeaf<i8, [{
}]>;
def AVXCC : Operand<i8> {
let PrintMethod = "printAVXCC";
let PrintMethod = "printSSEAVXCC";
let OperandType = "OPERAND_IMMEDIATE";
}