[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / MC / AMDGPU / gfx9_err_pos.s
blob578a063ebb70372d6d6bd6c875e1a11bce8df6a5
1 // RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --implicit-check-not=error: --strict-whitespace
3 //==============================================================================
4 // 'null' operand is not supported on this GPU
6 s_add_u32 null, null, null
7 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: 'null' operand is not supported on this GPU
8 // CHECK-NEXT:{{^}}s_add_u32 null, null, null
9 // CHECK-NEXT:{{^}} ^
11 //==============================================================================
12 // ABS not allowed in VOP3B instructions
14 v_div_scale_f64 v[24:25], vcc, -|v[22:23]|, v[22:23], v[20:21]
15 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: ABS not allowed in VOP3B instructions
16 // CHECK-NEXT:{{^}}v_div_scale_f64 v[24:25], vcc, -|v[22:23]|, v[22:23], v[20:21]
17 // CHECK-NEXT:{{^}}^
19 //==============================================================================
20 // dlc modifier is not supported on this GPU
22 scratch_load_ubyte v1, v2, off dlc
23 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dlc modifier is not supported on this GPU
24 // CHECK-NEXT:{{^}}scratch_load_ubyte v1, v2, off dlc
25 // CHECK-NEXT:{{^}} ^
27 scratch_load_ubyte v1, v2, off nodlc
28 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: dlc modifier is not supported on this GPU
29 // CHECK-NEXT:{{^}}scratch_load_ubyte v1, v2, off nodlc
30 // CHECK-NEXT:{{^}} ^
32 //==============================================================================
33 // duplicate VGPR index mode
35 s_set_gpr_idx_on s0, gpr_idx(SRC0,DST,SRC1,DST)
36 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: duplicate VGPR index mode
37 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(SRC0,DST,SRC1,DST)
38 // CHECK-NEXT:{{^}} ^
40 //==============================================================================
41 // exp target is not supported on this GPU
43 exp pos4 v4, v3, v2, v1
44 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: exp target is not supported on this GPU
45 // CHECK-NEXT:{{^}}exp pos4 v4, v3, v2, v1
46 // CHECK-NEXT:{{^}} ^
48 //==============================================================================
49 // expected a 12-bit unsigned offset
51 flat_load_dword v1, v[3:4] offset:-1
52 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a 12-bit unsigned offset
53 // CHECK-NEXT:{{^}}flat_load_dword v1, v[3:4] offset:-1
54 // CHECK-NEXT:{{^}} ^
56 flat_load_dword v1, v[3:4] offset:4096
57 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a 12-bit unsigned offset
58 // CHECK-NEXT:{{^}}flat_load_dword v1, v[3:4] offset:4096
59 // CHECK-NEXT:{{^}} ^
61 //==============================================================================
62 // expected a 13-bit signed offset
64 global_load_dword v1, v[3:4] off, offset:-4097
65 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a 13-bit signed offset
66 // CHECK-NEXT:{{^}}global_load_dword v1, v[3:4] off, offset:-4097
67 // CHECK-NEXT:{{^}} ^
69 //==============================================================================
70 // expected a VGPR index mode
72 s_set_gpr_idx_on s0, gpr_idx(SRC0,
73 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a VGPR index mode
74 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(SRC0,
75 // CHECK-NEXT:{{^}} ^
77 //==============================================================================
78 // expected a VGPR index mode or a closing parenthesis
80 s_set_gpr_idx_on s0, gpr_idx(
81 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a VGPR index mode or a closing parenthesis
82 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(
83 // CHECK-NEXT:{{^}} ^
85 s_set_gpr_idx_on s0, gpr_idx(X)
86 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a VGPR index mode or a closing parenthesis
87 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(X)
88 // CHECK-NEXT:{{^}} ^
90 //==============================================================================
91 // expected a comma or a closing parenthesis
93 s_set_gpr_idx_on s0, gpr_idx(DST
94 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected a comma or a closing parenthesis
95 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx(DST
96 // CHECK-NEXT:{{^}} ^
98 //==============================================================================
99 // expected absolute expression
101 s_set_gpr_idx_on s0, gpr_idx
102 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected absolute expression
103 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, gpr_idx
104 // CHECK-NEXT:{{^}} ^
106 s_set_gpr_idx_on s0, s1
107 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: expected absolute expression
108 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, s1
109 // CHECK-NEXT:{{^}} ^
111 //==============================================================================
112 // invalid atomic image dmask
114 image_atomic_add v252, v2, s[8:15]
115 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid atomic image dmask
116 // CHECK-NEXT:{{^}}image_atomic_add v252, v2, s[8:15]
117 // CHECK-NEXT:{{^}}^
119 image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xe tfe
120 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid atomic image dmask
121 // CHECK-NEXT:{{^}}image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xe tfe
122 // CHECK-NEXT:{{^}} ^
124 //==============================================================================
125 // invalid image_gather dmask: only one bit must be set
127 image_gather4_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x3
128 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid image_gather dmask: only one bit must be set
129 // CHECK-NEXT:{{^}}image_gather4_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x3
130 // CHECK-NEXT:{{^}} ^
132 //==============================================================================
133 // invalid immediate: only 4-bit values are legal
135 s_set_gpr_idx_on s0, 16
136 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid immediate: only 4-bit values are legal
137 // CHECK-NEXT:{{^}}s_set_gpr_idx_on s0, 16
138 // CHECK-NEXT:{{^}} ^
140 //==============================================================================
141 // invalid operand (violates constant bus restrictions)
143 v_add_f32_e64 v0, flat_scratch_hi, m0
144 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
145 // CHECK-NEXT:{{^}}v_add_f32_e64 v0, flat_scratch_hi, m0
146 // CHECK-NEXT:{{^}} ^
148 v_madak_f32 v5, s1, v2, 0xa1b1c1d1
149 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
150 // CHECK-NEXT:{{^}}v_madak_f32 v5, s1, v2, 0xa1b1c1d1
151 // CHECK-NEXT:{{^}} ^
153 v_madmk_f32 v5, s1, 0x11213141, v255
154 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand (violates constant bus restrictions)
155 // CHECK-NEXT:{{^}}v_madmk_f32 v5, s1, 0x11213141, v255
156 // CHECK-NEXT:{{^}} ^
158 //==============================================================================
159 // literal operands are not supported
161 v_bfe_u32 v0, v2, v3, undef
162 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: literal operands are not supported
163 // CHECK-NEXT:{{^}}v_bfe_u32 v0, v2, v3, undef
164 // CHECK-NEXT:{{^}} ^
166 v_bfe_u32 v0, v2, undef, v3
167 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: literal operands are not supported
168 // CHECK-NEXT:{{^}}v_bfe_u32 v0, v2, undef, v3
169 // CHECK-NEXT:{{^}} ^
171 //==============================================================================
172 // too few operands for instruction
174 buffer_load_dword off, s[8:11], s3
175 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction
176 // CHECK-NEXT:{{^}}buffer_load_dword off, s[8:11], s3
177 // CHECK-NEXT:{{^}}^
179 buffer_load_dword off, s[8:11], s3 offset:1
180 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: too few operands for instruction
181 // CHECK-NEXT:{{^}}buffer_load_dword off, s[8:11], s3 offset:1
182 // CHECK-NEXT:{{^}}^
184 //==============================================================================
185 // r128 modifier is not supported on this GPU
187 image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
188 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU
189 // CHECK-NEXT:{{^}}image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
190 // CHECK-NEXT:{{^}} ^
192 image_atomic_add v10, v6, s[8:15] dmask:0x1 nor128
193 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU
194 // CHECK-NEXT:{{^}}image_atomic_add v10, v6, s[8:15] dmask:0x1 nor128
195 // CHECK-NEXT:{{^}} ^
197 //==============================================================================
198 // unified format is not supported on this GPU
200 tbuffer_store_format_xyzw v[1:4], v1, s[4:7], s0 format:[BUF_FMT_8_SNORM,BUF_DATA_FORMAT_8] idxen
201 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unified format is not supported on this GPU
202 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], v1, s[4:7], s0 format:[BUF_FMT_8_SNORM,BUF_DATA_FORMAT_8] idxen
203 // CHECK-NEXT:{{^}} ^
205 //==============================================================================
206 // duplicate format
208 tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7], dfmt:1 s0 format:[BUF_NUM_FORMAT_FLOAT]
209 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: duplicate format
210 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7], dfmt:1 s0 format:[BUF_NUM_FORMAT_FLOAT]
211 // CHECK-NEXT:{{^}} ^
213 //==============================================================================
214 // not a valid operand
216 v_cndmask_b32_sdwa v5, sext(v1), v2, vcc dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:BYTE_0 src1_sel:WORD_0
217 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand.
218 // CHECK-NEXT:{{^}}v_cndmask_b32_sdwa v5, sext(v1), v2, vcc dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:BYTE_0 src1_sel:WORD_0
219 // CHECK-NEXT:{{^}} ^
221 //==============================================================================
222 // out of range dfmt
224 tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:16 nfmt:1 s0
225 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: out of range dfmt
226 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:16 nfmt:1 s0
227 // CHECK-NEXT:{{^}} ^
229 //==============================================================================
230 // out of range nfmt
232 tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:1 nfmt:-1 s0
233 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: out of range nfmt
234 // CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:1 nfmt:-1 s0
235 // CHECK-NEXT:{{^}} ^