llvm.org GIT mirror llvm / f3a2214
[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 Craig Topper 5 years ago
5 changed file(s) with 10 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
7171 printAnnotation(OS, Annot);
7272 }
7373
74 static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
74 void X86ATTInstPrinter::printSSEAVXCC(const MCInst *MI, unsigned Op,
75 raw_ostream &O) {
76 int64_t Imm = MI->getOperand(Op).getImm();
7577 switch (Imm) {
7678 default: llvm_unreachable("Invalid ssecc/avxcc argument!");
7779 case 0: O << "eq"; break;
109111 }
110112 }
111113
112 void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
113 raw_ostream &O) {
114 int64_t Imm = MI->getOperand(Op).getImm();
115 assert((Imm & 0x7) == Imm); // Ensure valid immediate.
116 printSSEAVXCC(Imm, O);
117 }
118
119 void X86ATTInstPrinter::printAVXCC(const MCInst *MI, unsigned Op,
120 raw_ostream &O) {
121 int64_t Imm = MI->getOperand(Op).getImm();
122 assert((Imm & 0x1f) == Imm); // Ensure valid immediate.
123 printSSEAVXCC(Imm, O);
124 }
125
126114 void X86ATTInstPrinter::printRoundingControl(const MCInst *MI, unsigned Op,
127115 raw_ostream &O) {
128116 int64_t Imm = MI->getOperand(Op).getImm() & 0x3;
4444
4545 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
4646 void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &OS);
47 void printSSECC(const MCInst *MI, unsigned Op, raw_ostream &OS);
48 void printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS);
47 void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS);
4948 void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
5049 void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
5150 void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
4949 EmitAnyX86InstComments(MI, *CommentStream, getRegisterName);
5050 }
5151
52 static void printSSEAVXCC(int64_t Imm, raw_ostream &O) {
52 void X86IntelInstPrinter::printSSEAVXCC(const MCInst *MI, unsigned Op,
53 raw_ostream &O) {
54 int64_t Imm = MI->getOperand(Op).getImm();
5355 switch (Imm) {
5456 default: llvm_unreachable("Invalid avxcc argument!");
5557 case 0: O << "eq"; break;
8789 }
8890 }
8991
90 void X86IntelInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
91 raw_ostream &O) {
92 int64_t Imm = MI->getOperand(Op).getImm();
93 assert((Imm & 0x7) == Imm); // Ensure valid immediate.
94 printSSEAVXCC(Imm, O);
95 }
96
97 void X86IntelInstPrinter::printAVXCC(const MCInst *MI, unsigned Op,
98 raw_ostream &O) {
99 int64_t Imm = MI->getOperand(Op).getImm();
100 assert((Imm & 0x1f) == Imm); // Ensure valid immediate.
101 printSSEAVXCC(Imm, O);
102 }
103
10492 void X86IntelInstPrinter::printRoundingControl(const MCInst *MI, unsigned Op,
10593 raw_ostream &O) {
10694 int64_t Imm = MI->getOperand(Op).getImm() & 0x3;
3535
3636 void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
3737 void printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O);
38 void printSSECC(const MCInst *MI, unsigned Op, raw_ostream &O);
39 void printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
38 void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O);
4039 void printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O);
4140 void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &O);
4241 void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
538538 X86MemOffs64_64AsmOperand>;
539539
540540 def SSECC : Operand {
541 let PrintMethod = "printSSECC";
541 let PrintMethod = "printSSEAVXCC";
542542 let OperandType = "OPERAND_IMMEDIATE";
543543 }
544544
547547 }]>;
548548
549549 def AVXCC : Operand {
550 let PrintMethod = "printAVXCC";
550 let PrintMethod = "printSSEAVXCC";
551551 let OperandType = "OPERAND_IMMEDIATE";
552552 }
553553