summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIInstrFormats.td
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-02-11 03:28:15 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-02-11 03:28:15 +0000
commita90b9526df693321a4dbebfeb1dcac672f403b41 (patch)
treec22cad9c7c2d52df235e032c7828da9327b8b305 /llvm/lib/Target/AMDGPU/SIInstrFormats.td
parentba284b60b87f62fbb52f29541141cf2afb9502bc (diff)
downloadbcm5719-llvm-a90b9526df693321a4dbebfeb1dcac672f403b41.tar.gz
bcm5719-llvm-a90b9526df693321a4dbebfeb1dcac672f403b41.zip
[AMDGPU] Assembler: Fix VOP3 only instructions
Separate methods to convert parsed instructions to MCInst: - VOP3 only instructions (always create modifiers as operands in MCInst) - VOP2 instrunctions with modifiers (create modifiers as operands in MCInst when e64 encoding is forced or modifiers are parsed) - VOP2 instructions without modifiers (do not create modifiers as operands in MCInst) - Add VOP3Only flag. Pass HasMods flag to VOP3Common. - Simplify code that deals with modifiers (-1 is now same as 0). This is no longer needed. - Add few tests (more will be added separately). Update error message now correct. Patch By: Nikolay Haustov Differential Revision: http://reviews.llvm.org/D16778 llvm-svn: 260483
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIInstrFormats.td')
-rw-r--r--llvm/lib/Target/AMDGPU/SIInstrFormats.td7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstrFormats.td b/llvm/lib/Target/AMDGPU/SIInstrFormats.td
index 0e883f64caa..08e9c16a7ed 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrFormats.td
+++ b/llvm/lib/Target/AMDGPU/SIInstrFormats.td
@@ -123,7 +123,7 @@ class VOP2Common <dag outs, dag ins, string asm, list<dag> pattern> :
let Size = 4;
}
-class VOP3Common <dag outs, dag ins, string asm, list<dag> pattern> :
+class VOP3Common <dag outs, dag ins, string asm, list<dag> pattern, bit HasMods = 0, bit VOP3Only = 0> :
VOPAnyCommon <outs, ins, asm, pattern> {
// Using complex patterns gives VOP3 patterns a very high complexity rating,
@@ -135,7 +135,10 @@ class VOP3Common <dag outs, dag ins, string asm, list<dag> pattern> :
let VOP3 = 1;
let VALU = 1;
- let AsmMatchConverter = "cvtVOP3";
+ let AsmMatchConverter =
+ !if(!eq(VOP3Only,1),
+ "cvtVOP3_only",
+ !if(!eq(HasMods,1), "cvtVOP3_2_mod", "cvtVOP3_2_nomod"));
let isCodeGenOnly = 0;
int Size = 8;
OpenPOWER on IntegriCloud