Index: lib/Target/AMDGPU/VOP2Instructions.td =================================================================== --- lib/Target/AMDGPU/VOP2Instructions.td +++ lib/Target/AMDGPU/VOP2Instructions.td @@ -251,7 +251,9 @@ class VOP_MADAK : 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 Index: test/CodeGen/AMDGPU/twoaddr-fma.mir =================================================================== --- test/CodeGen/AMDGPU/twoaddr-fma.mir +++ test/CodeGen/AMDGPU/twoaddr-fma.mir @@ -181,3 +181,23 @@ %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 + +... +