diff options
| author | Dmitry Preobrazhensky <dmitry.preobrazhensky@amd.com> | 2017-07-21 13:54:11 +0000 |
|---|---|---|
| committer | Dmitry Preobrazhensky <dmitry.preobrazhensky@amd.com> | 2017-07-21 13:54:11 +0000 |
| commit | abf2839478d275e0649921861506e3cc79e90db7 (patch) | |
| tree | 6e50d06e1c1220f7c314c41b34b5e88d052cf610 /llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp | |
| parent | 3206409d916847ef5141ad7ab662a6210898dab0 (diff) | |
| download | bcm5719-llvm-abf2839478d275e0649921861506e3cc79e90db7.tar.gz bcm5719-llvm-abf2839478d275e0649921861506e3cc79e90db7.zip | |
[AMDGPU][MC][GFX9] Added support of VOP3 'op_sel' modifier
See bug 33591: https://bugs.llvm.org//show_bug.cgi?id=33591
Reviewers: vpykhtin, artem.tamazov, SamWot, arsenm
Differential Revision: https://reviews.llvm.org/D35424
llvm-svn: 308740
Diffstat (limited to 'llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp b/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp index 7c31c8e397b..64cceb12e97 100644 --- a/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp +++ b/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp @@ -803,7 +803,8 @@ void AMDGPUInstPrinter::printExpTgt(const MCInst *MI, unsigned OpNo, } } -static bool allOpsDefaultValue(const int* Ops, int NumOps, int Mod) { +static bool allOpsDefaultValue(const int* Ops, int NumOps, int Mod, + bool HasDstSel) { int DefaultValue = (Mod == SISrcMods::OP_SEL_1); for (int I = 0; I < NumOps; ++I) { @@ -811,11 +812,16 @@ static bool allOpsDefaultValue(const int* Ops, int NumOps, int Mod) { return false; } + if (HasDstSel && (Ops[0] & SISrcMods::DST_OP_SEL) != 0) + return false; + return true; } -static void printPackedModifier(const MCInst *MI, StringRef Name, unsigned Mod, - raw_ostream &O) { +void AMDGPUInstPrinter::printPackedModifier(const MCInst *MI, + StringRef Name, + unsigned Mod, + raw_ostream &O) { unsigned Opc = MI->getOpcode(); int NumOps = 0; int Ops[3]; @@ -830,7 +836,12 @@ static void printPackedModifier(const MCInst *MI, StringRef Name, unsigned Mod, Ops[NumOps++] = MI->getOperand(Idx).getImm(); } - if (allOpsDefaultValue(Ops, NumOps, Mod)) + const bool HasDstSel = + NumOps > 0 && + Mod == SISrcMods::OP_SEL_0 && + MII.get(MI->getOpcode()).TSFlags & SIInstrFlags::VOP3_OPSEL; + + if (allOpsDefaultValue(Ops, NumOps, Mod, HasDstSel)) return; O << Name; @@ -841,6 +852,10 @@ static void printPackedModifier(const MCInst *MI, StringRef Name, unsigned Mod, O << !!(Ops[I] & Mod); } + if (HasDstSel) { + O << ',' << !!(Ops[0] & SISrcMods::DST_OP_SEL); + } + O << ']'; } |

