forked from OSchip/llvm-project
[X86] Merge printSSECC and printAVXCC. They only differed by an assertion.
llvm-svn: 227301
This commit is contained in:
parent
16b670ec20
commit
6772eac490
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue