[llvm] r372208 - [AMDGPU] Allow FP inline constant in v_madak_f16 and v_fmaak_f16
Tim Renouf via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 02:32:06 PDT 2019
Author: tpr
Date: Wed Sep 18 02:32:06 2019
New Revision: 372208
URL: http://llvm.org/viewvc/llvm-project?rev=372208&view=rev
Log:
[AMDGPU] Allow FP inline constant in v_madak_f16 and v_fmaak_f16
Differential Revision: https://reviews.llvm.org/D67680
Change-Id: Ic38f47cb2079c2c1070a441b5943854844d80a7c
Modified:
llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td
llvm/trunk/test/CodeGen/AMDGPU/twoaddr-fma.mir
llvm/trunk/test/CodeGen/AMDGPU/twoaddr-mad.mir
Modified: llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td?rev=372208&r1=372207&r2=372208&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td Wed Sep 18 02:32:06 2019
@@ -251,7 +251,9 @@ multiclass VOP2eInstAliases<VOP2_Pseudo
class VOP_MADAK <ValueType vt> : VOPProfile <[vt, vt, vt, vt]> {
field Operand ImmOpType = !if(!eq(vt.Size, 32), f32kimm, f16kimm);
- field dag Ins32 = (ins VCSrc_f32:$src0, VGPR_32:$src1, ImmOpType:$imm);
+ field dag Ins32 = !if(!eq(vt.Size, 32),
+ (ins VCSrc_f32:$src0, VGPR_32:$src1, ImmOpType:$imm),
+ (ins VCSrc_f16:$src0, VGPR_32:$src1, ImmOpType:$imm));
field bit HasExt = 0;
// Hack to stop printing _e64
Modified: llvm/trunk/test/CodeGen/AMDGPU/twoaddr-fma.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/twoaddr-fma.mir?rev=372208&r1=372207&r2=372208&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/twoaddr-fma.mir (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/twoaddr-fma.mir Wed Sep 18 02:32:06 2019
@@ -181,3 +181,23 @@ body: |
%1 = V_FMAC_F32_e32 %stack.0, %0, %2, implicit $exec
...
+
+# GCN-LABEL: name: test_fmaak_inline_literal_f16
+# GCN: %2:vgpr_32 = V_FMAAK_F16 16384, killed %0, 49664, implicit $exec
+
+---
+name: test_fmaak_inline_literal_f16
+liveins:
+ - { reg: '$vgpr0', virtual-reg: '%3' }
+body: |
+ bb.0:
+ liveins: $vgpr0
+
+ %3:vgpr_32 = COPY killed $vgpr0
+
+ %26:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
+ %28:vgpr_32 = V_FMAC_F16_e32 16384, killed %3, %26, implicit $exec
+ S_ENDPGM 0
+
+...
+
Modified: llvm/trunk/test/CodeGen/AMDGPU/twoaddr-mad.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/twoaddr-mad.mir?rev=372208&r1=372207&r2=372208&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/twoaddr-mad.mir (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/twoaddr-mad.mir Wed Sep 18 02:32:06 2019
@@ -188,3 +188,23 @@ body: |
%1 = V_MAC_F32_e32 %stack.0, %0, %2, implicit $exec
...
+
+# GCN-LABEL: name: test_madak_inline_literal_f16
+# GCN: %2:vgpr_32 = V_MADAK_F16 16384, killed %0, 49664, implicit $exec
+
+---
+name: test_madak_inline_literal_f16
+liveins:
+ - { reg: '$vgpr0', virtual-reg: '%3' }
+body: |
+ bb.0:
+ liveins: $vgpr0
+
+ %3:vgpr_32 = COPY killed $vgpr0
+
+ %26:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
+ %28:vgpr_32 = V_MAC_F16_e32 16384, killed %3, %26, implicit $exec
+ S_ENDPGM 0
+
+...
+
More information about the llvm-commits
mailing list