diff options
author | Vincent Lejeune <vljn@ovi.com> | 2013-10-13 17:56:28 +0000 |
---|---|---|
committer | Vincent Lejeune <vljn@ovi.com> | 2013-10-13 17:56:28 +0000 |
commit | cf1f4c7dd19458f47a9ba720d90eec507d66c94a (patch) | |
tree | debf68a8932fae59f1a989b2cc637c074564c389 /lib/Target | |
parent | 36d96337f7bf17a35c44403ca5df4023be7f0157 (diff) | |
download | external_llvm-cf1f4c7dd19458f47a9ba720d90eec507d66c94a.zip external_llvm-cf1f4c7dd19458f47a9ba720d90eec507d66c94a.tar.gz external_llvm-cf1f4c7dd19458f47a9ba720d90eec507d66c94a.tar.bz2 |
R600: improve dump of S_WAITCNT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192557 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp | 17 | ||||
-rw-r--r-- | lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h | 1 | ||||
-rw-r--r-- | lib/Target/R600/SIInstructions.td | 4 |
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp b/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp index fac3c39..a777802 100644 --- a/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp +++ b/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp @@ -255,4 +255,21 @@ void AMDGPUInstPrinter::printKCache(const MCInst *MI, unsigned OpNo, } } +void AMDGPUInstPrinter::printWaitFlag(const MCInst *MI, unsigned OpNo, + raw_ostream &O) { + // Note: Mask values are taken from SIInsertWaits.cpp and not from ISA docs + // SIInsertWaits.cpp bits usage does not match ISA docs description but it + // works so it might be a misprint in docs. + unsigned SImm16 = MI->getOperand(OpNo).getImm(); + unsigned Vmcnt = SImm16 & 0xF; + unsigned Expcnt = (SImm16 >> 4) & 0xF; + unsigned Lgkmcnt = (SImm16 >> 8) & 0xF; + if (Vmcnt != 0xF) + O << "vmcnt(" << Vmcnt << ") "; + if (Expcnt != 0x7) + O << "expcnt(" << Expcnt << ") "; + if (Lgkmcnt != 0x7) + O << "lgkmcnt(" << 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 8294fbd..94d42d5 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 |