[PATCH] R600: improve dump of S_WAITCNT
Vincent Lejeune
vljn at ovi.com
Wed Oct 9 15:05:06 PDT 2013
---
lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp | 11 +++++++++++
lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h | 1 +
lib/Target/R600/SIInstructions.td | 4 +++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp b/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
index fac3c39..d91eda6 100644
--- a/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
+++ b/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
@@ -255,4 +255,15 @@ void AMDGPUInstPrinter::printKCache(const MCInst *MI, unsigned OpNo,
}
}
+void AMDGPUInstPrinter::printWaitFlag(const MCInst *MI, unsigned OpNo,
+ raw_ostream &O) {
+ unsigned SImm16 = MI->getOperand(OpNo).getImm();
+ unsigned VMCount = SImm16 & 15;
+ unsigned ExportWrite = (SImm16 >> 4) & 15;
+ unsigned LGKMCnt = (SImm16 >> 8) & 15;
+ O << "vmcount(" << VMCount << ") ";
+ O << "& ExportWrite(" << ExportWrite << ") ";
+ O << "& LGKM_CNT(" << LGKMCnt << ")";
+}
+
#include "AMDGPUGenAsmWriter.inc"
diff --git a/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h b/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h
index 4c1dfa6..3524b30 100644
--- a/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h
+++ b/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h
@@ -52,6 +52,7 @@ private:
void printRSel(const MCInst *MI, unsigned OpNo, raw_ostream &O);
void printCT(const MCInst *MI, unsigned OpNo, raw_ostream &O);
void printKCache(const MCInst *MI, unsigned OpNo, raw_ostream &O);
+ void printWaitFlag(const MCInst *MI, unsigned OpNo, raw_ostream &O);
};
} // End namespace llvm
diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index 99fedcb..4dfaa16 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -25,6 +25,8 @@ def InterpSlot : Operand<i32> {
def isSI : Predicate<"Subtarget.getGeneration() "
"== AMDGPUSubtarget::SOUTHERN_ISLANDS">;
+def WAIT_FLAG : InstFlag<"printWaitFlag">;
+
let Predicates = [isSI] in {
let neverHasSideEffects = 1 in {
@@ -815,7 +817,7 @@ def S_BARRIER : SOPP <0x0000000a, (ins), "S_BARRIER",
let mayStore = 1;
}
-def S_WAITCNT : SOPP <0x0000000c, (ins i32imm:$simm16), "S_WAITCNT $simm16",
+def S_WAITCNT : SOPP <0x0000000c, (ins WAIT_FLAG:$simm16), "S_WAITCNT $simm16",
[]
>;
} // End hasSideEffects
--
1.8.3.1
More information about the llvm-commits
mailing list