diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp --- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -7073,7 +7073,7 @@ return MatchOperand_ParseFail; } - if (Attr > 63) { + if (Attr > 32) { Error(S, "out of bounds interpolation attribute number"); return MatchOperand_ParseFail; } diff --git a/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir.s b/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir.s --- a/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir.s +++ b/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir.s @@ -84,20 +84,5 @@ lds_param_load v11, attr22.y wait_vdst:5 // GFX11: lds_param_load v11, attr22.y wait_vdst:5 ; encoding: [0x0b,0x59,0x05,0xce] -lds_param_load v12, attr33.z wait_vdst:4 -// GFX11: lds_param_load v12, attr33.z wait_vdst:4 ; encoding: [0x0c,0x86,0x04,0xce] - -lds_param_load v13, attr63.x wait_vdst:3 -// GFX11: lds_param_load v13, attr63.x wait_vdst:3 ; encoding: [0x0d,0xfc,0x03,0xce] - -lds_param_load v14, attr63.y wait_vdst:2 -// GFX11: lds_param_load v14, attr63.y wait_vdst:2 ; encoding: [0x0e,0xfd,0x02,0xce] - -lds_param_load v15, attr63.z wait_vdst:1 -// GFX11: lds_param_load v15, attr63.z wait_vdst:1 ; encoding: [0x0f,0xfe,0x01,0xce] - -lds_param_load v16, attr63.w wait_vdst:0 -// GFX11: lds_param_load v16, attr63.w ; encoding: [0x10,0xff,0x00,0xce] - -lds_param_load v17, attr63.w -// GFX11: lds_param_load v17, attr63.w ; encoding: [0x11,0xff,0x00,0xce] +lds_param_load v12, attr32.z wait_vdst:4 +// GFX11: lds_param_load v12, attr32.z wait_vdst:4 ; encoding: [0x0c,0x82,0x04,0xce] diff --git a/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir_err.s b/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir_err.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/AMDGPU/gfx11_asm_ldsdir_err.s @@ -0,0 +1,20 @@ +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1100 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX11 %s + +lds_param_load v17, attr33.x +// GFX11: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number + +lds_param_load v17, attr33.y +// GFX11: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number + +lds_param_load v17, attr33.z +// GFX11: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number + +lds_param_load v17, attr33.w +// GFX11: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number + +lds_param_load v12, attr33.z wait_va_vdst:4 +// GFX11: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number + +lds_param_load v12, attr33.w wait_va_vdst:2 wait_vm_vsrc:1 +// GFX11: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number + diff --git a/llvm/test/MC/AMDGPU/vintrp-err.s b/llvm/test/MC/AMDGPU/vintrp-err.s --- a/llvm/test/MC/AMDGPU/vintrp-err.s +++ b/llvm/test/MC/AMDGPU/vintrp-err.s @@ -4,16 +4,16 @@ v_interp_p1_f32 v0, v1 // GCN: :[[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction -v_interp_p1_f32 v0, v1, attr64.w +v_interp_p1_f32 v0, v1, attr33.w // GCN: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number -v_interp_p1_f32 v0, v1, attr64.x +v_interp_p1_f32 v0, v1, attr33.x // GCN: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number -v_interp_p2_f32 v9, v1, attr64.x +v_interp_p2_f32 v9, v1, attr33.x // GCN: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number -v_interp_p2_f32 v0, v1, attr64.x +v_interp_p2_f32 v0, v1, attr33.x // GCN: :[[@LINE-1]]:{{[0-9]+}}: error: out of bounds interpolation attribute number v_interp_p2_f32 v0, v1, attr0.q diff --git a/llvm/test/MC/AMDGPU/vintrp.s b/llvm/test/MC/AMDGPU/vintrp.s --- a/llvm/test/MC/AMDGPU/vintrp.s +++ b/llvm/test/MC/AMDGPU/vintrp.s @@ -37,9 +37,9 @@ // SI: v_interp_p1_f32 v9, v0, attr4.w ; encoding: [0x00,0x13,0x24,0xc8] // VI: v_interp_p1_f32_e32 v9, v0, attr4.w ; encoding: [0x00,0x13,0x24,0xd4] -v_interp_p1_f32 v10, v0, attr63.w -// SI: v_interp_p1_f32 v10, v0, attr63.w ; encoding: [0x00,0xff,0x28,0xc8] -// VI: v_interp_p1_f32_e32 v10, v0, attr63.w ; encoding: [0x00,0xff,0x28,0xd4] +v_interp_p1_f32 v10, v0, attr32.w +// SI: v_interp_p1_f32 v10, v0, attr32.w ; encoding: [0x00,0x83,0x28,0xc8] +// VI: v_interp_p1_f32_e32 v10, v0, attr32.w ; encoding: [0x00,0x83,0x28,0xd4] v_interp_p2_f32 v2, v1, attr0.x @@ -66,9 +66,9 @@ // SI: v_interp_p2_f32 v7, v1, attr1.x ; encoding: [0x01,0x04,0x1d,0xc8] // VI: v_interp_p2_f32_e32 v7, v1, attr1.x ; encoding: [0x01,0x04,0x1d,0xd4] -v_interp_p2_f32 v8, v1, attr63.x -// SI: v_interp_p2_f32 v8, v1, attr63.x ; encoding: [0x01,0xfc,0x21,0xc8] -// VI: v_interp_p2_f32_e32 v8, v1, attr63.x ; encoding: [0x01,0xfc,0x21,0xd4] +v_interp_p2_f32 v8, v1, attr32.x +// SI: v_interp_p2_f32 v8, v1, attr32.x ; encoding: [0x01,0x80,0x21,0xc8] +// VI: v_interp_p2_f32_e32 v8, v1, attr32.x ; encoding: [0x01,0x80,0x21,0xd4] v_interp_mov_f32 v0, p10, attr0.x @@ -99,7 +99,7 @@ // SI: v_interp_mov_f32 v7, p10, attr0.x ; encoding: [0x00,0x00,0x1e,0xc8] // VI: v_interp_mov_f32_e32 v7, p10, attr0.x ; encoding: [0x00,0x00,0x1e,0xd4] -v_interp_mov_f32 v9, p10, attr63.y -// SI: v_interp_mov_f32 v9, p10, attr63.y ; encoding: [0x00,0xfd,0x26,0xc8] -// VI: v_interp_mov_f32_e32 v9, p10, attr63.y ; encoding: [0x00,0xfd,0x26,0xd4] +v_interp_mov_f32 v9, p10, attr32.y +// SI: v_interp_mov_f32 v9, p10, attr32.y ; encoding: [0x00,0x81,0x26,0xc8] +// VI: v_interp_mov_f32_e32 v9, p10, attr32.y ; encoding: [0x00,0x81,0x26,0xd4]