Skip to content

Commit 05baf68

Browse files
committed
[AMDGPU][MC] Disable SGPRs as src operands of VOP3 VINTRP instructions
Differential Revision: https://reviews.llvm.org/D137575
1 parent 4edcf8a commit 05baf68

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

llvm/lib/Target/AMDGPU/VOP3Instructions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class VOP3Interp<string OpName, VOPProfile P, list<dag> pattern = []> :
5959
}
6060

6161
def VOP3_INTERP : VOPProfile<[f32, f32, i32, untyped]> {
62+
let Src0Mod = FPVRegInputMods;
6263
let Ins64 = (ins Src0Mod:$src0_modifiers, VRegSrc_32:$src0,
6364
Attr:$attr, AttrChan:$attrchan,
6465
clampmod0:$clamp, omod0:$omod);
@@ -108,6 +109,9 @@ class VOP3_INTERP16 <list<ValueType> ArgVT> : VOPProfile<ArgVT> {
108109
let HasOMod = !ne(DstVT.Value, f16.Value);
109110
let HasHigh = 1;
110111

112+
let Src0Mod = FPVRegInputMods;
113+
let Src2Mod = FPVRegInputMods;
114+
111115
let Outs64 = (outs DstRC.RegClass:$vdst);
112116
let Ins64 = getInterp16Ins<HasSrc2, HasOMod, Src0Mod, Src2Mod>.ret;
113117
let Asm64 = getInterp16Asm<HasSrc2, HasOMod>.ret;

llvm/test/MC/AMDGPU/vintrp-e64-err.s

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga %s 2>&1 | FileCheck %s --implicit-check-not=error:
2+
// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --implicit-check-not=error:
3+
// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck %s --implicit-check-not=error:
4+
5+
v_interp_p1_f32_e64 v5, 0.5, attr0.w
6+
// CHECK: error: invalid operand for instruction
7+
8+
v_interp_p1_f32_e64 v5, s1, attr0.w
9+
// CHECK: error: invalid operand for instruction
10+
11+
v_interp_p1ll_f16 v5, 0.5, attr0.w
12+
// CHECK: error: invalid operand for instruction
13+
14+
v_interp_p1ll_f16 v5, s1, attr0.w
15+
// CHECK: error: invalid operand for instruction
16+
17+
v_interp_p1lv_f16 v5, 0.5, attr0.w, v3
18+
// CHECK: error: invalid operand for instruction
19+
20+
v_interp_p1lv_f16 v5, s1, attr0.w, v3
21+
// CHECK: error: invalid operand for instruction
22+
23+
v_interp_p1lv_f16 v5, v1, attr31.w, 0.5
24+
// CHECK: error: invalid operand for instruction
25+
26+
v_interp_p1lv_f16 v5, v1, attr31.w, s1
27+
// CHECK: error: invalid operand for instruction
28+
29+
v_interp_p2_f16 v5, 0.5, attr0.w, v3
30+
// CHECK: error: invalid operand for instruction
31+
32+
v_interp_p2_f16 v5, s1, attr0.w, v3
33+
// CHECK: error: invalid operand for instruction
34+
35+
v_interp_p2_f16 v5, v1, attr1.w, 0.5
36+
// CHECK: error: invalid operand for instruction
37+
38+
v_interp_p2_f16 v5, v1, attr1.w, s1
39+
// CHECK: error: invalid operand for instruction
40+
41+
v_interp_p2_f32_e64 v5, 0.5, attr31.w
42+
// CHECK: error: invalid operand for instruction
43+
44+
v_interp_p2_f32_e64 v5, s1, attr31.w
45+
// CHECK: error: invalid operand for instruction

0 commit comments

Comments
 (0)