Index: lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp =================================================================== --- lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp +++ lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp @@ -437,9 +437,6 @@ switch (MI->getOpcode()) { default: break; - case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10: - case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10: - case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10: case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10: case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10: case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10: @@ -670,10 +667,6 @@ default: break; case AMDGPU::V_CNDMASK_B32_e32_gfx10: - case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10: - case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10: - case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10: - case AMDGPU::V_CNDMASK_B32_e32_gfx6_gfx7: case AMDGPU::V_CNDMASK_B32_e32_vi: if ((int)OpNo == AMDGPU::getNamedOperandIdx(MI->getOpcode(), Index: lib/Target/AMDGPU/VOP2Instructions.td =================================================================== --- lib/Target/AMDGPU/VOP2Instructions.td +++ lib/Target/AMDGPU/VOP2Instructions.td @@ -190,16 +190,16 @@ } } -class VOP2bInstAlias : - InstAlias : + InstAlias , PredicateControl { } +// Make vcc operands optional multiclass VOP2bInstAliases { - def : VOP2bInstAlias; + def : VOP2bInstAlias; } multiclass VOP2eInst (opName#"_e32"), SIEncodingFamily.GFX10>, VOP2e(opName#"_e32").Pfl> { VOP2_Pseudo Ps = !cast(opName#"_e32"); - let AsmString = asmName # !subst(", vcc", "", Ps.AsmOperands); + let AsmString = asmName # Ps.AsmOperands; } def _e64_gfx10 : VOP3_Real(opName#"_e64"), SIEncodingFamily.GFX10>, @@ -1340,13 +1340,18 @@ defm : VOP2eInstAliases; +} // End SubtargetPredicate = isGFX8GFX9 + +let SubtargetPredicate = isGFX9Only in { + defm : VOP2bInstAliases; defm : VOP2bInstAliases; defm : VOP2bInstAliases; defm : VOP2bInstAliases; defm : VOP2bInstAliases; defm : VOP2bInstAliases; -} // End SubtargetPredicate = isGFX8GFX9 + +} // End SubtargetPredicate = isGFX9Only let SubtargetPredicate = HasDLInsts in { Index: test/MC/AMDGPU/vop3-gfx9.s =================================================================== --- test/MC/AMDGPU/vop3-gfx9.s +++ test/MC/AMDGPU/vop3-gfx9.s @@ -491,6 +491,57 @@ // GFX9: v_subrev_co_u32_e64 v84, vcc, v13, v31 clamp ; encoding: [0x54,0xea,0x1b,0xd1,0x0d,0x3f,0x02,0x00] // NOVI: error: +v_addc_co_u32 v84, vcc, v13, v31, vcc +// GFX9: v_addc_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x38] +// NOVI: error: instruction not supported on this GPU + +v_subb_co_u32 v84, vcc, v13, v31, vcc +// GFX9: v_subb_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x3a] +// NOVI: error: instruction not supported on this GPU + +v_subbrev_co_u32 v84, vcc, v13, v31, vcc +// GFX9: v_subbrev_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x3c] +// NOVI: error: instruction not supported on this GPU + +v_add_co_u32 v84, vcc, v13, v31 +// GFX9: v_add_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x32] +// NOVI: error: instruction not supported on this GPU + +v_sub_co_u32 v84, vcc, v13, v31 +// GFX9: v_sub_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x34] +// NOVI: error: instruction not supported on this GPU + +v_subrev_co_u32 v84, vcc, v13, v31 +// GFX9: v_subrev_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x36] +// NOVI: error: instruction not supported on this GPU + +// vcc operands may be omitted + +v_addc_co_u32 v84, v13, v31 +// GFX9: v_addc_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x38] +// NOVI: error: instruction not supported on this GPU + +v_subb_co_u32 v84, v13, v31 +// GFX9: v_subb_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x3a] +// NOVI: error: instruction not supported on this GPU + +v_subbrev_co_u32 v84, v13, v31 +// GFX9: v_subbrev_co_u32_e32 v84, vcc, v13, v31, vcc ; encoding: [0x0d,0x3f,0xa8,0x3c] +// NOVI: error: instruction not supported on this GPU + +v_add_co_u32 v84, v13, v31 +// GFX9: v_add_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x32] +// NOVI: error: instruction not supported on this GPU + +v_sub_co_u32 v84, v13, v31 +// GFX9: v_sub_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x34] +// NOVI: error: instruction not supported on this GPU + +v_subrev_co_u32 v84, v13, v31 +// GFX9: v_subrev_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x36] +// NOVI: error: instruction not supported on this GPU + + //===----------------------------------------------------------------------===// // Validate register size checks (bug 37943) //===----------------------------------------------------------------------===//