Skip to content

Commit 82f00ea

Browse files
authored
[AMDGPU][MC] In GFX11+ v_pk_fmac_f16 should not allow DPP (#148751)
In GFX11+ the instruction v_pk_fmac_f16 should not allow DPP.
1 parent 11f52ec commit 82f00ea

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

llvm/lib/Target/AMDGPU/VOP2Instructions.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,8 @@ def V_FMAAK_F64 : VOP2_Pseudo<"v_fmaak_f64", VOP_MADAK_F64, [], "">;
13441344
} // End SubtargetPredicate = HasFmaakFmamkF64Insts, isReMaterializable = 1, FixedSize = 1, Size = 12, SchedRW = [Write64Bit]
13451345

13461346
let SubtargetPredicate = HasPkFmacF16Inst in {
1347+
// FIXME: V_PK_FMAC_F16 is currently not used in instruction selection.
1348+
// If this changes, ensure the DPP variant is not used for GFX11+.
13471349
defm V_PK_FMAC_F16 : VOP2Inst<"v_pk_fmac_f16", VOP_V2F16_V2F16_V2F16>;
13481350
} // End SubtargetPredicate = HasPkFmacF16Inst
13491351

@@ -1904,7 +1906,7 @@ multiclass VOP2_Real_FULL_with_name_gfx11_gfx12<bits<6> op, string opName,
19041906
VOP2_Real_FULL_with_name<GFX12Gen, op, opName, asmName>;
19051907

19061908
multiclass VOP2_Real_e32_gfx11_gfx12<bits<6> op> :
1907-
VOP2Only_Real<GFX11Gen, op>, VOP2Only_Real<GFX12Gen, op>;
1909+
VOP2Only_Real_e32<GFX11Gen, op>, VOP2Only_Real_e32<GFX12Gen, op>;
19081910

19091911
multiclass VOP3Only_Realtriple_gfx11_gfx12<bits<10> op> :
19101912
VOP3Only_Realtriple<GFX11Gen, op>, VOP3Only_Realtriple<GFX12Gen, op>;

llvm/test/MC/AMDGPU/gfx11_asm_vop2_fake16_err.s

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,21 @@ v_mul_f16_e32 v5, v1, v255
173173
v_mul_f16_e32 v5, v255, v2
174174
// GFX11: :[[@LINE-1]]:1: error: operands are not valid for this GPU or mode
175175

176+
v_pk_fmac_f16 v0, v1, v2 quad_perm:[1,2,3,0]
177+
// GFX11: :[[@LINE-1]]:26: error: not a valid operand.
178+
179+
v_pk_fmac_f16 v0, v1, v2 quad_perm:[1,2,3,0] row_mask:0x0 bank_mask:0x0
180+
// GFX11: :[[@LINE-1]]:26: error: not a valid operand.
181+
182+
v_pk_fmac_f16 v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0]
183+
// GFX11: :[[@LINE-1]]:26: error: not a valid operand.
184+
185+
v_pk_fmac_f16_dpp v0, v1, v2 quad_perm:[1,2,3,0]
186+
// GFX11: :[[@LINE-1]]:1: error: dpp variant of this instruction is not supported
187+
188+
v_pk_fmac_f16_dpp v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0]
189+
// GFX11: :[[@LINE-1]]:1: error: dpp variant of this instruction is not supported
190+
176191
v_sub_f16_dpp v255, v1, v2 dpp8:[7,6,5,4,3,2,1,0]
177192
// GFX11: :[[@LINE-1]]:1: error: operands are not valid for this GPU or mode
178193

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --unique --sort --version 5
2+
// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1200 %s 2>&1 | FileCheck --check-prefix=GFX12 --implicit-check-not=error: %s
3+
4+
v_pk_fmac_f16 v0, v1, v2 quad_perm:[1,2,3,0]
5+
// GFX12: :[[@LINE-1]]:26: error: not a valid operand.
6+
7+
v_pk_fmac_f16 v0, v1, v2 quad_perm:[1,2,3,0] row_mask:0x0 bank_mask:0x0
8+
// GFX12: :[[@LINE-1]]:26: error: not a valid operand.
9+
10+
v_pk_fmac_f16 v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0]
11+
// GFX12: :[[@LINE-1]]:26: error: not a valid operand.
12+
13+
v_pk_fmac_f16_dpp v0, v1, v2 quad_perm:[1,2,3,0]
14+
// GFX12: :[[@LINE-1]]:1: error: dpp variant of this instruction is not supported
15+
16+
v_pk_fmac_f16_dpp v0, v1, v2 quad_perm:[1,2,3,0] row_mask:0x0 bank_mask:0x0
17+
// GFX12: :[[@LINE-1]]:1: error: dpp variant of this instruction is not supported
18+
19+
v_pk_fmac_f16_dpp v5, v1, v2 dpp8:[7,6,5,4,3,2,1,0]
20+
// GFX12: :[[@LINE-1]]:1: error: dpp variant of this instruction is not supported

0 commit comments

Comments
 (0)