diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td @@ -2159,6 +2159,12 @@ 1); } +class getHasExt32BitDPP { + bit ret = !and(getHasDPP.ret, + !not(getHas64BitOps.ret)); +} + class getHasExt64BitDPP { bit ret = !and(getHasDPP.ret, @@ -2273,6 +2279,7 @@ field bit HasExt = getHasExt.ret; field bit HasExtDPP = getHasDPP.ret; + field bit HasExt32BitDPP = getHasExt32BitDPP.ret; field bit HasExt64BitDPP = getHasExt64BitDPP.ret; field bit HasExtSDWA = getHasSDWA.ret; field bit HasExtSDWA9 = HasExtSDWA; @@ -2344,6 +2351,7 @@ class VOP_NO_EXT : VOPProfile { let HasExt = 0; let HasExtDPP = 0; + let HasExt32BitDPP = 0; let HasExt64BitDPP = 0; let HasExtSDWA = 0; let HasExtSDWA9 = 0; diff --git a/llvm/lib/Target/AMDGPU/VOP1Instructions.td b/llvm/lib/Target/AMDGPU/VOP1Instructions.td --- a/llvm/lib/Target/AMDGPU/VOP1Instructions.td +++ b/llvm/lib/Target/AMDGPU/VOP1Instructions.td @@ -571,13 +571,13 @@ } } multiclass VOP1_Real_dpp_gfx10 op> { - foreach _ = BoolToList(NAME#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(NAME#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp_gfx10 : VOP1_DPP16(NAME#"_dpp")> { let DecoderNamespace = "SDWA10"; } } multiclass VOP1_Real_dpp8_gfx10 op> { - foreach _ = BoolToList(NAME#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(NAME#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp8_gfx10 : VOP1_DPP8(NAME#"_e32")> { let DecoderNamespace = "DPP8"; } diff --git a/llvm/lib/Target/AMDGPU/VOP2Instructions.td b/llvm/lib/Target/AMDGPU/VOP2Instructions.td --- a/llvm/lib/Target/AMDGPU/VOP2Instructions.td +++ b/llvm/lib/Target/AMDGPU/VOP2Instructions.td @@ -330,6 +330,7 @@ let HasExt = 1; let HasExtDPP = 1; + let HasExt32BitDPP = 1; let HasExtSDWA = 1; let HasExtSDWA9 = 0; let TieRegDPP = "$src2"; @@ -337,9 +338,9 @@ def VOP_MAC_F16 : VOP_MAC ; def VOP_MAC_F32 : VOP_MAC ; -let HasExtDPP = 0 in +let HasExtDPP = 0, HasExt32BitDPP = 0 in def VOP_MAC_LEGACY_F32 : VOP_MAC ; -let HasExtSDWA = 0, HasExt64BitDPP = 1 in +let HasExtSDWA = 0, HasExt32BitDPP = 0, HasExt64BitDPP = 1 in def VOP_MAC_F64 : VOP_MAC ; class VOP_DOT_ACC : VOP_MAC { @@ -404,6 +405,7 @@ let HasExt = 1; let HasExtDPP = 1; + let HasExt32BitDPP = 1; let HasExtSDWA = 1; let HasExtSDWA9 = 1; } @@ -440,6 +442,7 @@ let HasExt = 1; let HasExtDPP = 1; + let HasExt32BitDPP = 1; let HasExtSDWA = 1; let HasExtSDWA9 = 1; } @@ -454,6 +457,7 @@ let HasExt = 0; let HasExtDPP = 0; + let HasExt32BitDPP = 0; let HasExt64BitDPP = 0; let HasExtSDWA = 0; let HasExtSDWA9 = 0; @@ -471,6 +475,7 @@ let HasExt = 0; let HasExtDPP = 0; + let HasExt32BitDPP = 0; let HasExt64BitDPP = 0; let HasExtSDWA = 0; let HasExtSDWA9 = 0; @@ -1014,13 +1019,13 @@ } } multiclass VOP2_Real_dpp_gfx10 op> { - foreach _ = BoolToList(NAME#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(NAME#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp_gfx10 : VOP2_DPP16(NAME#"_dpp")> { let DecoderNamespace = "SDWA10"; } } multiclass VOP2_Real_dpp8_gfx10 op> { - foreach _ = BoolToList(NAME#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(NAME#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp8_gfx10 : VOP2_DPP8(NAME#"_e32")> { let DecoderNamespace = "DPP8"; } @@ -1059,7 +1064,7 @@ } multiclass VOP2_Real_dpp_gfx10_with_name op, string opName, string asmName> { - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp_gfx10 : VOP2_DPP16(opName#"_dpp")> { VOP2_Pseudo ps = !cast(opName#"_e32"); let AsmString = asmName # ps.Pfl.AsmDPP16; @@ -1067,7 +1072,7 @@ } multiclass VOP2_Real_dpp8_gfx10_with_name op, string opName, string asmName> { - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp8_gfx10 : VOP2_DPP8(opName#"_e32")> { VOP2_Pseudo ps = !cast(opName#"_e32"); let AsmString = asmName # ps.Pfl.AsmDPP8; @@ -1125,14 +1130,14 @@ } } multiclass VOP2be_Real_dpp_gfx10 op, string opName, string asmName> { - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp_gfx10 : VOP2_DPP16(opName#"_dpp"), asmName> { string AsmDPP = !cast(opName#"_e32").Pfl.AsmDPP16; let AsmString = asmName # !subst(", vcc", "", AsmDPP); let DecoderNamespace = "SDWA10"; } - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp_w32_gfx10 : Base_VOP2_DPP16(opName#"_dpp"), asmName> { string AsmDPP = !cast(opName#"_e32").Pfl.AsmDPP16; @@ -1140,7 +1145,7 @@ let isAsmParserOnly = 1; let WaveSizePredicate = isWave32; } - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp_w64_gfx10 : Base_VOP2_DPP16(opName#"_dpp"), asmName> { string AsmDPP = !cast(opName#"_e32").Pfl.AsmDPP16; @@ -1150,14 +1155,14 @@ } } multiclass VOP2be_Real_dpp8_gfx10 op, string opName, string asmName> { - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp8_gfx10 : VOP2_DPP8(opName#"_e32")> { string AsmDPP8 = !cast(opName#"_e32").Pfl.AsmDPP8; let AsmString = asmName # !subst(", vcc", "", AsmDPP8); let DecoderNamespace = "DPP8"; } - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp8_w32_gfx10 : VOP2_DPP8(opName#"_e32")> { string AsmDPP8 = !cast(opName#"_e32").Pfl.AsmDPP8; @@ -1165,7 +1170,7 @@ let isAsmParserOnly = 1; let WaveSizePredicate = isWave32; } - foreach _ = BoolToList(opName#"_e32").Pfl.HasExtDPP>.ret in + foreach _ = BoolToList(opName#"_e32").Pfl.HasExt32BitDPP>.ret in def _dpp8_w64_gfx10 : VOP2_DPP8(opName#"_e32")> { string AsmDPP8 = !cast(opName#"_e32").Pfl.AsmDPP8; diff --git a/llvm/test/MC/AMDGPU/gfx10_unsupported.s b/llvm/test/MC/AMDGPU/gfx10_unsupported.s --- a/llvm/test/MC/AMDGPU/gfx10_unsupported.s +++ b/llvm/test/MC/AMDGPU/gfx10_unsupported.s @@ -1065,6 +1065,33 @@ v_subrev_co_u32_dpp v255, vcc, v1, v2 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x0 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported +v_ceil_f64_dpp v[10:11], v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_cvt_f32_f64_dpp v5, v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_cvt_i32_f64_dpp v5, v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_cvt_u32_f64_dpp v5, v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_floor_f64_dpp v[10:11], v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_fract_f64_dpp v[10:11], v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_frexp_exp_i32_f64_dpp v5, v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_frexp_mant_f64_dpp v[10:11], v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + +v_trunc_f64_dpp v[10:11], v[2:3] row_newbcast:1 row_mask:0xf bank_mask:0xf +// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dpp variant of this instruction is not supported + //===----------------------------------------------------------------------===// // Unsupported sdwa variants. //===----------------------------------------------------------------------===//