R600/SI: Don't use strings for single characters

llvm-svn: 218221
This commit is contained in:
Matt Arsenault 2014-09-21 17:27:28 +00:00
parent 27e58727d3
commit 3673eba568
1 changed files with 18 additions and 18 deletions

View File

@ -240,12 +240,12 @@ void AMDGPUInstPrinter::printOperandAndMods(const MCInst *MI, unsigned OpNo,
raw_ostream &O) { raw_ostream &O) {
unsigned InputModifiers = MI->getOperand(OpNo).getImm(); unsigned InputModifiers = MI->getOperand(OpNo).getImm();
if (InputModifiers & 0x1) if (InputModifiers & 0x1)
O << "-"; O << '-';
if (InputModifiers & 0x2) if (InputModifiers & 0x2)
O << "|"; O << '|';
printOperand(MI, OpNo + 1, O); printOperand(MI, OpNo + 1, O);
if (InputModifiers & 0x2) if (InputModifiers & 0x2)
O << "|"; O << '|';
} }
void AMDGPUInstPrinter::printInterpSlot(const MCInst *MI, unsigned OpNum, void AMDGPUInstPrinter::printInterpSlot(const MCInst *MI, unsigned OpNum,
@ -359,7 +359,7 @@ void AMDGPUInstPrinter::printSel(const MCInst *MI, unsigned OpNo,
sel -= 512; sel -= 512;
int cb = sel >> 12; int cb = sel >> 12;
sel &= 4095; sel &= 4095;
O << cb << "[" << sel << "]"; O << cb << '[' << sel << ']';
} else if (sel >= 448) { } else if (sel >= 448) {
sel -= 448; sel -= 448;
O << sel; O << sel;
@ -368,7 +368,7 @@ void AMDGPUInstPrinter::printSel(const MCInst *MI, unsigned OpNo,
} }
if (sel >= 0) if (sel >= 0)
O << "." << chans[chan]; O << '.' << chans[chan];
} }
void AMDGPUInstPrinter::printBankSwizzle(const MCInst *MI, unsigned OpNo, void AMDGPUInstPrinter::printBankSwizzle(const MCInst *MI, unsigned OpNo,
@ -401,25 +401,25 @@ void AMDGPUInstPrinter::printRSel(const MCInst *MI, unsigned OpNo,
unsigned Sel = MI->getOperand(OpNo).getImm(); unsigned Sel = MI->getOperand(OpNo).getImm();
switch (Sel) { switch (Sel) {
case 0: case 0:
O << "X"; O << 'X';
break; break;
case 1: case 1:
O << "Y"; O << 'Y';
break; break;
case 2: case 2:
O << "Z"; O << 'Z';
break; break;
case 3: case 3:
O << "W"; O << 'W';
break; break;
case 4: case 4:
O << "0"; O << '0';
break; break;
case 5: case 5:
O << "1"; O << '1';
break; break;
case 7: case 7:
O << "_"; O << '_';
break; break;
default: default:
break; break;
@ -431,10 +431,10 @@ void AMDGPUInstPrinter::printCT(const MCInst *MI, unsigned OpNo,
unsigned CT = MI->getOperand(OpNo).getImm(); unsigned CT = MI->getOperand(OpNo).getImm();
switch (CT) { switch (CT) {
case 0: case 0:
O << "U"; O << 'U';
break; break;
case 1: case 1:
O << "N"; O << 'N';
break; break;
default: default:
break; break;
@ -446,10 +446,10 @@ void AMDGPUInstPrinter::printKCache(const MCInst *MI, unsigned OpNo,
int KCacheMode = MI->getOperand(OpNo).getImm(); int KCacheMode = MI->getOperand(OpNo).getImm();
if (KCacheMode > 0) { if (KCacheMode > 0) {
int KCacheBank = MI->getOperand(OpNo - 2).getImm(); int KCacheBank = MI->getOperand(OpNo - 2).getImm();
O << "CB" << KCacheBank <<":"; O << "CB" << KCacheBank << ':';
int KCacheAddr = MI->getOperand(OpNo + 2).getImm(); int KCacheAddr = MI->getOperand(OpNo + 2).getImm();
int LineSize = (KCacheMode == 1)?16:32; int LineSize = (KCacheMode == 1) ? 16 : 32;
O << KCacheAddr * 16 << "-" << KCacheAddr * 16 + LineSize; O << KCacheAddr * 16 << '-' << KCacheAddr * 16 + LineSize;
} }
} }
@ -498,7 +498,7 @@ void AMDGPUInstPrinter::printWaitFlag(const MCInst *MI, unsigned OpNo,
if (Expcnt != 0x7) if (Expcnt != 0x7)
O << "expcnt(" << Expcnt << ") "; O << "expcnt(" << Expcnt << ") ";
if (Lgkmcnt != 0x7) if (Lgkmcnt != 0x7)
O << "lgkmcnt(" << Lgkmcnt << ")"; O << "lgkmcnt(" << Lgkmcnt << ')';
} }
#include "AMDGPUGenAsmWriter.inc" #include "AMDGPUGenAsmWriter.inc"