1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[AMDGPU] Allow FP inline constant in v_madak_f16 and v_fmaak_f16

Differential Revision: https://reviews.llvm.org/D67680

Change-Id: Ic38f47cb2079c2c1070a441b5943854844d80a7c
llvm-svn: 372208
This commit is contained in:
Tim Renouf 2019-09-18 09:32:06 +00:00
parent 08358b1ba1
commit 13fa3ce1bc
3 changed files with 43 additions and 1 deletions

View File

@ -251,7 +251,9 @@ multiclass VOP2eInstAliases<VOP2_Pseudo ps, VOP2_Real inst> {
class VOP_MADAK <ValueType vt> : VOPProfile <[vt, vt, vt, vt]> { class VOP_MADAK <ValueType vt> : VOPProfile <[vt, vt, vt, vt]> {
field Operand ImmOpType = !if(!eq(vt.Size, 32), f32kimm, f16kimm); 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; field bit HasExt = 0;
// Hack to stop printing _e64 // Hack to stop printing _e64

View File

@ -181,3 +181,23 @@ body: |
%1 = V_FMAC_F32_e32 %stack.0, %0, %2, implicit $exec %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
...

View File

@ -188,3 +188,23 @@ body: |
%1 = V_MAC_F32_e32 %stack.0, %0, %2, implicit $exec %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
...