1// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck --implicit-check-not=error: %s
2// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga   %s 2>&1 | FileCheck --implicit-check-not=error: %s
3
4// GENERIC LIMITATIONS ON VOP FORMATS: CONSTANT BUS RESTRICTIONS
5
6//=====================================================
7// v_movreld_b32: implicitly reads m0 (VOP1/VOP3)
8
9v_movreld_b32 v0, s1
10// CHECK: error: invalid operand (violates constant bus restrictions)
11
12v_movreld_b32 v0, flat_scratch_lo
13// CHECK: error: invalid operand (violates constant bus restrictions)
14
15v_movreld_b32 v0, flat_scratch_hi
16// CHECK: error: invalid operand (violates constant bus restrictions)
17
18v_movreld_b32 v0, vcc_lo
19// CHECK: error: invalid operand (violates constant bus restrictions)
20
21v_movreld_b32 v0, vcc_hi
22// CHECK: error: invalid operand (violates constant bus restrictions)
23
24v_movreld_b32 v0, exec_lo
25// CHECK: error: invalid operand (violates constant bus restrictions)
26
27v_movreld_b32 v0, exec_hi
28// CHECK: error: invalid operand (violates constant bus restrictions)
29
30v_movreld_b32 v0, ttmp0
31// CHECK: error: invalid operand (violates constant bus restrictions)
32
33v_movreld_b32 v0, ttmp1
34// CHECK: error: invalid operand (violates constant bus restrictions)
35
36v_movreld_b32 v0, 123
37// CHECK: error: invalid operand (violates constant bus restrictions)
38
39v_movreld_b32_e64 v0, s1
40// CHECK: error: invalid operand (violates constant bus restrictions)
41
42v_movreld_b32_e64 v0, flat_scratch_lo
43// CHECK: error: invalid operand (violates constant bus restrictions)
44
45v_movreld_b32_e64 v0, flat_scratch_hi
46// CHECK: error: invalid operand (violates constant bus restrictions)
47
48//=====================================================
49// v_div_fmas: implicitly read VCC (VOP3)
50
51v_div_fmas_f32 v0, s1, s1, s1
52// CHECK: error: invalid operand (violates constant bus restrictions)
53
54v_div_fmas_f32 v0, v2, v3, -s1
55// CHECK: error: invalid operand (violates constant bus restrictions)
56
57v_div_fmas_f32 v0, v1, s2, |v3|
58// CHECK: error: invalid operand (violates constant bus restrictions)
59
60v_div_fmas_f32 v0, v1, -v2, -s3
61// CHECK: error: invalid operand (violates constant bus restrictions)
62
63v_div_fmas_f32 v0, v1, flat_scratch_lo, v3
64// CHECK: error: invalid operand (violates constant bus restrictions)
65
66v_div_fmas_f32 v0, v1, v2, flat_scratch_hi
67// CHECK: error: invalid operand (violates constant bus restrictions)
68
69v_div_fmas_f32 v0, v1, v2, m0
70// CHECK: error: invalid operand (violates constant bus restrictions)
71
72v_div_fmas_f32 v0, v1, ttmp2, v2
73// CHECK: error: invalid operand (violates constant bus restrictions)
74
75v_div_fmas_f64 v[0:1], s[2:3], v[4:5], v[6:7]
76// CHECK: error: invalid operand (violates constant bus restrictions)
77
78v_div_fmas_f64 v[0:1], v[2:3], s[4:5], v[6:7]
79// CHECK: error: invalid operand (violates constant bus restrictions)
80
81v_div_fmas_f64 v[0:1], v[2:3], v[4:5], s[6:7]
82// CHECK: error: invalid operand (violates constant bus restrictions)
83
84v_div_fmas_f64 v[0:1], v[2:3], v[4:5], ttmp[2:3]
85// CHECK: error: invalid operand (violates constant bus restrictions)
86
87v_div_fmas_f64 v[0:1], v[2:3], v[4:5], flat_scratch
88// CHECK: error: invalid operand (violates constant bus restrictions)
89
90v_div_fmas_f64 v[0:1], v[2:3], v[4:5], exec
91// CHECK: error: invalid operand (violates constant bus restrictions)
92
93//=====================================================
94// v_cndmask_b32: implicitly reads VCC (VOP2)
95
96v_cndmask_b32 v0, s1, v2, vcc
97// CHECK: error: invalid operand (violates constant bus restrictions)
98
99v_cndmask_b32 v0, flat_scratch_lo, v2, vcc
100// CHECK: error: invalid operand (violates constant bus restrictions)
101
102v_cndmask_b32 v0, flat_scratch_hi, v2, vcc
103// CHECK: error: invalid operand (violates constant bus restrictions)
104
105v_cndmask_b32 v0, exec_lo, v2, vcc
106// CHECK: error: invalid operand (violates constant bus restrictions)
107
108v_cndmask_b32 v0, exec_hi, v2, vcc
109// CHECK: error: invalid operand (violates constant bus restrictions)
110
111//=====================================================
112// v_cndmask_b32_e64: VOP3, no implicit reads
113
114v_cndmask_b32_e64 v0, s1, v2, vcc
115// CHECK: error: invalid operand (violates constant bus restrictions)
116
117v_cndmask_b32_e64 v0, flat_scratch_lo, v2, vcc
118// CHECK: error: invalid operand (violates constant bus restrictions)
119
120v_cndmask_b32_e64 v0, flat_scratch_hi, v2, vcc
121// CHECK: error: invalid operand (violates constant bus restrictions)
122
123v_cndmask_b32_e64 v0, s1, v2, flat_scratch
124// CHECK: error: invalid operand (violates constant bus restrictions)
125
126v_cndmask_b32_e64 v0, s0, v2, s[0:1]
127// CHECK: error: invalid operand (violates constant bus restrictions)
128
129v_cndmask_b32_e64 v0, v2, s0, s[0:1]
130// CHECK: error: invalid operand (violates constant bus restrictions)
131
132v_cndmask_b32_e64 v0, s0, s0, s[0:1]
133// CHECK: error: invalid operand (violates constant bus restrictions)
134
135v_cndmask_b32_e64 v0, s1, v2, s[0:1]
136// CHECK: error: invalid operand (violates constant bus restrictions)
137
138v_cndmask_b32_e64 v0, v2, s1, s[0:1]
139// CHECK: error: invalid operand (violates constant bus restrictions)
140
141v_cndmask_b32_e64 v0, s1, s1, s[0:1]
142// CHECK: error: invalid operand (violates constant bus restrictions)
143
144v_cndmask_b32_e64 v0, s1, v2, s[2:3]
145// CHECK: error: invalid operand (violates constant bus restrictions)
146
147v_cndmask_b32_e64 v0, v2, s1, s[2:3]
148// CHECK: error: invalid operand (violates constant bus restrictions)
149
150v_cndmask_b32_e64 v0, s1, s1, s[2:3]
151// CHECK: error: invalid operand (violates constant bus restrictions)
152
153//=====================================================
154// v_addc_u32: implicitly reads VCC (VOP2 only!)
155
156v_addc_u32 v0, vcc, s0, v0, vcc
157// CHECK: error: invalid operand (violates constant bus restrictions)
158
159v_addc_u32 v0, vcc, flat_scratch_lo, v0, vcc
160// CHECK: error: invalid operand (violates constant bus restrictions)
161
162v_addc_u32 v0, vcc, flat_scratch_hi, v0, vcc
163// CHECK: error: invalid operand (violates constant bus restrictions)
164
165v_addc_u32 v0, vcc, exec_lo, v0, vcc
166// CHECK: error: invalid operand (violates constant bus restrictions)
167
168v_addc_u32 v0, vcc, exec_hi, v0, vcc
169// CHECK: error: invalid operand (violates constant bus restrictions)
170
171//=====================================================
172// v_addc_u32_e64: no implicit read in VOP3
173
174v_addc_u32_e64 v0, s[0:1], s2, v2, vcc
175// CHECK: error: invalid operand (violates constant bus restrictions)
176
177v_addc_u32_e64 v0, s[0:1], v2, s2, vcc
178// CHECK: error: invalid operand (violates constant bus restrictions)
179
180v_addc_u32_e64 v0, s[0:1], s2, s2, vcc
181// CHECK: error: invalid operand (violates constant bus restrictions)
182
183v_addc_u32_e64 v0, s[0:1], s0, v2, s[0:1]
184// CHECK: error: invalid operand (violates constant bus restrictions)
185
186v_addc_u32_e64 v0, s[0:1], v2, s0, s[0:1]
187// CHECK: error: invalid operand (violates constant bus restrictions)
188
189v_addc_u32_e64 v0, s[0:1], s0, s0, s[0:1]
190// CHECK: error: invalid operand (violates constant bus restrictions)
191
192v_addc_u32_e64 v0, s[0:1], s2, v2, s[0:1]
193// CHECK: error: invalid operand (violates constant bus restrictions)
194
195v_addc_u32_e64 v0, s[0:1], v2, s2, s[0:1]
196// CHECK: error: invalid operand (violates constant bus restrictions)
197
198v_addc_u32_e64 v0, s[0:1], s2, s2, s[0:1]
199// CHECK: error: invalid operand (violates constant bus restrictions)
200
201//=====================================================
202// VOP1 w/o implicit reads have no negative test cases on constant bus use
203// VOPC has no negative test cases on constant bus use
204
205//=====================================================
206// madak/madmk: a special case for VOP2 w/o implicit reads
207
208v_madak_f32 v0, s0, v0, 0x11213141
209// CHECK: error: invalid operand (violates constant bus restrictions)
210
211v_madak_f32 v0, flat_scratch_lo, v0, 0x11213141
212// CHECK: error: invalid operand (violates constant bus restrictions)
213
214v_madak_f32 v0, flat_scratch_hi, v0, 0x11213141
215// CHECK: error: invalid operand (violates constant bus restrictions)
216
217v_madak_f32 v0, exec_lo, v0, 0x11213141
218// CHECK: error: invalid operand (violates constant bus restrictions)
219
220v_madak_f32 v0, exec_hi, v0, 0x11213141
221// CHECK: error: invalid operand (violates constant bus restrictions)
222
223v_madak_f32 v0, vcc_lo, v0, 0x11213141
224// CHECK: error: invalid operand (violates constant bus restrictions)
225
226v_madak_f32 v0, vcc_hi, v0, 0x11213141
227// CHECK: error: invalid operand (violates constant bus restrictions)
228
229//=====================================================
230// VOP3 w/o implicit reads
231
232v_mad_f32 v0, s0, s1, s0
233// CHECK: error: invalid operand (violates constant bus restrictions)
234
235v_mad_f32 v0, s1, s0, s0
236// CHECK: error: invalid operand (violates constant bus restrictions)
237
238v_mad_f32 v0, s0, s0, s1
239// CHECK: error: invalid operand (violates constant bus restrictions)
240
241v_mad_f32 v0, s0, s0, flat_scratch_lo
242// CHECK: error: invalid operand (violates constant bus restrictions)
243
244//=====================================================
245// VOP2_e64:
246
247v_add_f32_e64 v0, s0, s1
248// CHECK: error: invalid operand (violates constant bus restrictions)
249
250v_add_f32_e64 v0, s0, flat_scratch_lo
251// CHECK: error: invalid operand (violates constant bus restrictions)
252
253v_add_f32_e64 v0, flat_scratch_hi, s1
254// CHECK: error: invalid operand (violates constant bus restrictions)
255
256v_add_f32_e64 v0, flat_scratch_hi, m0
257// CHECK: error: invalid operand (violates constant bus restrictions)
258
259v_add_f64 v[0:1], s[0:1], s[2:3]
260// CHECK: error: invalid operand (violates constant bus restrictions)
261
262v_add_f64 v[0:1], s[0:1], flat_scratch
263// CHECK: error: invalid operand (violates constant bus restrictions)
264
265v_add_f64 v[0:1], vcc, s[2:3]
266// CHECK: error: invalid operand (violates constant bus restrictions)
267
268//=====================================================
269// VOPC_e64:
270
271v_cmp_eq_f32_e64 s[0:1], s0, s1
272// CHECK: error: invalid operand (violates constant bus restrictions)
273
274v_cmp_eq_f32_e64 s[0:1], s0, flat_scratch_lo
275// CHECK: error: invalid operand (violates constant bus restrictions)
276
277v_cmp_eq_f32_e64 s[0:1], flat_scratch_hi, s1
278// CHECK: error: invalid operand (violates constant bus restrictions)
279
280v_cmp_eq_f32_e64 s[0:1], s0, m0
281// CHECK: error: invalid operand (violates constant bus restrictions)
282
283v_cmp_eq_f64_e64 s[0:1], s[0:1], s[2:3]
284// CHECK: error: invalid operand (violates constant bus restrictions)
285
286v_cmp_eq_f64_e64 s[0:1], s[0:1], flat_scratch
287// CHECK: error: invalid operand (violates constant bus restrictions)
288
289v_cmp_eq_f64_e64 s[0:1], vcc, s[2:3]
290// CHECK: error: invalid operand (violates constant bus restrictions)
291