From: Dmitry Preobrazhensky Date: Fri, 11 Nov 2022 10:14:42 +0000 (+0300) Subject: [AMDGPU][MC] Disable SGPRs as src operands of VOP3 VINTRP instructions X-Git-Tag: upstream/17.0.6~27950 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05baf681a3c2c5072b6992deb255c7835ba50689;p=platform%2Fupstream%2Fllvm.git [AMDGPU][MC] Disable SGPRs as src operands of VOP3 VINTRP instructions Differential Revision: https://reviews.llvm.org/D137575 --- diff --git a/llvm/lib/Target/AMDGPU/VOP3Instructions.td b/llvm/lib/Target/AMDGPU/VOP3Instructions.td index fdbdfe5..c412a18 100644 --- a/llvm/lib/Target/AMDGPU/VOP3Instructions.td +++ b/llvm/lib/Target/AMDGPU/VOP3Instructions.td @@ -59,6 +59,7 @@ class VOP3Interp pattern = []> : } def VOP3_INTERP : VOPProfile<[f32, f32, i32, untyped]> { + let Src0Mod = FPVRegInputMods; let Ins64 = (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0, Attr:$attr, AttrChan:$attrchan, clampmod0:$clamp, omod0:$omod); @@ -108,6 +109,9 @@ class VOP3_INTERP16 ArgVT> : VOPProfile { let HasOMod = !ne(DstVT.Value, f16.Value); let HasHigh = 1; + let Src0Mod = FPVRegInputMods; + let Src2Mod = FPVRegInputMods; + let Outs64 = (outs DstRC.RegClass:$vdst); let Ins64 = getInterp16Ins.ret; let Asm64 = getInterp16Asm.ret; diff --git a/llvm/test/MC/AMDGPU/vintrp-e64-err.s b/llvm/test/MC/AMDGPU/vintrp-e64-err.s new file mode 100644 index 0000000..7179e4b --- /dev/null +++ b/llvm/test/MC/AMDGPU/vintrp-e64-err.s @@ -0,0 +1,45 @@ +// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --implicit-check-not=error: +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck %s --implicit-check-not=error: + +v_interp_p1_f32_e64 v5, 0.5, attr0.w +// CHECK: error: invalid operand for instruction + +v_interp_p1_f32_e64 v5, s1, attr0.w +// CHECK: error: invalid operand for instruction + +v_interp_p1ll_f16 v5, 0.5, attr0.w +// CHECK: error: invalid operand for instruction + +v_interp_p1ll_f16 v5, s1, attr0.w +// CHECK: error: invalid operand for instruction + +v_interp_p1lv_f16 v5, 0.5, attr0.w, v3 +// CHECK: error: invalid operand for instruction + +v_interp_p1lv_f16 v5, s1, attr0.w, v3 +// CHECK: error: invalid operand for instruction + +v_interp_p1lv_f16 v5, v1, attr31.w, 0.5 +// CHECK: error: invalid operand for instruction + +v_interp_p1lv_f16 v5, v1, attr31.w, s1 +// CHECK: error: invalid operand for instruction + +v_interp_p2_f16 v5, 0.5, attr0.w, v3 +// CHECK: error: invalid operand for instruction + +v_interp_p2_f16 v5, s1, attr0.w, v3 +// CHECK: error: invalid operand for instruction + +v_interp_p2_f16 v5, v1, attr1.w, 0.5 +// CHECK: error: invalid operand for instruction + +v_interp_p2_f16 v5, v1, attr1.w, s1 +// CHECK: error: invalid operand for instruction + +v_interp_p2_f32_e64 v5, 0.5, attr31.w +// CHECK: error: invalid operand for instruction + +v_interp_p2_f32_e64 v5, s1, attr31.w +// CHECK: error: invalid operand for instruction