Index: llvm/lib/Target/AMDGPU/VOP3Instructions.td =================================================================== --- llvm/lib/Target/AMDGPU/VOP3Instructions.td +++ llvm/lib/Target/AMDGPU/VOP3Instructions.td @@ -630,8 +630,8 @@ def V_CVT_PKNORM_I16_F16 : VOP3Inst <"v_cvt_pknorm_i16_f16", VOP3_Profile>; def V_CVT_PKNORM_U16_F16 : VOP3Inst <"v_cvt_pknorm_u16_f16", VOP3_Profile>; -def V_ADD_I32_gfx9 : VOP3Inst <"v_add_i32_gfx9", VOP3_Profile>; -def V_SUB_I32_gfx9 : VOP3Inst <"v_sub_i32_gfx9", VOP3_Profile>; +def V_ADD_I32_gfx9 : VOP3Inst <"v_add_i32_gfx9", VOP3_Profile>; +def V_SUB_I32_gfx9 : VOP3Inst <"v_sub_i32_gfx9", VOP3_Profile>; class ThreeOp_i32_Pats : GCNPat < Index: llvm/test/MC/AMDGPU/gfx10_asm_all.s =================================================================== --- llvm/test/MC/AMDGPU/gfx10_asm_all.s +++ llvm/test/MC/AMDGPU/gfx10_asm_all.s @@ -62887,6 +62887,9 @@ v_sub_nc_i32 v5, v1, -4.0 // GFX10: encoding: [0x05,0x00,0x76,0xd7,0x01,0xef,0x01,0x00] +v_sub_nc_i32 v5, v1, -4.0 clamp +// GFX10: v_sub_nc_i32 v5, v1, -4.0 clamp ; encoding: [0x05,0x80,0x76,0xd7,0x01,0xef,0x01,0x00] + v_permlane16_b32 v5, v1, v2, v3 // GFX10-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction @@ -63223,6 +63226,9 @@ v_add_nc_i32 v5, v1, -4.0 // GFX10: encoding: [0x05,0x00,0x7f,0xd7,0x01,0xef,0x01,0x00] +v_add_nc_i32 v5, v1, -4.0 clamp +// GFX10: v_add_nc_i32 v5, v1, -4.0 clamp ; encoding: [0x05,0x80,0x7f,0xd7,0x01,0xef,0x01,0x00] + v_pk_fmac_f16 v5, v1, v2 // GFX10: encoding: [0x01,0x05,0x0a,0x78] Index: llvm/test/MC/AMDGPU/vop3-gfx9.s =================================================================== --- llvm/test/MC/AMDGPU/vop3-gfx9.s +++ llvm/test/MC/AMDGPU/vop3-gfx9.s @@ -515,6 +515,22 @@ // GFX9: v_subrev_co_u32_e32 v84, vcc, v13, v31 ; encoding: [0x0d,0x3f,0xa8,0x36] // NOVI: error: instruction not supported on this GPU +v_add_i32 v1, v2, v3 +// GFX9: v_add_i32 v1, v2, v3 ; encoding: [0x01,0x00,0x9c,0xd2,0x02,0x07,0x02,0x00] +// NOVI: error: instruction not supported on this GPU + +v_add_i32 v1, v2, v3 clamp +// GFX9: v_add_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x9c,0xd2,0x02,0x07,0x02,0x00] +// NOVI: error: invalid operand for instruction + +v_sub_i32 v1, v2, v3 +// GFX9: v_sub_i32 v1, v2, v3 ; encoding: [0x01,0x00,0x9d,0xd2,0x02,0x07,0x02,0x00] +// NOVI: error: instruction not supported on this GPU + +v_sub_i32 v1, v2, v3 clamp +// GFX9: v_sub_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x9d,0xd2,0x02,0x07,0x02,0x00] +// NOVI: error: invalid operand for instruction + //===----------------------------------------------------------------------===// // Validate register size checks (bug 37943) //===----------------------------------------------------------------------===// Index: llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt =================================================================== --- llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt +++ llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt @@ -21320,6 +21320,9 @@ # GFX10: v_add_nc_i32 v5, vcc_lo, v2 ; encoding: [0x05,0x00,0x7f,0xd7,0x6a,0x04,0x02,0x00] 0x05,0x00,0x7f,0xd7,0x6a,0x04,0x02,0x00 +# GFX10: v_add_nc_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x7f,0xd7,0x02,0x07,0x02,0x00] +0x01,0x80,0x7f,0xd7,0x02,0x07,0x02,0x00 + # GFX10: v_add_nc_u16_e64 v255, v1, v2 ; encoding: [0xff,0x00,0x03,0xd7,0x01,0x05,0x02,0x00] 0xff,0x00,0x03,0xd7,0x01,0x05,0x02,0x00 @@ -95718,6 +95721,9 @@ # GFX10: v_sub_nc_i32 v5, vcc_lo, v2 ; encoding: [0x05,0x00,0x76,0xd7,0x6a,0x04,0x02,0x00] 0x05,0x00,0x76,0xd7,0x6a,0x04,0x02,0x00 +# GFX10: v_sub_nc_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x76,0xd7,0x02,0x07,0x02,0x00] +0x01,0x80,0x76,0xd7,0x02,0x07,0x02,0x00 + # GFX10: v_sub_nc_u16_e64 v255, v1, v2 ; encoding: [0xff,0x00,0x04,0xd7,0x01,0x05,0x02,0x00] 0xff,0x00,0x04,0xd7,0x01,0x05,0x02,0x00 Index: llvm/test/MC/Disassembler/AMDGPU/vop3_gfx9.txt =================================================================== --- llvm/test/MC/Disassembler/AMDGPU/vop3_gfx9.txt +++ llvm/test/MC/Disassembler/AMDGPU/vop3_gfx9.txt @@ -723,3 +723,8 @@ # GFX9: v_subrev_co_u32_e64 v84, vcc, v13, v31 clamp ; encoding: [0x54,0xea,0x1b,0xd1,0x0d,0x3f,0x02,0x00] 0x54,0xea,0x1b,0xd1,0x0d,0x3f,0x02,0x00 +# GFX9: v_add_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x9c,0xd2,0x02,0x07,0x02,0x00] +0x01,0x80,0x9c,0xd2,0x02,0x07,0x02,0x00 + +# GFX9: v_sub_i32 v1, v2, v3 clamp ; encoding: [0x01,0x80,0x9d,0xd2,0x02,0x07,0x02,0x00] +0x01,0x80,0x9d,0xd2,0x02,0x07,0x02,0x00