1// RUN: not llvm-mc -triple aarch64-none-linux-gnu < %s 2> %t
2// RUN: FileCheck --check-prefix=CHECK-ERROR --check-prefix=CHECK-ERROR-ARM64 < %t %s
3
4//------------------------------------------------------------------------------
5// Add/sub (extended register)
6//------------------------------------------------------------------------------
7
8        // Mismatched final register and extend
9        add x2, x3, x5, sxtb
10        add x2, x4, w2, uxtx
11        add x2, x4, w2, lsl #3
12        add w5, w7, x9, sxtx
13// CHECK-ERROR: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
14// CHECK-ERROR:         add x2, x3, x5, sxtb
15// CHECK-ERROR:                         ^
16// CHECK-ERROR: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
17// CHECK-ERROR:         add x2, x4, w2, uxtx
18// CHECK-ERROR:                         ^
19// CHECK-ERROR: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
20// CHECK-ERROR:         add x2, x4, w2, lsl #3
21// CHECK-ERROR:                         ^
22// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
23// CHECK-ERROR:         add w5, w7, x9, sxtx
24// CHECK-ERROR:                     ^
25
26        // Out of range extends
27        add x9, x10, w11, uxtb #-1
28        add x3, x5, w7, uxtb #5
29        sub x9, x15, x2, uxth #5
30// CHECK-ERROR: error: expected integer shift amount
31// CHECK-ERROR:         add x9, x10, w11, uxtb #-1
32// CHECK-ERROR:                                 ^
33// CHECK-ERROR: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
34// CHECK-ERROR:         add x3, x5, w7, uxtb #5
35// CHECK-ERROR:                         ^
36// CHECK-ERROR: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
37// CHECK-ERROR:         sub x9, x15, x2, uxth #5
38// CHECK-ERROR:                          ^
39
40        // Wrong registers on normal variants
41        add xzr, x3, x5, uxtx
42        sub x3, xzr, w9, sxth #1
43        add x1, x2, sp, uxtx
44// CHECK-ERROR: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
45// CHECK-ERROR:         add xzr, x3, x5, uxtx
46// CHECK-ERROR:                          ^
47// CHECK-ERROR: error: invalid operand for instruction
48// CHECK-ERROR:         sub x3, xzr, w9, sxth #1
49// CHECK-ERROR:                 ^
50// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
51// CHECK-ERROR:         add x1, x2, sp, uxtx
52// CHECK-ERROR:                     ^
53
54        // Wrong registers on flag-setting variants
55        adds sp, x3, w2, uxtb
56        adds x3, xzr, x9, uxtx
57        subs x2, x1, sp, uxtx
58        adds x2, x1, sp, uxtb #2
59// CHECK-ERROR: error: invalid operand for instruction
60// CHECK-ERROR:         adds sp, x3, w2, uxtb
61// CHECK-ERROR:              ^
62// CHECK-ERROR: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
63// CHECK-ERROR:         adds x3, xzr, x9, uxtx
64// CHECK-ERROR:                           ^
65// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
66// CHECK-ERROR:         subs x2, x1, sp, uxtx
67// CHECK-ERROR:                      ^
68// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
69// CHECK-ERROR:         adds x2, x1, sp, uxtb #2
70// CHECK-ERROR:                      ^
71
72        // Amount not optional if lsl valid and used
73        add sp, x5, x7, lsl
74// CHECK-ERROR: error: expected #imm after shift specifier
75// CHECK-ERROR:         add sp, x5, x7, lsl
76// CHECK-ERROR:                             ^
77
78//------------------------------------------------------------------------------
79// Add/sub (immediate)
80//------------------------------------------------------------------------------
81
82// Out of range immediates: more than 12 bits
83        add w4, w5, #-4097
84        add w5, w6, #0x1000
85        add w4, w5, #-4096, lsl #12
86        add w5, w6, #0x1000, lsl #12
87// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
88// CHECK-ERROR-NEXT:         add w4, w5, #-4097
89// CHECK-ERROR-NEXT:                     ^
90// CHECK-ERROR-AARCH64-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
91// CHECK-ERROR-AARCH64-NEXT:         add w5, w6, #0x1000
92// CHECK-ERROR-AARCH64-NEXT:                     ^
93// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
94// CHECK-ERROR-NEXT:         add w4, w5, #-4096, lsl #12
95// CHECK-ERROR-NEXT:                     ^
96// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
97// CHECK-ERROR-NEXT:         add w5, w6, #0x1000, lsl #12
98// CHECK-ERROR-NEXT:                     ^
99
100// Only lsl #0 and lsl #12 are allowed
101        add w2, w3, #0x1, lsl #1
102        add w5, w17, #0xfff, lsl #13
103        add w17, w20, #0x1000, lsl #12
104        sub xsp, x34, #0x100, lsl #-1
105// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
106// CHECK-ERROR-NEXT:         add w2, w3, #0x1, lsl #1
107// CHECK-ERROR-NEXT:                                ^
108// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
109// CHECK-ERROR-NEXT:         add w5, w17, #0xfff, lsl #13
110// CHECK-ERROR-NEXT:                                   ^
111// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
112// CHECK-ERROR-NEXT:         add w17, w20, #0x1000, lsl #12
113// CHECK-ERROR-NEXT:                       ^
114// CHECK-ERROR-NEXT: error: only 'lsl #+N' valid after immediate
115// CHECK-ERROR-NEXT:         sub xsp, x34, #0x100, lsl #-1
116// CHECK-ERROR-NEXT:                                    ^
117
118// Incorrect registers (w31 doesn't exist at all, and 31 decodes to sp for these).
119        add w31, w20, #1234
120        add wzr, w20, #0x123
121        add w20, wzr, #0x321
122        add wzr, wzr, #0xfff
123// CHECK-ERROR: error: invalid operand for instruction
124// CHECK-ERROR-NEXT:         add w31, w20, #1234
125// CHECK-ERROR-NEXT:             ^
126// CHECK-ERROR-NEXT: error: invalid operand for instruction
127// CHECK-ERROR-NEXT:         add wzr, w20, #0x123
128// CHECK-ERROR-NEXT:             ^
129// CHECK-ERROR-NEXT: error: invalid operand for instruction
130// CHECK-ERROR-NEXT:         add w20, wzr, #0x321
131// CHECK-ERROR-NEXT:                  ^
132// CHECK-ERROR-NEXT: error: invalid operand for instruction
133// CHECK-ERROR-NEXT:         add wzr, wzr, #0xfff
134// CHECK-ERROR-NEXT:             ^
135
136// Mixed register classes
137        add xsp, w2, #123
138        sub w2, x30, #32
139// CHECK-ERROR: error: invalid operand for instruction
140// CHECK-ERROR-NEXT:         add xsp, w2, #123
141// CHECK-ERROR-NEXT:             ^
142// CHECK-ERROR-NEXT: error: invalid operand for instruction
143// CHECK-ERROR-NEXT:         sub w2, x30, #32
144// CHECK-ERROR-NEXT:                 ^
145
146// Out of range immediate
147        adds w0, w5, #0x10000
148// CHECK-ERROR-AARCH64: error: expected compatible register, symbol or integer in range [0, 4095]
149// CHECK-ERROR-AARCH64-NEXT:         adds w0, w5, #0x10000
150// CHECK-ERROR-AARCH64-NEXT:                      ^
151
152// Wn|WSP should be in second place
153        adds w4, wzr, #0x123
154// ...but wzr is the 31 destination
155        subs wsp, w5, #123
156        subs x5, xzr, #0x456, lsl #12
157// CHECK-ERROR: error: invalid operand for instruction
158// CHECK-ERROR-NEXT:         adds w4, wzr, #0x123
159// CHECK-ERROR-NEXT:                  ^
160// CHECK-ERROR-NEXT: error: invalid operand for instruction
161// CHECK-ERROR-NEXT:         subs wsp, w5, #123
162// CHECK-ERROR-NEXT:              ^
163// CHECK-ERROR-NEXT: error: invalid operand for instruction
164// CHECK-ERROR-NEXT:         subs x5, xzr, #0x456, lsl #12
165// CHECK-ERROR-NEXT:                  ^
166
167        // MOV alias should not accept any fiddling
168        mov x2, xsp, #123
169        mov wsp, w27, #0xfff, lsl #12
170// CHECK-ERROR: error: invalid operand for instruction
171// CHECK-ERROR-NEXT:         mov x2, xsp, #123
172// CHECK-ERROR-NEXT:                      ^
173// CHECK-ERROR-NEXT: error: invalid operand for instruction
174// CHECK-ERROR-NEXT:         mov wsp, w27, #0xfff, lsl #12
175// CHECK-ERROR-NEXT:                       ^
176
177        // A relocation should be provided for symbols
178        add x3, x9, #variable
179        add x3, x9, #variable-16
180// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
181// CHECK-ERROR-NEXT:         add x3, x9, #variable
182// CHECK-ERROR-NEXT:                      ^
183// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
184// CHECK-ERROR-NEXT:         add x3, x9, #variable-16
185// CHECK-ERROR-NEXT:                 ^
186
187        // Relocation on a sub
188        sub x1, x0, :lo12:loc
189// CHECK-ERROR: error: invalid immediate expression
190// CHECK-ERROR:         sub x1, x0, :lo12:loc
191// CHECK-ERROR:                     ^
192
193
194//------------------------------------------------------------------------------
195// Add-subtract (shifted register)
196//------------------------------------------------------------------------------
197
198        add wsp, w1, w2, lsr #3
199        add x4, sp, x9, asr #5
200        add x9, x10, x5, ror #3
201// CHECK-ERROR: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
202// CHECK-ERROR-NEXT:         add wsp, w1, w2, lsr #3
203// CHECK-ERROR-NEXT:                          ^
204// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
205// CHECK-ERROR-NEXT:         add x4, sp, x9, asr #5
206// CHECK-ERROR-NEXT:                         ^
207// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
208// CHECK-ERROR-NEXT:         add x9, x10, x5, ror #3
209// CHECK-ERROR-NEXT:                          ^
210
211        add w1, w2, w3, lsl #-1
212        add w1, w2, w3, lsl #32
213        add w1, w2, w3, lsr #-1
214        add w1, w2, w3, lsr #32
215        add w1, w2, w3, asr #-1
216        add w1, w2, w3, asr #32
217        add x1, x2, x3, lsl #-1
218        add x1, x2, x3, lsl #64
219        add x1, x2, x3, lsr #-1
220        add x1, x2, x3, lsr #64
221        add x1, x2, x3, asr #-1
222        add x1, x2, x3, asr #64
223// CHECK-ERROR: error: expected integer shift amount
224// CHECK-ERROR-NEXT:         add w1, w2, w3, lsl #-1
225// CHECK-ERROR-NEXT:                              ^
226// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
227// CHECK-ERROR-NEXT:         add w1, w2, w3, lsl #32
228// CHECK-ERROR-NEXT:                         ^
229// CHECK-ERROR-NEXT: error: expected integer shift amount
230// CHECK-ERROR-NEXT:         add w1, w2, w3, lsr #-1
231// CHECK-ERROR-NEXT:                              ^
232// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
233// CHECK-ERROR-NEXT:         add w1, w2, w3, lsr #32
234// CHECK-ERROR-NEXT:                         ^
235// CHECK-ERROR-NEXT: error: expected integer shift amount
236// CHECK-ERROR-NEXT:         add w1, w2, w3, asr #-1
237// CHECK-ERROR-NEXT:                              ^
238// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
239// CHECK-ERROR-NEXT:         add w1, w2, w3, asr #32
240// CHECK-ERROR-NEXT:                         ^
241// CHECK-ERROR-NEXT: error: expected integer shift amount
242// CHECK-ERROR-NEXT:         add x1, x2, x3, lsl #-1
243// CHECK-ERROR-NEXT:                              ^
244// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
245// CHECK-ERROR-NEXT:         add x1, x2, x3, lsl #64
246// CHECK-ERROR-NEXT:                         ^
247// CHECK-ERROR-NEXT: error: expected integer shift amount
248// CHECK-ERROR-NEXT:         add x1, x2, x3, lsr #-1
249// CHECK-ERROR-NEXT:                              ^
250// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
251// CHECK-ERROR-NEXT:         add x1, x2, x3, lsr #64
252// CHECK-ERROR-NEXT:                         ^
253// CHECK-ERROR-NEXT: error: expected integer shift amount
254// CHECK-ERROR-NEXT:         add x1, x2, x3, asr #-1
255// CHECK-ERROR-NEXT:                              ^
256// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
257// CHECK-ERROR-NEXT:         add x1, x2, x3, asr #64
258// CHECK-ERROR-NEXT:                         ^
259
260        adds w1, w2, w3, lsl #-1
261        adds w1, w2, w3, lsl #32
262        adds w1, w2, w3, lsr #-1
263        adds w1, w2, w3, lsr #32
264        adds w1, w2, w3, asr #-1
265        adds w1, w2, w3, asr #32
266        adds x1, x2, x3, lsl #-1
267        adds x1, x2, x3, lsl #64
268        adds x1, x2, x3, lsr #-1
269        adds x1, x2, x3, lsr #64
270        adds x1, x2, x3, asr #-1
271        adds x1, x2, x3, asr #64
272// CHECK-ERROR: error: expected integer shift amount
273// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsl #-1
274// CHECK-ERROR-NEXT:                               ^
275// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
276// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsl #32
277// CHECK-ERROR-NEXT:                          ^
278// CHECK-ERROR-NEXT: error: expected integer shift amount
279// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsr #-1
280// CHECK-ERROR-NEXT:                               ^
281// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
282// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsr #32
283// CHECK-ERROR-NEXT:                          ^
284// CHECK-ERROR-NEXT: error: expected integer shift amount
285// CHECK-ERROR-NEXT:         adds w1, w2, w3, asr #-1
286// CHECK-ERROR-NEXT:                               ^
287// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
288// CHECK-ERROR-NEXT:         adds w1, w2, w3, asr #32
289// CHECK-ERROR-NEXT:                          ^
290// CHECK-ERROR-NEXT: error: expected integer shift amount
291// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsl #-1
292// CHECK-ERROR-NEXT:                               ^
293// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
294// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsl #64
295// CHECK-ERROR-NEXT:                          ^
296// CHECK-ERROR-NEXT: error: expected integer shift amount
297// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsr #-1
298// CHECK-ERROR-NEXT:                               ^
299// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
300// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsr #64
301// CHECK-ERROR-NEXT:                          ^
302// CHECK-ERROR-NEXT: error: expected integer shift amount
303// CHECK-ERROR-NEXT:         adds x1, x2, x3, asr #-1
304// CHECK-ERROR-NEXT:                               ^
305// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
306// CHECK-ERROR-NEXT:         adds x1, x2, x3, asr #64
307// CHECK-ERROR-NEXT:                          ^
308
309        sub w1, w2, w3, lsl #-1
310        sub w1, w2, w3, lsl #32
311        sub w1, w2, w3, lsr #-1
312        sub w1, w2, w3, lsr #32
313        sub w1, w2, w3, asr #-1
314        sub w1, w2, w3, asr #32
315        sub x1, x2, x3, lsl #-1
316        sub x1, x2, x3, lsl #64
317        sub x1, x2, x3, lsr #-1
318        sub x1, x2, x3, lsr #64
319        sub x1, x2, x3, asr #-1
320        sub x1, x2, x3, asr #64
321// CHECK-ERROR: error: expected integer shift amount
322// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsl #-1
323// CHECK-ERROR-NEXT:                              ^
324// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
325// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsl #32
326// CHECK-ERROR-NEXT:                         ^
327// CHECK-ERROR-NEXT: error: expected integer shift amount
328// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsr #-1
329// CHECK-ERROR-NEXT:                              ^
330// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
331// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsr #32
332// CHECK-ERROR-NEXT:                         ^
333// CHECK-ERROR-NEXT: error: expected integer shift amount
334// CHECK-ERROR-NEXT:         sub w1, w2, w3, asr #-1
335// CHECK-ERROR-NEXT:                              ^
336// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
337// CHECK-ERROR-NEXT:         sub w1, w2, w3, asr #32
338// CHECK-ERROR-NEXT:                         ^
339// CHECK-ERROR-NEXT: error: expected integer shift amount
340// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsl #-1
341// CHECK-ERROR-NEXT:                              ^
342// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
343// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsl #64
344// CHECK-ERROR-NEXT:                         ^
345// CHECK-ERROR-NEXT: error: expected integer shift amount
346// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsr #-1
347// CHECK-ERROR-NEXT:                              ^
348// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
349// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsr #64
350// CHECK-ERROR-NEXT:                         ^
351// CHECK-ERROR-NEXT: error: expected integer shift amount
352// CHECK-ERROR-NEXT:         sub x1, x2, x3, asr #-1
353// CHECK-ERROR-NEXT:                              ^
354// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
355// CHECK-ERROR-NEXT:         sub x1, x2, x3, asr #64
356// CHECK-ERROR-NEXT:                         ^
357
358        subs w1, w2, w3, lsl #-1
359        subs w1, w2, w3, lsl #32
360        subs w1, w2, w3, lsr #-1
361        subs w1, w2, w3, lsr #32
362        subs w1, w2, w3, asr #-1
363        subs w1, w2, w3, asr #32
364        subs x1, x2, x3, lsl #-1
365        subs x1, x2, x3, lsl #64
366        subs x1, x2, x3, lsr #-1
367        subs x1, x2, x3, lsr #64
368        subs x1, x2, x3, asr #-1
369        subs x1, x2, x3, asr #64
370// CHECK-ERROR: error: expected integer shift amount
371// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsl #-1
372// CHECK-ERROR-NEXT:                               ^
373// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
374// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsl #32
375// CHECK-ERROR-NEXT:                          ^
376// CHECK-ERROR-NEXT: error: expected integer shift amount
377// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsr #-1
378// CHECK-ERROR-NEXT:                               ^
379// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
380// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsr #32
381// CHECK-ERROR-NEXT:                          ^
382// CHECK-ERROR-NEXT: error: expected integer shift amount
383// CHECK-ERROR-NEXT:         subs w1, w2, w3, asr #-1
384// CHECK-ERROR-NEXT:                               ^
385// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
386// CHECK-ERROR-NEXT:         subs w1, w2, w3, asr #32
387// CHECK-ERROR-NEXT:                          ^
388// CHECK-ERROR-NEXT: error: expected integer shift amount
389// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsl #-1
390// CHECK-ERROR-NEXT:                               ^
391// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
392// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsl #64
393// CHECK-ERROR-NEXT:                          ^
394// CHECK-ERROR-NEXT: error: expected integer shift amount
395// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsr #-1
396// CHECK-ERROR-NEXT:                               ^
397// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
398// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsr #64
399// CHECK-ERROR-NEXT:                          ^
400// CHECK-ERROR-NEXT: error: expected integer shift amount
401// CHECK-ERROR-NEXT:         subs x1, x2, x3, asr #-1
402// CHECK-ERROR-NEXT:                               ^
403// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
404// CHECK-ERROR-NEXT:         subs x1, x2, x3, asr #64
405// CHECK-ERROR-NEXT:                          ^
406
407        cmn w9, w10, lsl #-1
408        cmn w9, w10, lsl #32
409        cmn w11, w12, lsr #-1
410        cmn w11, w12, lsr #32
411        cmn w19, wzr, asr #-1
412        cmn wzr, wzr, asr #32
413        cmn x9, x10, lsl #-1
414        cmn x9, x10, lsl #64
415        cmn x11, x12, lsr #-1
416        cmn x11, x12, lsr #64
417        cmn x19, xzr, asr #-1
418        cmn xzr, xzr, asr #64
419// CHECK-ERROR: error: expected integer shift amount
420// CHECK-ERROR-NEXT:         cmn w9, w10, lsl #-1
421// CHECK-ERROR-NEXT:                           ^
422// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
423// CHECK-ERROR-NEXT:         cmn w9, w10, lsl #32
424// CHECK-ERROR-NEXT:                      ^
425// CHECK-ERROR-NEXT: error: expected integer shift amount
426// CHECK-ERROR-NEXT:         cmn w11, w12, lsr #-1
427// CHECK-ERROR-NEXT:                            ^
428// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
429// CHECK-ERROR-NEXT:         cmn w11, w12, lsr #32
430// CHECK-ERROR-NEXT:                       ^
431// CHECK-ERROR-NEXT: error: expected integer shift amount
432// CHECK-ERROR-NEXT:         cmn w19, wzr, asr #-1
433// CHECK-ERROR-NEXT:                            ^
434// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
435// CHECK-ERROR-NEXT:         cmn wzr, wzr, asr #32
436// CHECK-ERROR-NEXT:                       ^
437// CHECK-ERROR-NEXT: error: expected integer shift amount
438// CHECK-ERROR-NEXT:         cmn x9, x10, lsl #-1
439// CHECK-ERROR-NEXT:                           ^
440// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
441// CHECK-ERROR-NEXT:         cmn x9, x10, lsl #64
442// CHECK-ERROR-NEXT:                      ^
443// CHECK-ERROR-NEXT: error: expected integer shift amount
444// CHECK-ERROR-NEXT:         cmn x11, x12, lsr #-1
445// CHECK-ERROR-NEXT:                            ^
446// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
447// CHECK-ERROR-NEXT:         cmn x11, x12, lsr #64
448// CHECK-ERROR-NEXT:                       ^
449// CHECK-ERROR-NEXT: error: expected integer shift amount
450// CHECK-ERROR-NEXT:         cmn x19, xzr, asr #-1
451// CHECK-ERROR-NEXT:                            ^
452// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
453// CHECK-ERROR-NEXT:         cmn xzr, xzr, asr #64
454// CHECK-ERROR-NEXT:                       ^
455
456        cmp w9, w10, lsl #-1
457        cmp w9, w10, lsl #32
458        cmp w11, w12, lsr #-1
459        cmp w11, w12, lsr #32
460        cmp w19, wzr, asr #-1
461        cmp wzr, wzr, asr #32
462        cmp x9, x10, lsl #-1
463        cmp x9, x10, lsl #64
464        cmp x11, x12, lsr #-1
465        cmp x11, x12, lsr #64
466        cmp x19, xzr, asr #-1
467        cmp xzr, xzr, asr #64
468// CHECK-ERROR: error: expected integer shift amount
469// CHECK-ERROR-NEXT:         cmp w9, w10, lsl #-1
470// CHECK-ERROR-NEXT:                           ^
471// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
472// CHECK-ERROR-NEXT:         cmp w9, w10, lsl #32
473// CHECK-ERROR-NEXT:                      ^
474// CHECK-ERROR-NEXT: error: expected integer shift amount
475// CHECK-ERROR-NEXT:         cmp w11, w12, lsr #-1
476// CHECK-ERROR-NEXT:                            ^
477// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
478// CHECK-ERROR-NEXT:         cmp w11, w12, lsr #32
479// CHECK-ERROR-NEXT:                       ^
480// CHECK-ERROR-NEXT: error: expected integer shift amount
481// CHECK-ERROR-NEXT:         cmp w19, wzr, asr #-1
482// CHECK-ERROR-NEXT:                            ^
483// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
484// CHECK-ERROR-NEXT:         cmp wzr, wzr, asr #32
485// CHECK-ERROR-NEXT:                       ^
486// CHECK-ERROR-NEXT: error: expected integer shift amount
487// CHECK-ERROR-NEXT:         cmp x9, x10, lsl #-1
488// CHECK-ERROR-NEXT:                           ^
489// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
490// CHECK-ERROR-NEXT:         cmp x9, x10, lsl #64
491// CHECK-ERROR-NEXT:                      ^
492// CHECK-ERROR-NEXT: error: expected integer shift amount
493// CHECK-ERROR-NEXT:         cmp x11, x12, lsr #-1
494// CHECK-ERROR-NEXT:                            ^
495// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
496// CHECK-ERROR-NEXT:         cmp x11, x12, lsr #64
497// CHECK-ERROR-NEXT:                       ^
498// CHECK-ERROR-NEXT: error: expected integer shift amount
499// CHECK-ERROR-NEXT:         cmp x19, xzr, asr #-1
500// CHECK-ERROR-NEXT:                            ^
501// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
502// CHECK-ERROR-NEXT:         cmp xzr, xzr, asr #64
503// CHECK-ERROR-NEXT:                       ^
504
505        neg w9, w10, lsl #-1
506        neg w9, w10, lsl #32
507        neg w11, w12, lsr #-1
508        neg w11, w12, lsr #32
509        neg w19, wzr, asr #-1
510        neg wzr, wzr, asr #32
511        neg x9, x10, lsl #-1
512        neg x9, x10, lsl #64
513        neg x11, x12, lsr #-1
514        neg x11, x12, lsr #64
515        neg x19, xzr, asr #-1
516        neg xzr, xzr, asr #64
517// CHECK-ERROR: error: expected integer shift amount
518// CHECK-ERROR-NEXT:         neg w9, w10, lsl #-1
519// CHECK-ERROR-NEXT:                           ^
520// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
521// CHECK-ERROR-NEXT:         neg w9, w10, lsl #32
522// CHECK-ERROR-NEXT:                      ^
523// CHECK-ERROR-NEXT: error: expected integer shift amount
524// CHECK-ERROR-NEXT:         neg w11, w12, lsr #-1
525// CHECK-ERROR-NEXT:                            ^
526// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
527// CHECK-ERROR-NEXT:         neg w11, w12, lsr #32
528// CHECK-ERROR-NEXT:                       ^
529// CHECK-ERROR-NEXT: error: expected integer shift amount
530// CHECK-ERROR-NEXT:         neg w19, wzr, asr #-1
531// CHECK-ERROR-NEXT:                            ^
532// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
533// CHECK-ERROR-NEXT:         neg wzr, wzr, asr #32
534// CHECK-ERROR-NEXT:                       ^
535// CHECK-ERROR-NEXT: error: expected integer shift amount
536// CHECK-ERROR-NEXT:         neg x9, x10, lsl #-1
537// CHECK-ERROR-NEXT:                           ^
538// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
539// CHECK-ERROR-NEXT:         neg x9, x10, lsl #64
540// CHECK-ERROR-NEXT:                      ^
541// CHECK-ERROR-NEXT: error: expected integer shift amount
542// CHECK-ERROR-NEXT:         neg x11, x12, lsr #-1
543// CHECK-ERROR-NEXT:                            ^
544// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
545// CHECK-ERROR-NEXT:         neg x11, x12, lsr #64
546// CHECK-ERROR-NEXT:                       ^
547// CHECK-ERROR-NEXT: error: expected integer shift amount
548// CHECK-ERROR-NEXT:         neg x19, xzr, asr #-1
549// CHECK-ERROR-NEXT:                            ^
550// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
551// CHECK-ERROR-NEXT:         neg xzr, xzr, asr #64
552// CHECK-ERROR-NEXT:                       ^
553
554        negs w9, w10, lsl #-1
555        negs w9, w10, lsl #32
556        negs w11, w12, lsr #-1
557        negs w11, w12, lsr #32
558        negs w19, wzr, asr #-1
559        negs wzr, wzr, asr #32
560        negs x9, x10, lsl #-1
561        negs x9, x10, lsl #64
562        negs x11, x12, lsr #-1
563        negs x11, x12, lsr #64
564        negs x19, xzr, asr #-1
565        negs xzr, xzr, asr #64
566// CHECK-ERROR: error: expected integer shift amount
567// CHECK-ERROR-NEXT:         negs w9, w10, lsl #-1
568// CHECK-ERROR-NEXT:                            ^
569// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
570// CHECK-ERROR-NEXT:         negs w9, w10, lsl #32
571// CHECK-ERROR-NEXT:                       ^
572// CHECK-ERROR-NEXT: error: expected integer shift amount
573// CHECK-ERROR-NEXT:         negs w11, w12, lsr #-1
574// CHECK-ERROR-NEXT:                             ^
575// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
576// CHECK-ERROR-NEXT:         negs w11, w12, lsr #32
577// CHECK-ERROR-NEXT:                        ^
578// CHECK-ERROR-NEXT: error: expected integer shift amount
579// CHECK-ERROR-NEXT:         negs w19, wzr, asr #-1
580// CHECK-ERROR-NEXT:                             ^
581// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
582// CHECK-ERROR-NEXT:         negs wzr, wzr, asr #32
583// CHECK-ERROR-NEXT:                        ^
584// CHECK-ERROR-NEXT: error: expected integer shift amount
585// CHECK-ERROR-NEXT:         negs x9, x10, lsl #-1
586// CHECK-ERROR-NEXT:                            ^
587// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
588// CHECK-ERROR-NEXT:         negs x9, x10, lsl #64
589// CHECK-ERROR-NEXT:                       ^
590// CHECK-ERROR-NEXT: error: expected integer shift amount
591// CHECK-ERROR-NEXT:         negs x11, x12, lsr #-1
592// CHECK-ERROR-NEXT:                             ^
593// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
594// CHECK-ERROR-NEXT:         negs x11, x12, lsr #64
595// CHECK-ERROR-NEXT:                        ^
596// CHECK-ERROR-NEXT: error: expected integer shift amount
597// CHECK-ERROR-NEXT:         negs x19, xzr, asr #-1
598// CHECK-ERROR-NEXT:                             ^
599// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
600// CHECK-ERROR-NEXT:         negs xzr, xzr, asr #64
601// CHECK-ERROR-NEXT:                        ^
602
603//------------------------------------------------------------------------------
604// Add-subtract (shifted register)
605//------------------------------------------------------------------------------
606
607        adc wsp, w3, w5
608        adc w1, wsp, w2
609        adc w0, w10, wsp
610// CHECK-ERROR: error: invalid operand for instruction
611// CHECK-ERROR-NEXT:        adc wsp, w3, w5
612// CHECK-ERROR-NEXT:            ^
613// CHECK-ERROR-NEXT: error: invalid operand for instruction
614// CHECK-ERROR-NEXT:         adc w1, wsp, w2
615// CHECK-ERROR-NEXT:                 ^
616// CHECK-ERROR-NEXT: error: invalid operand for instruction
617// CHECK-ERROR-NEXT:         adc w0, w10, wsp
618// CHECK-ERROR-NEXT:                      ^
619
620        adc sp, x3, x5
621        adc x1, sp, x2
622        adc x0, x10, sp
623// CHECK-ERROR: error: invalid operand for instruction
624// CHECK-ERROR-NEXT:         adc sp, x3, x5
625// CHECK-ERROR-NEXT:             ^
626// CHECK-ERROR-NEXT: error: invalid operand for instruction
627// CHECK-ERROR-NEXT:         adc x1, sp, x2
628// CHECK-ERROR-NEXT:                 ^
629// CHECK-ERROR-NEXT: error: invalid operand for instruction
630// CHECK-ERROR-NEXT:         adc x0, x10, sp
631// CHECK-ERROR-NEXT:                      ^
632
633        adcs wsp, w3, w5
634        adcs w1, wsp, w2
635        adcs w0, w10, wsp
636// CHECK-ERROR: error: invalid operand for instruction
637// CHECK-ERROR-NEXT:         adcs wsp, w3, w5
638// CHECK-ERROR-NEXT:              ^
639// CHECK-ERROR-NEXT: error: invalid operand for instruction
640// CHECK-ERROR-NEXT:         adcs w1, wsp, w2
641// CHECK-ERROR-NEXT:                  ^
642// CHECK-ERROR-NEXT: error: invalid operand for instruction
643// CHECK-ERROR-NEXT:         adcs w0, w10, wsp
644// CHECK-ERROR-NEXT:                       ^
645
646        adcs sp, x3, x5
647        adcs x1, sp, x2
648        adcs x0, x10, sp
649// CHECK-ERROR: error: invalid operand for instruction
650// CHECK-ERROR-NEXT:         adcs sp, x3, x5
651// CHECK-ERROR-NEXT:              ^
652// CHECK-ERROR-NEXT: error: invalid operand for instruction
653// CHECK-ERROR-NEXT:         adcs x1, sp, x2
654// CHECK-ERROR-NEXT:                  ^
655// CHECK-ERROR-NEXT: error: invalid operand for instruction
656// CHECK-ERROR-NEXT:         adcs x0, x10, sp
657// CHECK-ERROR-NEXT:                       ^
658
659        sbc wsp, w3, w5
660        sbc w1, wsp, w2
661        sbc w0, w10, wsp
662// CHECK-ERROR: error: invalid operand for instruction
663// CHECK-ERROR-NEXT:         sbc wsp, w3, w5
664// CHECK-ERROR-NEXT:             ^
665// CHECK-ERROR-NEXT: error: invalid operand for instruction
666// CHECK-ERROR-NEXT:         sbc w1, wsp, w2
667// CHECK-ERROR-NEXT:                 ^
668// CHECK-ERROR-NEXT: error: invalid operand for instruction
669// CHECK-ERROR-NEXT:         sbc w0, w10, wsp
670// CHECK-ERROR-NEXT:                      ^
671
672        sbc sp, x3, x5
673        sbc x1, sp, x2
674        sbc x0, x10, sp
675// CHECK-ERROR: error: invalid operand for instruction
676// CHECK-ERROR-NEXT:         sbc sp, x3, x5
677// CHECK-ERROR-NEXT:             ^
678// CHECK-ERROR-NEXT: error: invalid operand for instruction
679// CHECK-ERROR-NEXT:         sbc x1, sp, x2
680// CHECK-ERROR-NEXT:                 ^
681// CHECK-ERROR-NEXT: error: invalid operand for instruction
682// CHECK-ERROR-NEXT:         sbc x0, x10, sp
683// CHECK-ERROR-NEXT:                      ^
684
685        sbcs wsp, w3, w5
686        sbcs w1, wsp, w2
687        sbcs w0, w10, wsp
688// CHECK-ERROR: error: invalid operand for instruction
689// CHECK-ERROR-NEXT:         sbcs wsp, w3, w5
690// CHECK-ERROR-NEXT:              ^
691// CHECK-ERROR-NEXT: error: invalid operand for instruction
692// CHECK-ERROR-NEXT:         sbcs w1, wsp, w2
693// CHECK-ERROR-NEXT:                  ^
694// CHECK-ERROR-NEXT: error: invalid operand for instruction
695// CHECK-ERROR-NEXT:         sbcs w0, w10, wsp
696// CHECK-ERROR-NEXT:                       ^
697
698        sbcs sp, x3, x5
699        sbcs x1, sp, x2
700        sbcs x0, x10, sp
701// CHECK-ERROR: error: invalid operand for instruction
702// CHECK-ERROR-NEXT:         sbcs sp, x3, x5
703// CHECK-ERROR-NEXT:              ^
704// CHECK-ERROR-NEXT: error: invalid operand for instruction
705// CHECK-ERROR-NEXT:         sbcs x1, sp, x2
706// CHECK-ERROR-NEXT:                  ^
707// CHECK-ERROR-NEXT: error: invalid operand for instruction
708// CHECK-ERROR-NEXT:         sbcs x0, x10, sp
709// CHECK-ERROR-NEXT:                       ^
710
711        ngc wsp, w3
712        ngc w9, wsp
713        ngc sp, x9
714        ngc x2, sp
715// CHECK-ERROR: error: invalid operand for instruction
716// CHECK-ERROR-NEXT:         ngc wsp, w3
717// CHECK-ERROR-NEXT:             ^
718// CHECK-ERROR-NEXT: error: invalid operand for instruction
719// CHECK-ERROR-NEXT:         ngc w9, wsp
720// CHECK-ERROR-NEXT:                 ^
721// CHECK-ERROR-NEXT: error: invalid operand for instruction
722// CHECK-ERROR-NEXT:         ngc sp, x9
723// CHECK-ERROR-NEXT:             ^
724// CHECK-ERROR-NEXT: error: invalid operand for instruction
725// CHECK-ERROR-NEXT:         ngc x2, sp
726// CHECK-ERROR-NEXT:                 ^
727
728        ngcs wsp, w3
729        ngcs w9, wsp
730        ngcs sp, x9
731        ngcs x2, sp
732// CHECK-ERROR: error: invalid operand for instruction
733// CHECK-ERROR-NEXT:         ngcs wsp, w3
734// CHECK-ERROR-NEXT:              ^
735// CHECK-ERROR-NEXT: error: invalid operand for instruction
736// CHECK-ERROR-NEXT:         ngcs w9, wsp
737// CHECK-ERROR-NEXT:                  ^
738// CHECK-ERROR-NEXT: error: invalid operand for instruction
739// CHECK-ERROR-NEXT:         ngcs sp, x9
740// CHECK-ERROR-NEXT:              ^
741// CHECK-ERROR-NEXT: error: invalid operand for instruction
742// CHECK-ERROR-NEXT:         ngcs x2, sp
743// CHECK-ERROR-NEXT:                  ^
744
745//------------------------------------------------------------------------------
746// Logical (immediates)
747//------------------------------------------------------------------------------
748
749        and w2, w3, #4294967296
750        eor w2, w3, #4294967296
751        orr w2, w3, #4294967296
752        ands w2, w3, #4294967296
753// CHECK-ERROR: error: expected compatible register or logical immediate
754// CHECK-ERROR-NEXT:         and w2, w3, #4294967296
755// CHECK-ERROR-NEXT:                     ^
756// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
757// CHECK-ERROR-NEXT:         eor w2, w3, #4294967296
758// CHECK-ERROR-NEXT:                     ^
759// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
760// CHECK-ERROR-NEXT:         orr w2, w3, #4294967296
761// CHECK-ERROR-NEXT:                     ^
762// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
763// CHECK-ERROR-NEXT:         ands w2, w3, #4294967296
764// CHECK-ERROR-NEXT:                      ^
765
766//------------------------------------------------------------------------------
767// Bitfield
768//------------------------------------------------------------------------------
769
770        sbfm x3, w13, #0, #0
771        sbfm w12, x9, #0, #0
772        sbfm sp, x3, #3, #5
773        sbfm w3, wsp, #1, #9
774        sbfm x9, x5, #-1, #0
775        sbfm x9, x5, #0, #-1
776// CHECK-ERROR: error: invalid operand for instruction
777// CHECK-ERROR-NEXT:         sbfm x3, w13, #0, #0
778// CHECK-ERROR-NEXT:                  ^
779// CHECK-ERROR-NEXT: error: invalid operand for instruction
780// CHECK-ERROR-NEXT:         sbfm w12, x9, #0, #0
781// CHECK-ERROR-NEXT:                   ^
782// CHECK-ERROR-NEXT: error: invalid operand for instruction
783// CHECK-ERROR-NEXT:         sbfm sp, x3, #3, #5
784// CHECK-ERROR-NEXT:              ^
785// CHECK-ERROR-NEXT: error: invalid operand for instruction
786// CHECK-ERROR-NEXT:         sbfm w3, wsp, #1, #9
787// CHECK-ERROR-NEXT:                  ^
788// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
789// CHECK-ERROR-NEXT:         sbfm x9, x5, #-1, #0
790// CHECK-ERROR-NEXT:                      ^
791// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
792// CHECK-ERROR-NEXT:         sbfm x9, x5, #0, #-1
793// CHECK-ERROR-NEXT:                          ^
794
795        sbfm w3, w5, #32, #1
796        sbfm w7, w11, #19, #32
797        sbfm x29, x30, #64, #0
798        sbfm x10, x20, #63, #64
799// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
800// CHECK-ERROR-NEXT:         sbfm w3, w5, #32, #1
801// CHECK-ERROR-NEXT:                      ^
802// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
803// CHECK-ERROR-NEXT:         sbfm w7, w11, #19, #32
804// CHECK-ERROR-NEXT:                            ^
805// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
806// CHECK-ERROR-NEXT:         sbfm x29, x30, #64, #0
807// CHECK-ERROR-NEXT:                        ^
808// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
809// CHECK-ERROR-NEXT:         sbfm x10, x20, #63, #64
810// CHECK-ERROR-NEXT:                             ^
811
812        ubfm w3, w5, #32, #1
813        ubfm w7, w11, #19, #32
814        ubfm x29, x30, #64, #0
815        ubfm x10, x20, #63, #64
816// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
817// CHECK-ERROR-NEXT:         ubfm w3, w5, #32, #1
818// CHECK-ERROR-NEXT:                      ^
819// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
820// CHECK-ERROR-NEXT:         ubfm w7, w11, #19, #32
821// CHECK-ERROR-NEXT:                            ^
822// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
823// CHECK-ERROR-NEXT:         ubfm x29, x30, #64, #0
824// CHECK-ERROR-NEXT:                        ^
825// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
826// CHECK-ERROR-NEXT:         ubfm x10, x20, #63, #64
827// CHECK-ERROR-NEXT:                             ^
828
829        bfm w3, w5, #32, #1
830        bfm w7, w11, #19, #32
831        bfm x29, x30, #64, #0
832        bfm x10, x20, #63, #64
833// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
834// CHECK-ERROR-NEXT:         bfm w3, w5, #32, #1
835// CHECK-ERROR-NEXT:                      ^
836// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
837// CHECK-ERROR-NEXT:         bfm w7, w11, #19, #32
838// CHECK-ERROR-NEXT:                            ^
839// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
840// CHECK-ERROR-NEXT:         bfm x29, x30, #64, #0
841// CHECK-ERROR-NEXT:                        ^
842// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
843// CHECK-ERROR-NEXT:         bfm x10, x20, #63, #64
844// CHECK-ERROR-NEXT:                             ^
845
846        sxtb x3, x2
847        sxth xzr, xzr
848        sxtw x3, x5
849// CHECK-ERROR-AARCH64: error: invalid operand for instruction
850// CHECK-ERROR-AARCH64-NEXT:         sxtb x3, x2
851// CHECK-ERROR-AARCH64-NEXT:                  ^
852// CHECK-ERROR-AARCH64-NEXT: error: invalid operand for instruction
853// CHECK-ERROR-AARCH64-NEXT:         sxth xzr, xzr
854// CHECK-ERROR-AARCH64-NEXT:                   ^
855// CHECK-ERROR-AARCH64-NEXT: error: invalid operand for instruction
856// CHECK-ERROR-AARCH64-NEXT:         sxtw x3, x5
857// CHECK-ERROR-AARCH64-NEXT:                  ^
858
859        uxtb x3, x12
860        uxth x5, x9
861        uxtw x3, x5
862        uxtb x2, sp
863        uxtb sp, xzr
864// CHECK-ERROR: error: invalid operand for instruction
865// CHECK-ERROR-NEXT:         uxtb x3, x12
866// CHECK-ERROR-NEXT:                  ^
867// CHECK-ERROR-NEXT: error: invalid operand for instruction
868// CHECK-ERROR-NEXT:         uxth x5, x9
869// CHECK-ERROR-NEXT:                  ^
870// CHECK-ERROR-AARCH64-NEXT: error: invalid instruction
871// CHECK-ERROR-AARCH64-NEXT:         uxtw x3, x5
872// CHECK-ERROR-AARCH64-NEXT:         ^
873// CHECK-ERROR-NEXT: error: invalid operand for instruction
874// CHECK-ERROR-NEXT:         uxtb x2, sp
875// CHECK-ERROR-NEXT:                  ^
876// CHECK-ERROR-NEXT: error: invalid operand for instruction
877// CHECK-ERROR-NEXT:         uxtb sp, xzr
878// CHECK-ERROR-NEXT:              ^
879
880        asr x3, w2, #1
881        asr sp, x2, #1
882        asr x25, x26, #-1
883        asr x25, x26, #64
884        asr w9, w8, #32
885// CHECK-ERROR: error: invalid operand for instruction
886// CHECK-ERROR-NEXT:         asr x3, w2, #1
887// CHECK-ERROR-NEXT:                 ^
888// CHECK-ERROR-NEXT: error: invalid operand for instruction
889// CHECK-ERROR-NEXT:         asr sp, x2, #1
890// CHECK-ERROR-NEXT:             ^
891// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
892// CHECK-ERROR-NEXT:         asr x25, x26, #-1
893// CHECK-ERROR-NEXT:                       ^
894// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
895// CHECK-ERROR-NEXT:         asr x25, x26, #64
896// CHECK-ERROR-NEXT:                       ^
897// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
898// CHECK-ERROR-NEXT:         asr w9, w8, #32
899// CHECK-ERROR-NEXT:                     ^
900
901        sbfiz w1, w2, #0, #0
902        sbfiz wsp, w9, #0, #1
903        sbfiz w9, w10, #32, #1
904        sbfiz w11, w12, #32, #0
905        sbfiz w9, w10, #10, #23
906        sbfiz x3, x5, #12, #53
907        sbfiz sp, x3, #7, #6
908        sbfiz w3, wsp, #10, #8
909// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
910// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
911// CHECK-ERROR-NEXT:         sbfiz w1, w2, #0, #0
912// CHECK-ERROR-NEXT:                           ^
913// CHECK-ERROR-NEXT: error: invalid operand for instruction
914// CHECK-ERROR-NEXT:         sbfiz wsp, w9, #0, #1
915// CHECK-ERROR-NEXT:               ^
916// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
917// CHECK-ERROR-NEXT:         sbfiz w9, w10, #32, #1
918// CHECK-ERROR-NEXT:                        ^
919// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
920// CHECK-ERROR-NEXT:         sbfiz w11, w12, #32, #0
921// CHECK-ERROR-NEXT:                         ^
922// CHECK-ERROR-NEXT: error: requested insert overflows register
923// CHECK-ERROR-NEXT:         sbfiz w9, w10, #10, #23
924// CHECK-ERROR-NEXT:                             ^
925// CHECK-ERROR-NEXT: error: requested insert overflows register
926// CHECK-ERROR-NEXT:         sbfiz x3, x5, #12, #53
927// CHECK-ERROR-NEXT:                            ^
928// CHECK-ERROR-NEXT: error: invalid operand for instruction
929// CHECK-ERROR-NEXT:         sbfiz sp, x3, #7, #6
930// CHECK-ERROR-NEXT:               ^
931// CHECK-ERROR-NEXT: error: invalid operand for instruction
932// CHECK-ERROR-NEXT:         sbfiz w3, wsp, #10, #8
933// CHECK-ERROR-NEXT:                   ^
934
935        sbfx w1, w2, #0, #0
936        sbfx wsp, w9, #0, #1
937        sbfx w9, w10, #32, #1
938        sbfx w11, w12, #32, #0
939        sbfx w9, w10, #10, #23
940        sbfx x3, x5, #12, #53
941        sbfx sp, x3, #7, #6
942        sbfx w3, wsp, #10, #8
943// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
944// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
945// CHECK-ERROR-NEXT:         sbfx w1, w2, #0, #0
946// CHECK-ERROR-NEXT:                          ^
947// CHECK-ERROR-NEXT: error: invalid operand for instruction
948// CHECK-ERROR-NEXT:         sbfx wsp, w9, #0, #1
949// CHECK-ERROR-NEXT:              ^
950// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
951// CHECK-ERROR-NEXT:         sbfx w9, w10, #32, #1
952// CHECK-ERROR-NEXT:                       ^
953// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
954// CHECK-ERROR-NEXT:         sbfx w11, w12, #32, #0
955// CHECK-ERROR-NEXT:                        ^
956// CHECK-ERROR-NEXT: error: requested extract overflows register
957// CHECK-ERROR-NEXT:         sbfx w9, w10, #10, #23
958// CHECK-ERROR-NEXT:                            ^
959// CHECK-ERROR-NEXT: error: requested extract overflows register
960// CHECK-ERROR-NEXT:         sbfx x3, x5, #12, #53
961// CHECK-ERROR-NEXT:                           ^
962// CHECK-ERROR-NEXT: error: invalid operand for instruction
963// CHECK-ERROR-NEXT:         sbfx sp, x3, #7, #6
964// CHECK-ERROR-NEXT:              ^
965// CHECK-ERROR-NEXT: error: invalid operand for instruction
966// CHECK-ERROR-NEXT:         sbfx w3, wsp, #10, #8
967// CHECK-ERROR-NEXT:                  ^
968
969        bfi w1, w2, #0, #0
970        bfi wsp, w9, #0, #1
971        bfi w9, w10, #32, #1
972        bfi w11, w12, #32, #0
973        bfi w9, w10, #10, #23
974        bfi x3, x5, #12, #53
975        bfi sp, x3, #7, #6
976        bfi w3, wsp, #10, #8
977// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
978// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
979// CHECK-ERROR-NEXT:         bfi w1, w2, #0, #0
980// CHECK-ERROR-NEXT:                         ^
981// CHECK-ERROR-NEXT: error: invalid operand for instruction
982// CHECK-ERROR-NEXT:         bfi wsp, w9, #0, #1
983// CHECK-ERROR-NEXT:             ^
984// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
985// CHECK-ERROR-NEXT:         bfi w9, w10, #32, #1
986// CHECK-ERROR-NEXT:                      ^
987// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
988// CHECK-ERROR-NEXT:         bfi w11, w12, #32, #0
989// CHECK-ERROR-NEXT:                       ^
990// CHECK-ERROR-NEXT: error: requested insert overflows register
991// CHECK-ERROR-NEXT:         bfi w9, w10, #10, #23
992// CHECK-ERROR-NEXT:                           ^
993// CHECK-ERROR-NEXT: error: requested insert overflows register
994// CHECK-ERROR-NEXT:         bfi x3, x5, #12, #53
995// CHECK-ERROR-NEXT:                          ^
996// CHECK-ERROR-NEXT: error: invalid operand for instruction
997// CHECK-ERROR-NEXT:         bfi sp, x3, #7, #6
998// CHECK-ERROR-NEXT:             ^
999// CHECK-ERROR-NEXT: error: invalid operand for instruction
1000// CHECK-ERROR-NEXT:         bfi w3, wsp, #10, #8
1001// CHECK-ERROR-NEXT:                 ^
1002
1003        bfxil w1, w2, #0, #0
1004        bfxil wsp, w9, #0, #1
1005        bfxil w9, w10, #32, #1
1006        bfxil w11, w12, #32, #0
1007        bfxil w9, w10, #10, #23
1008        bfxil x3, x5, #12, #53
1009        bfxil sp, x3, #7, #6
1010        bfxil w3, wsp, #10, #8
1011// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
1012// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
1013// CHECK-ERROR-NEXT:         bfxil w1, w2, #0, #0
1014// CHECK-ERROR-NEXT:                           ^
1015// CHECK-ERROR-NEXT: error: invalid operand for instruction
1016// CHECK-ERROR-NEXT:         bfxil wsp, w9, #0, #1
1017// CHECK-ERROR-NEXT:               ^
1018// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1019// CHECK-ERROR-NEXT:         bfxil w9, w10, #32, #1
1020// CHECK-ERROR-NEXT:                        ^
1021// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1022// CHECK-ERROR-NEXT:         bfxil w11, w12, #32, #0
1023// CHECK-ERROR-NEXT:                         ^
1024// CHECK-ERROR-NEXT: error: requested extract overflows register
1025// CHECK-ERROR-NEXT:         bfxil w9, w10, #10, #23
1026// CHECK-ERROR-NEXT:                             ^
1027// CHECK-ERROR-NEXT: error: requested extract overflows register
1028// CHECK-ERROR-NEXT:         bfxil x3, x5, #12, #53
1029// CHECK-ERROR-NEXT:                            ^
1030// CHECK-ERROR-NEXT: error: invalid operand for instruction
1031// CHECK-ERROR-NEXT:         bfxil sp, x3, #7, #6
1032// CHECK-ERROR-NEXT:               ^
1033// CHECK-ERROR-NEXT: error: invalid operand for instruction
1034// CHECK-ERROR-NEXT:         bfxil w3, wsp, #10, #8
1035// CHECK-ERROR-NEXT:                   ^
1036
1037        ubfiz w1, w2, #0, #0
1038        ubfiz wsp, w9, #0, #1
1039        ubfiz w9, w10, #32, #1
1040        ubfiz w11, w12, #32, #0
1041        ubfiz w9, w10, #10, #23
1042        ubfiz x3, x5, #12, #53
1043        ubfiz sp, x3, #7, #6
1044        ubfiz w3, wsp, #10, #8
1045// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
1046// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
1047// CHECK-ERROR-NEXT:         ubfiz w1, w2, #0, #0
1048// CHECK-ERROR-NEXT:                           ^
1049// CHECK-ERROR-NEXT: error: invalid operand for instruction
1050// CHECK-ERROR-NEXT:         ubfiz wsp, w9, #0, #1
1051// CHECK-ERROR-NEXT:               ^
1052// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1053// CHECK-ERROR-NEXT:         ubfiz w9, w10, #32, #1
1054// CHECK-ERROR-NEXT:                        ^
1055// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1056// CHECK-ERROR-NEXT:         ubfiz w11, w12, #32, #0
1057// CHECK-ERROR-NEXT:                         ^
1058// CHECK-ERROR-NEXT: error: requested insert overflows register
1059// CHECK-ERROR-NEXT:         ubfiz w9, w10, #10, #23
1060// CHECK-ERROR-NEXT:                             ^
1061// CHECK-ERROR-NEXT: error: requested insert overflows register
1062// CHECK-ERROR-NEXT:         ubfiz x3, x5, #12, #53
1063// CHECK-ERROR-NEXT:                            ^
1064// CHECK-ERROR-NEXT: error: invalid operand for instruction
1065// CHECK-ERROR-NEXT:         ubfiz sp, x3, #7, #6
1066// CHECK-ERROR-NEXT:               ^
1067// CHECK-ERROR-NEXT: error: invalid operand for instruction
1068// CHECK-ERROR-NEXT:         ubfiz w3, wsp, #10, #8
1069// CHECK-ERROR-NEXT:                   ^
1070
1071        ubfx w1, w2, #0, #0
1072        ubfx wsp, w9, #0, #1
1073        ubfx w9, w10, #32, #1
1074        ubfx w11, w12, #32, #0
1075        ubfx w9, w10, #10, #23
1076        ubfx x3, x5, #12, #53
1077        ubfx sp, x3, #7, #6
1078        ubfx w3, wsp, #10, #8
1079// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
1080// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
1081// CHECK-ERROR-NEXT:         ubfx w1, w2, #0, #0
1082// CHECK-ERROR-NEXT:                      ^
1083// CHECK-ERROR-NEXT: error: invalid operand for instruction
1084// CHECK-ERROR-NEXT:         ubfx wsp, w9, #0, #1
1085// CHECK-ERROR-NEXT:              ^
1086// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1087// CHECK-ERROR-NEXT:         ubfx w9, w10, #32, #1
1088// CHECK-ERROR-NEXT:                       ^
1089// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1090// CHECK-ERROR-NEXT:         ubfx w11, w12, #32, #0
1091// CHECK-ERROR-NEXT:                        ^
1092// CHECK-ERROR-NEXT: error: requested extract overflows register
1093// CHECK-ERROR-NEXT:         ubfx w9, w10, #10, #23
1094// CHECK-ERROR-NEXT:                            ^
1095// CHECK-ERROR-NEXT: error: requested extract overflows register
1096// CHECK-ERROR-NEXT:         ubfx x3, x5, #12, #53
1097// CHECK-ERROR-NEXT:                           ^
1098// CHECK-ERROR-NEXT: error: invalid operand for instruction
1099// CHECK-ERROR-NEXT:         ubfx sp, x3, #7, #6
1100// CHECK-ERROR-NEXT:              ^
1101// CHECK-ERROR-NEXT: error: invalid operand for instruction
1102// CHECK-ERROR-NEXT:         ubfx w3, wsp, #10, #8
1103// CHECK-ERROR-NEXT:                  ^
1104
1105        bfc wsp, #3, #6
1106        bfc w4, #2, #31
1107        bfc sp, #0, #1
1108        bfc x6, #0, #0
1109// CHECK-ERROR: error: invalid operand for instruction
1110// CHECK-ERROR-NEXT:        bfc wsp, #3, #6
1111// CHECK-ERROR-NEXT:            ^
1112// CHECK-ERROR-NEXT: error: requested insert overflows register
1113// CHECK-ERROR-NEXT:         bfc w4, #2, #31
1114// CHECK-ERROR-NEXT:                     ^
1115// CHECK-ERROR-NEXT: error: invalid operand for instruction
1116// CHECK-ERROR-NEXT:         bfc sp, #0, #1
1117// CHECK-ERROR-NEXT:             ^
1118// CHECK-ERROR-NEXT: error: expected integer in range [1, 32]
1119// CHECK-ERROR-NEXT:         bfc x6, #0, #0
1120// CHECK-ERROR-NEXT:                     ^
1121
1122//------------------------------------------------------------------------------
1123// Compare & branch (immediate)
1124//------------------------------------------------------------------------------
1125
1126        cbnz wsp, lbl
1127        cbz  sp, lbl
1128        cbz  x3, x5
1129// CHECK-ERROR: error: invalid operand for instruction
1130// CHECK-ERROR-NEXT:           cbnz wsp, lbl
1131// CHECK-ERROR-NEXT:                ^
1132// CHECK-ERROR-NEXT: error: invalid operand for instruction
1133// CHECK-ERROR-NEXT:           cbz sp, lbl
1134// CHECK-ERROR-NEXT:               ^
1135// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1136// CHECK-ERROR-NEXT:           cbz x3, x5
1137// CHECK-ERROR-NEXT:                   ^
1138
1139        cbz w20, #1048576
1140        cbnz xzr, #-1048580
1141        cbz x29, #1
1142// CHECK-ERROR: error: expected label or encodable integer pc offset
1143// CHECK-ERROR-NEXT:           cbz w20, #1048576
1144// CHECK-ERROR-NEXT:                     ^
1145// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1146// CHECK-ERROR-NEXT:           cbnz xzr, #-1048580
1147// CHECK-ERROR-NEXT:                    ^
1148// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1149// CHECK-ERROR-NEXT:           cbz x29, #1
1150// CHECK-ERROR-NEXT:                    ^
1151
1152//------------------------------------------------------------------------------
1153// Conditional branch (immediate)
1154//------------------------------------------------------------------------------
1155
1156        b.zf lbl
1157// CHECK-ERROR: error: invalid condition code
1158// CHECK-ERROR-NEXT:           b.zf lbl
1159// CHECK-ERROR-NEXT:             ^
1160
1161        b.eq #1048576
1162        b.ge #-1048580
1163        b.cc #1
1164// CHECK-ERROR: error: expected label or encodable integer pc offset
1165// CHECK-ERROR-NEXT:           b.eq #1048576
1166// CHECK-ERROR-NEXT:                ^
1167// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1168// CHECK-ERROR-NEXT:           b.ge #-1048580
1169// CHECK-ERROR-NEXT:                ^
1170// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1171// CHECK-ERROR-NEXT:           b.cc #1
1172// CHECK-ERROR-NEXT:                ^
1173
1174//------------------------------------------------------------------------------
1175// Conditional compare (immediate)
1176//------------------------------------------------------------------------------
1177
1178        ccmp wsp, #4, #2, ne
1179        ccmp w25, #-1, #15, hs
1180        ccmp w3, #32, #0, ge
1181        ccmp w19, #5, #-1, lt
1182        ccmp w20, #7, #16, hs
1183// CHECK-ERROR: error: invalid operand for instruction
1184// CHECK-ERROR-NEXT:        ccmp wsp, #4, #2, ne
1185// CHECK-ERROR-NEXT:             ^
1186// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1187// CHECK-ERROR-NEXT:        ccmp w25, #-1, #15, hs
1188// CHECK-ERROR-NEXT:                  ^
1189// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1190// CHECK-ERROR-NEXT:        ccmp w3, #32, #0, ge
1191// CHECK-ERROR-NEXT:                 ^
1192// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1193// CHECK-ERROR-NEXT:        ccmp w19, #5, #-1, lt
1194// CHECK-ERROR-NEXT:                      ^
1195// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1196// CHECK-ERROR-NEXT:        ccmp w20, #7, #16, hs
1197// CHECK-ERROR-NEXT:                      ^
1198
1199        ccmp sp, #4, #2, ne
1200        ccmp x25, #-1, #15, hs
1201        ccmp x3, #32, #0, ge
1202        ccmp x19, #5, #-1, lt
1203        ccmp x20, #7, #16, hs
1204// CHECK-ERROR: error: invalid operand for instruction
1205// CHECK-ERROR-NEXT:        ccmp sp, #4, #2, ne
1206// CHECK-ERROR-NEXT:             ^
1207// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1208// CHECK-ERROR-NEXT:        ccmp x25, #-1, #15, hs
1209// CHECK-ERROR-NEXT:                  ^
1210// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1211// CHECK-ERROR-NEXT:        ccmp x3, #32, #0, ge
1212// CHECK-ERROR-NEXT:                 ^
1213// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1214// CHECK-ERROR-NEXT:        ccmp x19, #5, #-1, lt
1215// CHECK-ERROR-NEXT:                      ^
1216// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1217// CHECK-ERROR-NEXT:        ccmp x20, #7, #16, hs
1218// CHECK-ERROR-NEXT:                      ^
1219
1220        ccmn wsp, #4, #2, ne
1221        ccmn w25, #-1, #15, hs
1222        ccmn w3, #32, #0, ge
1223        ccmn w19, #5, #-1, lt
1224        ccmn w20, #7, #16, hs
1225// CHECK-ERROR: error: invalid operand for instruction
1226// CHECK-ERROR-NEXT:        ccmn wsp, #4, #2, ne
1227// CHECK-ERROR-NEXT:             ^
1228// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1229// CHECK-ERROR-NEXT:        ccmn w25, #-1, #15, hs
1230// CHECK-ERROR-NEXT:                  ^
1231// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1232// CHECK-ERROR-NEXT:        ccmn w3, #32, #0, ge
1233// CHECK-ERROR-NEXT:                 ^
1234// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1235// CHECK-ERROR-NEXT:        ccmn w19, #5, #-1, lt
1236// CHECK-ERROR-NEXT:                      ^
1237// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1238// CHECK-ERROR-NEXT:        ccmn w20, #7, #16, hs
1239// CHECK-ERROR-NEXT:                      ^
1240
1241        ccmn sp, #4, #2, ne
1242        ccmn x25, #-1, #15, hs
1243        ccmn x3, #32, #0, ge
1244        ccmn x19, #5, #-1, lt
1245        ccmn x20, #7, #16, hs
1246// CHECK-ERROR: error: invalid operand for instruction
1247// CHECK-ERROR-NEXT:        ccmn sp, #4, #2, ne
1248// CHECK-ERROR-NEXT:             ^
1249// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1250// CHECK-ERROR-NEXT:        ccmn x25, #-1, #15, hs
1251// CHECK-ERROR-NEXT:                  ^
1252// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1253// CHECK-ERROR-NEXT:        ccmn x3, #32, #0, ge
1254// CHECK-ERROR-NEXT:                 ^
1255// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1256// CHECK-ERROR-NEXT:        ccmn x19, #5, #-1, lt
1257// CHECK-ERROR-NEXT:                      ^
1258// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1259// CHECK-ERROR-NEXT:        ccmn x20, #7, #16, hs
1260// CHECK-ERROR-NEXT:                      ^
1261
1262//------------------------------------------------------------------------------
1263// Conditional compare (register)
1264//------------------------------------------------------------------------------
1265
1266        ccmp wsp, w4, #2, ne
1267        ccmp w3, wsp, #0, ge
1268        ccmp w19, w5, #-1, lt
1269        ccmp w20, w7, #16, hs
1270// CHECK-ERROR: error: invalid operand for instruction
1271// CHECK-ERROR-NEXT:        ccmp wsp, w4, #2, ne
1272// CHECK-ERROR-NEXT:             ^
1273// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1274// CHECK-ERROR-NEXT:        ccmp w3, wsp, #0, ge
1275// CHECK-ERROR-NEXT:                 ^
1276// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1277// CHECK-ERROR-NEXT:        ccmp w19, w5, #-1, lt
1278// CHECK-ERROR-NEXT:                      ^
1279// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1280// CHECK-ERROR-NEXT:        ccmp w20, w7, #16, hs
1281// CHECK-ERROR-NEXT:                      ^
1282
1283        ccmp sp, x4, #2, ne
1284        ccmp x25, sp, #15, hs
1285        ccmp x19, x5, #-1, lt
1286        ccmp x20, x7, #16, hs
1287// CHECK-ERROR: error: invalid operand for instruction
1288// CHECK-ERROR-NEXT:        ccmp sp, x4, #2, ne
1289// CHECK-ERROR-NEXT:             ^
1290// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1291// CHECK-ERROR-NEXT:        ccmp x25, sp, #15, hs
1292// CHECK-ERROR-NEXT:                  ^
1293// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1294// CHECK-ERROR-NEXT:        ccmp x19, x5, #-1, lt
1295// CHECK-ERROR-NEXT:                      ^
1296// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1297// CHECK-ERROR-NEXT:        ccmp x20, x7, #16, hs
1298// CHECK-ERROR-NEXT:                      ^
1299
1300        ccmn wsp, w4, #2, ne
1301        ccmn w25, wsp, #15, hs
1302        ccmn w19, w5, #-1, lt
1303        ccmn w20, w7, #16, hs
1304// CHECK-ERROR: error: invalid operand for instruction
1305// CHECK-ERROR-NEXT:        ccmn wsp, w4, #2, ne
1306// CHECK-ERROR-NEXT:             ^
1307// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1308// CHECK-ERROR-NEXT:        ccmn w25, wsp, #15, hs
1309// CHECK-ERROR-NEXT:                  ^
1310// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1311// CHECK-ERROR-NEXT:        ccmn w19, w5, #-1, lt
1312// CHECK-ERROR-NEXT:                      ^
1313// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1314// CHECK-ERROR-NEXT:        ccmn w20, w7, #16, hs
1315// CHECK-ERROR-NEXT:                      ^
1316
1317        ccmn sp, x4, #2, ne
1318        ccmn x25, sp, #15, hs
1319        ccmn x19, x5, #-1, lt
1320        ccmn x20, x7, #16, hs
1321// CHECK-ERROR: error: invalid operand for instruction
1322// CHECK-ERROR-NEXT:        ccmn sp, x4, #2, ne
1323// CHECK-ERROR-NEXT:             ^
1324// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1325// CHECK-ERROR-NEXT:        ccmn x25, sp, #15, hs
1326// CHECK-ERROR-NEXT:                  ^
1327// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1328// CHECK-ERROR-NEXT:        ccmn x19, x5, #-1, lt
1329// CHECK-ERROR-NEXT:                      ^
1330// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1331// CHECK-ERROR-NEXT:        ccmn x20, x7, #16, hs
1332// CHECK-ERROR-NEXT:                      ^
1333
1334//------------------------------------------------------------------------------
1335// Conditional select
1336//------------------------------------------------------------------------------
1337
1338        csel w4, wsp, w9, eq
1339        csel wsp, w2, w3, ne
1340        csel w10, w11, wsp, ge
1341        csel w1, w2, w3, #3
1342        csel x4, sp, x9, eq
1343        csel sp, x2, x3, ne
1344        csel x10, x11, sp, ge
1345        csel x1, x2, x3, #3
1346// CHECK-ERROR: error: invalid operand for instruction
1347// CHECK-ERROR-NEXT:        csel w4, wsp, w9, eq
1348// CHECK-ERROR-NEXT:                 ^
1349// CHECK-ERROR-NEXT: error: invalid operand for instruction
1350// CHECK-ERROR-NEXT:        csel wsp, w2, w3, ne
1351// CHECK-ERROR-NEXT:             ^
1352// CHECK-ERROR-NEXT: error: invalid operand for instruction
1353// CHECK-ERROR-NEXT:        csel w10, w11, wsp, ge
1354// CHECK-ERROR-NEXT:                       ^
1355// CHECK-ERROR-NEXT: error: expected AArch64 condition code
1356// CHECK-ERROR-NEXT:        csel w1, w2, w3, #3
1357// CHECK-ERROR-NEXT:                         ^
1358// CHECK-ERROR-NEXT: error: invalid operand for instruction
1359// CHECK-ERROR-NEXT:        csel x4, sp, x9, eq
1360// CHECK-ERROR-NEXT:                 ^
1361// CHECK-ERROR-NEXT: error: invalid operand for instruction
1362// CHECK-ERROR-NEXT:        csel sp, x2, x3, ne
1363// CHECK-ERROR-NEXT:             ^
1364// CHECK-ERROR-NEXT: error: invalid operand for instruction
1365// CHECK-ERROR-NEXT:        csel x10, x11, sp, ge
1366// CHECK-ERROR-NEXT:                       ^
1367// CHECK-ERROR-NEXT: error: expected AArch64 condition code
1368// CHECK-ERROR-NEXT:        csel x1, x2, x3, #3
1369// CHECK-ERROR-NEXT:                         ^
1370
1371        csinc w20, w21, wsp, mi
1372        csinc sp, x30, x29, eq
1373// CHECK-ERROR: error: invalid operand for instruction
1374// CHECK-ERROR-NEXT:        csinc w20, w21, wsp, mi
1375// CHECK-ERROR-NEXT:                        ^
1376// CHECK-ERROR-NEXT: error: invalid operand for instruction
1377// CHECK-ERROR-NEXT:        csinc sp, x30, x29, eq
1378// CHECK-ERROR-NEXT:              ^
1379
1380        csinv w20, wsp, wsp, mi
1381        csinv sp, x30, x29, le
1382// CHECK-ERROR: error: invalid operand for instruction
1383// CHECK-ERROR-NEXT:        csinv w20, wsp, wsp, mi
1384// CHECK-ERROR-NEXT:                   ^
1385// CHECK-ERROR-NEXT: error: invalid operand for instruction
1386// CHECK-ERROR-NEXT:        csinv sp, x30, x29, le
1387// CHECK-ERROR-NEXT:              ^
1388
1389        csneg w20, w21, wsp, mi
1390        csneg x0, sp, x29, le
1391// CHECK-ERROR: error: invalid operand for instruction
1392// CHECK-ERROR-NEXT:        csneg w20, w21, wsp, mi
1393// CHECK-ERROR-NEXT:                        ^
1394// CHECK-ERROR-NEXT: error: invalid operand for instruction
1395// CHECK-ERROR-NEXT:        csneg x0, sp, x29, le
1396// CHECK-ERROR-NEXT:                  ^
1397
1398        cset wsp, lt
1399        csetm sp, ge
1400        cset w1, al
1401        csetm x6, nv
1402// CHECK-ERROR: error: invalid operand for instruction
1403// CHECK-ERROR-NEXT:        cset wsp, lt
1404// CHECK-ERROR-NEXT:             ^
1405// CHECK-ERROR-NEXT: error: invalid operand for instruction
1406// CHECK-ERROR-NEXT:        csetm sp, ge
1407// CHECK-ERROR-NEXT:              ^
1408// CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
1409// CHECK-ERROR-NEXT:        cset w1, al
1410// CHECK-ERROR-NEXT:                   ^
1411// CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
1412// CHECK-ERROR-NEXT:        csetm x6, nv
1413// CHECK-ERROR-NEXT:                    ^
1414
1415        cinc w3, wsp, ne
1416        cinc sp, x9, eq
1417        cinc x2, x0, nv
1418// CHECK-ERROR: error: invalid operand for instruction
1419// CHECK-ERROR-NEXT:        cinc w3, wsp, ne
1420// CHECK-ERROR-NEXT:                 ^
1421// CHECK-ERROR-NEXT: error: invalid operand for instruction
1422// CHECK-ERROR-NEXT:        cinc sp, x9, eq
1423// CHECK-ERROR-NEXT:             ^
1424// CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
1425// CHECK-ERROR-NEXT:        cinc x2, x0, nv
1426// CHECK-ERROR-NEXT:                       ^
1427
1428        cinv w3, wsp, ne
1429        cinv sp, x9, eq
1430        cinv w8, x7, nv
1431// CHECK-ERROR: error: invalid operand for instruction
1432// CHECK-ERROR-NEXT:        cinv w3, wsp, ne
1433// CHECK-ERROR-NEXT:                 ^
1434// CHECK-ERROR-NEXT: error: invalid operand for instruction
1435// CHECK-ERROR-NEXT:        cinv sp, x9, eq
1436// CHECK-ERROR-NEXT:             ^
1437// CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
1438// CHECK-ERROR-NEXT:        cinv w8, x7, nv
1439// CHECK-ERROR-NEXT:                       ^
1440
1441        cneg w3, wsp, ne
1442        cneg sp, x9, eq
1443        cneg x4, x5, al
1444// CHECK-ERROR: error: invalid operand for instruction
1445// CHECK-ERROR-NEXT:        cneg w3, wsp, ne
1446// CHECK-ERROR-NEXT:                 ^
1447// CHECK-ERROR-NEXT: error: invalid operand for instruction
1448// CHECK-ERROR-NEXT:        cneg sp, x9, eq
1449// CHECK-ERROR-NEXT:             ^
1450// CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
1451// CHECK-ERROR-NEXT:        cneg x4, x5, al
1452// CHECK-ERROR-NEXT:                       ^
1453
1454//------------------------------------------------------------------------------
1455// Data Processing (1 source)
1456//------------------------------------------------------------------------------
1457        rbit x23, w2
1458//CHECK-ERROR: error: invalid operand for instruction
1459//CHECK-ERROR-NEXT:     rbit x23, w2
1460
1461        cls sp, x2
1462//CHECK-ERROR: error: invalid operand for instruction
1463//CHECK-ERROR-NEXT:     cls sp, x2
1464
1465        clz wsp, w3
1466//CHECK-ERROR: error: invalid operand for instruction
1467//CHECK-ERROR-NEXT:     clz wsp, w3
1468
1469//------------------------------------------------------------------------------
1470// Data Processing (2 sources)
1471//------------------------------------------------------------------------------
1472        udiv x23, w2, x18
1473//CHECK-ERROR: error: invalid operand for instruction
1474//CHECK-ERROR-NEXT:     udiv x23, w2, x18
1475
1476        lsl sp, x2, x4
1477//CHECK-ERROR: error: invalid operand for instruction
1478//CHECK-ERROR-NEXT:     lsl sp, x2, x4
1479
1480        asr wsp, w3, w9
1481//CHECK-ERROR: error: invalid operand for instruction
1482//CHECK-ERROR-NEXT:     asr wsp, w3, w9
1483
1484//------------------------------------------------------------------------------
1485// Data Processing (3 sources)
1486//------------------------------------------------------------------------------
1487
1488        madd sp, x3, x9, x10
1489//CHECK-ERROR: error: invalid operand for instruction
1490//CHECK-ERROR-NEXT:     madd sp, x3, x9, x10
1491
1492//------------------------------------------------------------------------------
1493// Exception generation
1494//------------------------------------------------------------------------------
1495        svc #-1
1496        hlt #65536
1497        dcps4 #43
1498        dcps4
1499// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 65535]
1500// CHECK-ERROR-NEXT:         svc #-1
1501// CHECK-ERROR-NEXT:             ^
1502// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 65535]
1503// CHECK-ERROR-NEXT:         hlt #65536
1504// CHECK-ERROR-NEXT:             ^
1505// CHECK-ERROR-NEXT: error: {{invalid instruction|unrecognized instruction mnemonic}}
1506// CHECK-ERROR-NEXT:         dcps4 #43
1507// CHECK-ERROR-NEXT:         ^
1508// CHECK-ERROR-NEXT: error: {{invalid instruction|unrecognized instruction mnemonic}}
1509// CHECK-ERROR-NEXT:         dcps4
1510// CHECK-ERROR-NEXT:         ^
1511
1512//------------------------------------------------------------------------------
1513// Extract (immediate)
1514//------------------------------------------------------------------------------
1515
1516        extr w2, w20, w30, #-1
1517        extr w9, w19, w20, #32
1518// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1519// CHECK-ERROR-NEXT:         extr w2, w20, w30, #-1
1520// CHECK-ERROR-NEXT:                            ^
1521// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1522// CHECK-ERROR-NEXT:         extr w9, w19, w20, #32
1523// CHECK-ERROR-NEXT:                            ^
1524
1525        extr x10, x15, x20, #-1
1526        extr x20, x25, x30, #64
1527// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
1528// CHECK-ERROR-NEXT:         extr x10, x15, x20, #-1
1529// CHECK-ERROR-NEXT:                             ^
1530// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
1531// CHECK-ERROR-NEXT:         extr x20, x25, x30, #64
1532// CHECK-ERROR-NEXT:                             ^
1533
1534        ror w9, w10, #32
1535        ror x10, x11, #64
1536// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1537// CHECK-ERROR-NEXT:         ror w9, w10, #32
1538// CHECK-ERROR-NEXT:                      ^
1539// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
1540// CHECK-ERROR-NEXT:         ror x10, x11, #64
1541// CHECK-ERROR-NEXT:                       ^
1542
1543//------------------------------------------------------------------------------
1544// Floating-point compare
1545//------------------------------------------------------------------------------
1546
1547        fcmp s3, d2
1548// CHECK-ERROR-AARCH64: error: expected floating-point constant #0.0
1549// CHECK-ERROR-ARM64: error: invalid operand for instruction
1550// CHECK-ERROR-NEXT:         fcmp s3, d2
1551// CHECK-ERROR-NEXT:                  ^
1552
1553        fcmp s9, #-0.0
1554        fcmp d3, #-0.0
1555        fcmp s1, #1.0
1556        fcmpe s30, #-0.0
1557// CHECK-ERROR: error: expected floating-point constant #0.0
1558// CHECK-ERROR-NEXT:         fcmp s9, #-0.0
1559// CHECK-ERROR-NEXT:                  ^
1560// CHECK-ERROR-NEXT: error: expected floating-point constant #0.0
1561// CHECK-ERROR-NEXT:         fcmp d3, #-0.0
1562// CHECK-ERROR-NEXT:                  ^
1563// CHECK-ERROR-NEXT: error: expected floating-point constant #0.0
1564// CHECK-ERROR-NEXT:         fcmp s1, #1.0
1565// CHECK-ERROR-NEXT:                  ^
1566// CHECK-ERROR-NEXT: error: expected floating-point constant #0.0
1567// CHECK-ERROR-NEXT:         fcmpe s30, #-0.0
1568// CHECK-ERROR-NEXT:                    ^
1569
1570//------------------------------------------------------------------------------
1571// Floating-point conditional compare
1572//------------------------------------------------------------------------------
1573
1574        fccmp s19, s5, #-1, lt
1575        fccmp s20, s7, #16, hs
1576// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1577// CHECK-ERROR-NEXT:        fccmp s19, s5, #-1, lt
1578// CHECK-ERROR-NEXT:                      ^
1579// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1580// CHECK-ERROR-NEXT:        fccmp s20, s7, #16, hs
1581// CHECK-ERROR-NEXT:                      ^
1582
1583        fccmp d19, d5, #-1, lt
1584        fccmp d20, d7, #16, hs
1585// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1586// CHECK-ERROR-NEXT:        fccmp d19, d5, #-1, lt
1587// CHECK-ERROR-NEXT:                      ^
1588// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1589// CHECK-ERROR-NEXT:        fccmp d20, d7, #16, hs
1590// CHECK-ERROR-NEXT:                      ^
1591
1592        fccmpe s19, s5, #-1, lt
1593        fccmpe s20, s7, #16, hs
1594// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1595// CHECK-ERROR-NEXT:        fccmpe s19, s5, #-1, lt
1596// CHECK-ERROR-NEXT:                      ^
1597// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1598// CHECK-ERROR-NEXT:        fccmpe s20, s7, #16, hs
1599// CHECK-ERROR-NEXT:                      ^
1600
1601        fccmpe d19, d5, #-1, lt
1602        fccmpe d20, d7, #16, hs
1603// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1604// CHECK-ERROR-NEXT:        fccmpe d19, d5, #-1, lt
1605// CHECK-ERROR-NEXT:                      ^
1606// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
1607// CHECK-ERROR-NEXT:        fccmpe d20, d7, #16, hs
1608// CHECK-ERROR-NEXT:                      ^
1609
1610//------------------------------------------------------------------------------
1611// Floating-point conditional compare
1612//------------------------------------------------------------------------------
1613
1614        fcsel q3, q20, q9, pl
1615        fcsel h9, h10, h11, mi
1616        fcsel b9, b10, b11, mi
1617// CHECK-ERROR: error: invalid operand for instruction
1618// CHECK-ERROR-NEXT:         fcsel q3, q20, q9, pl
1619// CHECK-ERROR-NEXT:               ^
1620// CHECK-ERROR-NEXT: error: instruction requires: fullfp16
1621// CHECK-ERROR-NEXT:         fcsel h9, h10, h11, mi
1622// CHECK-ERROR-NEXT:               ^
1623// CHECK-ERROR-NEXT: error: invalid operand for instruction
1624// CHECK-ERROR-NEXT:         fcsel b9, b10, b11, mi
1625// CHECK-ERROR-NEXT:               ^
1626
1627//------------------------------------------------------------------------------
1628// Floating-point data-processing (1 source)
1629//------------------------------------------------------------------------------
1630
1631        fmov d0, s3
1632        fcvt d0, d1
1633// CHECK-ERROR: error: expected compatible register or floating-point constant
1634// CHECK-ERROR-NEXT:           fmov d0, s3
1635// CHECK-ERROR-NEXT:                    ^
1636// CHECK-ERROR-NEXT: error: invalid operand for instruction
1637// CHECK-ERROR-NEXT:           fcvt d0, d1
1638// CHECK-ERROR-NEXT:                    ^
1639
1640
1641//------------------------------------------------------------------------------
1642// Floating-point data-processing (2 sources)
1643//------------------------------------------------------------------------------
1644
1645        fadd s0, d3, d7
1646        fmaxnm d3, s19, d12
1647        fnmul d1, d9, s18
1648// CHECK-ERROR: error: invalid operand for instruction
1649// CHECK-ERROR-NEXT:           fadd s0, d3, d7
1650// CHECK-ERROR-NEXT: ^
1651// CHECK-ERROR-NEXT: error: invalid operand for instruction
1652// CHECK-ERROR-NEXT:           fmaxnm d3, s19, d12
1653// CHECK-ERROR-NEXT: ^
1654// CHECK-ERROR-NEXT: error: invalid operand for instruction
1655// CHECK-ERROR-NEXT:           fnmul d1, d9, s18
1656// CHECK-ERROR-NEXT: ^
1657
1658//------------------------------------------------------------------------------
1659// Floating-point data-processing (3 sources)
1660//------------------------------------------------------------------------------
1661
1662        fmadd b3, b4, b5, b6
1663        fmsub h1, h2, h3, h4
1664        fnmadd q3, q5, q6, q7
1665        fnmsub s2, s4, d5, h9
1666// CHECK-ERROR: error: invalid operand for instruction
1667// CHECK-ERROR-NEXT:         fmadd b3, b4, b5, b6
1668// CHECK-ERROR-NEXT:               ^
1669// CHECK-ERROR-NEXT: error: instruction requires: fullfp16
1670// CHECK-ERROR-NEXT:         fmsub h1, h2, h3, h4
1671// CHECK-ERROR-NEXT:               ^
1672// CHECK-ERROR-NEXT: error: invalid operand for instruction
1673// CHECK-ERROR-NEXT:         fnmadd q3, q5, q6, q7
1674// CHECK-ERROR-NEXT:                ^
1675// CHECK-ERROR-NEXT: error: invalid operand for instruction
1676// CHECK-ERROR-NEXT:         fnmsub s2, s4, d5, h9
1677// CHECK-ERROR-NEXT:                ^
1678
1679//------------------------------------------------------------------------------
1680// Floating-point conditional compare
1681//------------------------------------------------------------------------------
1682
1683        fcvtzs w13, s31, #0
1684        fcvtzs w19, s20, #33
1685        fcvtzs wsp, s19, #14
1686// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
1687// CHECK-ERROR-NEXT:        fcvtzs w13, s31, #0
1688// CHECK-ERROR-NEXT:                         ^
1689// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
1690// CHECK-ERROR-NEXT:        fcvtzs w19, s20, #33
1691// CHECK-ERROR-NEXT:                         ^
1692// CHECK-ERROR-NEXT: error: invalid operand for instruction
1693// CHECK-ERROR-NEXT:        fcvtzs wsp, s19, #14
1694// CHECK-ERROR-NEXT:               ^
1695
1696        fcvtzs x13, s31, #0
1697        fcvtzs x19, s20, #65
1698        fcvtzs sp, s19, #14
1699// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
1700// CHECK-ERROR-NEXT:        fcvtzs x13, s31, #0
1701// CHECK-ERROR-NEXT:                         ^
1702// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
1703// CHECK-ERROR-NEXT:        fcvtzs x19, s20, #65
1704// CHECK-ERROR-NEXT:                         ^
1705// CHECK-ERROR-NEXT: error: invalid operand for instruction
1706// CHECK-ERROR-NEXT:        fcvtzs sp, s19, #14
1707// CHECK-ERROR-NEXT:               ^
1708
1709        fcvtzu w13, s31, #0
1710        fcvtzu w19, s20, #33
1711        fcvtzu wsp, s19, #14
1712// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
1713// CHECK-ERROR-NEXT:        fcvtzu w13, s31, #0
1714// CHECK-ERROR-NEXT:                         ^
1715// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
1716// CHECK-ERROR-NEXT:        fcvtzu w19, s20, #33
1717// CHECK-ERROR-NEXT:                         ^
1718// CHECK-ERROR-NEXT: error: invalid operand for instruction
1719// CHECK-ERROR-NEXT:        fcvtzu wsp, s19, #14
1720// CHECK-ERROR-NEXT:               ^
1721
1722        fcvtzu x13, s31, #0
1723        fcvtzu x19, s20, #65
1724        fcvtzu sp, s19, #14
1725// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
1726// CHECK-ERROR-NEXT:        fcvtzu x13, s31, #0
1727// CHECK-ERROR-NEXT:                         ^
1728// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
1729// CHECK-ERROR-NEXT:        fcvtzu x19, s20, #65
1730// CHECK-ERROR-NEXT:                         ^
1731// CHECK-ERROR-NEXT: error: invalid operand for instruction
1732// CHECK-ERROR-NEXT:        fcvtzu sp, s19, #14
1733// CHECK-ERROR-NEXT:               ^
1734
1735        scvtf w13, s31, #0
1736        scvtf w19, s20, #33
1737        scvtf wsp, s19, #14
1738// CHECK-ERROR-NEXT: error: invalid operand for instruction
1739// CHECK-ERROR-NEXT:        scvtf w13, s31, #0
1740// CHECK-ERROR-NEXT:              ^
1741// CHECK-ERROR-NEXT: error: invalid operand for instruction
1742// CHECK-ERROR-NEXT:        scvtf w19, s20, #33
1743// CHECK-ERROR-NEXT:              ^
1744// CHECK-ERROR-NEXT: error: invalid operand for instruction
1745// CHECK-ERROR-NEXT:        scvtf wsp, s19, #14
1746// CHECK-ERROR-NEXT:              ^
1747
1748        scvtf x13, s31, #0
1749        scvtf x19, s20, #65
1750        scvtf sp, s19, #14
1751// CHECK-ERROR-NEXT: error: invalid operand for instruction
1752// CHECK-ERROR-NEXT:        scvtf x13, s31, #0
1753// CHECK-ERROR-NEXT:              ^
1754// CHECK-ERROR-NEXT: error: invalid operand for instruction
1755// CHECK-ERROR-NEXT:        scvtf x19, s20, #65
1756// CHECK-ERROR-NEXT:              ^
1757// CHECK-ERROR-NEXT: error: invalid operand for instruction
1758// CHECK-ERROR-NEXT:        scvtf sp, s19, #14
1759// CHECK-ERROR-NEXT:              ^
1760
1761        ucvtf w13, s31, #0
1762        ucvtf w19, s20, #33
1763        ucvtf wsp, s19, #14
1764// CHECK-ERROR-NEXT: error: invalid operand for instruction
1765// CHECK-ERROR-NEXT:        ucvtf w13, s31, #0
1766// CHECK-ERROR-NEXT:              ^
1767// CHECK-ERROR-NEXT: error: invalid operand for instruction
1768// CHECK-ERROR-NEXT:        ucvtf w19, s20, #33
1769// CHECK-ERROR-NEXT:              ^
1770// CHECK-ERROR-NEXT: error: invalid operand for instruction
1771// CHECK-ERROR-NEXT:        ucvtf wsp, s19, #14
1772// CHECK-ERROR-NEXT:              ^
1773
1774        ucvtf x13, s31, #0
1775        ucvtf x19, s20, #65
1776        ucvtf sp, s19, #14
1777// CHECK-ERROR-NEXT: error: invalid operand for instruction
1778// CHECK-ERROR-NEXT:        ucvtf x13, s31, #0
1779// CHECK-ERROR-NEXT:              ^
1780// CHECK-ERROR-NEXT: error: invalid operand for instruction
1781// CHECK-ERROR-NEXT:        ucvtf x19, s20, #65
1782// CHECK-ERROR-NEXT:              ^
1783// CHECK-ERROR-NEXT: error: invalid operand for instruction
1784// CHECK-ERROR-NEXT:        ucvtf sp, s19, #14
1785// CHECK-ERROR-NEXT:              ^
1786
1787//------------------------------------------------------------------------------
1788// Floating-point immediate
1789//------------------------------------------------------------------------------
1790        ;; Exponent too large
1791        fmov d3, #0.0625
1792        fmov s2, #32.0
1793        fmov s2, #32
1794        fmov v0.4s, #-32
1795// CHECK-ERROR: error: expected compatible register or floating-point constant
1796// CHECK-ERROR-NEXT:           fmov d3, #0.0625
1797// CHECK-ERROR-NEXT:                    ^
1798// CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant
1799// CHECK-ERROR-NEXT:           fmov s2, #32.0
1800// CHECK-ERROR-NEXT:                    ^
1801// CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant
1802// CHECK-ERROR-NEXT:           fmov s2, #32
1803// CHECK-ERROR-NEXT:                    ^
1804// CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant
1805// CHECK-ERROR-NEXT:           fmov v0.4s, #-32
1806// CHECK-ERROR-NEXT:                       ^
1807
1808        ;; Fraction too precise
1809        fmov s9, #1.03125
1810        fmov s28, #1.96875
1811// CHECK-ERROR: error: expected compatible register or floating-point constant
1812// CHECK-ERROR-NEXT:           fmov s9, #1.03125
1813// CHECK-ERROR-NEXT:                    ^
1814// CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant
1815// CHECK-ERROR-NEXT:           fmov s28, #1.96875
1816// CHECK-ERROR-NEXT:                     ^
1817
1818        ;; Explicitly encoded value too large
1819        fmov s15, #0x100
1820// CHECK-ERROR: error: encoded floating point value out of range
1821// CHECK-ERROR-NEXT:           fmov s15, #0x100
1822// CHECK-ERROR-NEXT:                     ^
1823
1824        ;; Not possible to fmov ZR to a whole vector
1825        fmov v0.4s, #0.0
1826// CHECK-ERROR: error: expected compatible register or floating-point constant
1827// CHECK-ERROR-NEXT:           fmov v0.4s, #0.0
1828// CHECK-ERROR-NEXT:                       ^
1829
1830//------------------------------------------------------------------------------
1831// Floating-point <-> integer conversion
1832//------------------------------------------------------------------------------
1833
1834        fmov x3, v0.d[0]
1835        fmov v29.1d[1], x2
1836        fmov x7, v0.d[2]
1837        fcvtns sp, s5
1838        scvtf s6, wsp
1839// CHECK-ERROR: error: expected lane specifier '[1]'
1840// CHECK-ERROR-NEXT:         fmov x3, v0.d[0]
1841// CHECK-ERROR-NEXT:                       ^
1842// CHECK-ERROR-AARCH64-NEXT: error: lane number incompatible with layout
1843// CHECK-ERROR-ARM64-NEXT: error: invalid operand for instruction
1844// CHECK-ERROR-NEXT: fmov v29.1d[1], x2
1845// CHECK-ERROR-NEXT:             ^
1846// CHECK-ERROR-AARCH64-NEXT: error: lane number incompatible with layout
1847// CHECK-ERROR-ARM64-NEXT: error: expected lane specifier '[1]'
1848// CHECK-ERROR-NEXT: fmov x7, v0.d[2]
1849// CHECK-ERROR-NEXT:               ^
1850// CHECK-ERROR-NEXT: error: invalid operand for instruction
1851// CHECK-ERROR-NEXT:         fcvtns sp, s5
1852// CHECK-ERROR-NEXT:                ^
1853// CHECK-ERROR-NEXT: error: invalid operand for instruction
1854// CHECK-ERROR-NEXT:         scvtf s6, wsp
1855// CHECK-ERROR-NEXT:                   ^
1856
1857//------------------------------------------------------------------------------
1858// Load-register (literal)
1859//------------------------------------------------------------------------------
1860
1861        ldr sp, some_label
1862        ldrsw w3, somewhere
1863        ldr v0, some_label
1864// CHECK-ERROR: error: invalid operand for instruction
1865// CHECK-ERROR-NEXT:         ldr sp, some_label
1866// CHECK-ERROR-NEXT:             ^
1867// CHECK-ERROR-NEXT: error: invalid operand for instruction
1868// CHECK-ERROR-NEXT:         ldrsw w3, somewhere
1869// CHECK-ERROR-NEXT:               ^
1870// CHECK-ERROR-NEXT: error: invalid operand for instruction
1871// CHECK-ERROR-NEXT:         ldr v0, some_label
1872// CHECK-ERROR-NEXT:             ^
1873
1874        ldrsw x2, #1048576
1875        ldr q0, #-1048580
1876        ldr x0, #2
1877// CHECK-ERROR: error: expected label or encodable integer pc offset
1878// CHECK-ERROR-NEXT:         ldrsw x2, #1048576
1879// CHECK-ERROR-NEXT:                   ^
1880// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1881// CHECK-ERROR-NEXT:         ldr q0, #-1048580
1882// CHECK-ERROR-NEXT:                   ^
1883// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
1884// CHECK-ERROR-NEXT:         ldr x0, #2
1885// CHECK-ERROR-NEXT:                 ^
1886
1887//------------------------------------------------------------------------------
1888// Load/store exclusive
1889//------------------------------------------------------------------------------
1890
1891       stxrb w2, w3, [x4, #20]
1892       stlxrh w10, w11, [w2]
1893// CHECK-ERROR-AARCH64: error: expected '#0'
1894// CHECK-ERROR-ARM64: error: index must be absent or #0
1895// CHECK-ERROR-NEXT:         stxrb w2, w3, [x4, #20]
1896// CHECK-ERROR-NEXT:                       ^
1897// CHECK-ERROR: error: invalid operand for instruction
1898// CHECK-ERROR-NEXT:         stlxrh w10, w11, [w2]
1899// CHECK-ERROR-NEXT:                           ^
1900
1901       stlxr  x20, w21, [sp]
1902// CHECK-ERROR: error: invalid operand for instruction
1903// CHECK-ERROR-NEXT:         stlxr  x20, w21, [sp]
1904// CHECK-ERROR-NEXT:                ^
1905
1906       ldxr   sp, [sp]
1907// CHECK-ERROR: error: invalid operand for instruction
1908// CHECK-ERROR-NEXT:         ldxr   sp, [sp]
1909// CHECK-ERROR-NEXT:                ^
1910
1911       stxp x1, x2, x3, [x4]
1912// CHECK-ERROR: error: invalid operand for instruction
1913// CHECK-ERROR-NEXT:         stxp x1, x2,  x3, [x4]
1914// CHECK-ERROR-NEXT:              ^
1915
1916       stlxp w5, x1, w4, [x5]
1917// CHECK-ERROR: error: invalid operand for instruction
1918// CHECK-ERROR-NEXT:         stlxp w5, x1, w4, [x5]
1919// CHECK-ERROR-NEXT:                       ^
1920
1921       stlxp w17, w6, x7, [x22]
1922// CHECK-ERROR: error: invalid operand for instruction
1923// CHECK-ERROR-NEXT:         stlxp w17, w6, x7, [x22]
1924// CHECK-ERROR-NEXT:                        ^
1925
1926//------------------------------------------------------------------------------
1927// Load/store (unscaled immediate)
1928//------------------------------------------------------------------------------
1929        ldur v0, [x0, #0]
1930        stur v0, [x0, #0]
1931// CHECK-ERROR-NEXT: error: invalid operand for instruction
1932// CHECK-ERROR-NEXT:         ldur v0, [x0, #0]
1933// CHECK-ERROR-NEXT:              ^
1934// CHECK-ERROR-NEXT: error: invalid operand for instruction
1935// CHECK-ERROR-NEXT:         stur v0, [x0, #0]
1936// CHECK-ERROR-NEXT:              ^
1937
1938        ldurb w2, [sp, #256]
1939        sturh w17, [x1, #256]
1940        ldursw x20, [x1, #256]
1941        ldur x12, [sp, #256]
1942// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
1943// CHECK-ERROR-NEXT:        ldurb w2, [sp, #256]
1944// CHECK-ERROR-NEXT:                  ^
1945// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1946// CHECK-ERROR-NEXT:         sturh w17, [x1, #256]
1947// CHECK-ERROR-NEXT:                    ^
1948// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1949// CHECK-ERROR-NEXT:         ldursw x20, [x1, #256]
1950// CHECK-ERROR-NEXT:                     ^
1951// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1952// CHECK-ERROR-NEXT:         ldur x12, [sp, #256]
1953// CHECK-ERROR-NEXT:                   ^
1954
1955        stur h2, [x2, #-257]
1956        stur b2, [x2, #-257]
1957        ldursb x9, [sp, #-257]
1958        ldur w2, [x30, #-257]
1959        stur q9, [x20, #-257]
1960// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
1961// CHECK-ERROR-NEXT:         stur h2, [x2, #-257]
1962// CHECK-ERROR-NEXT:                  ^
1963// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1964// CHECK-ERROR-NEXT:         stur b2, [x2, #-257]
1965// CHECK-ERROR-NEXT:                  ^
1966// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1967// CHECK-ERROR-NEXT:         ldursb x9, [sp, #-257]
1968// CHECK-ERROR-NEXT:                    ^
1969// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1970// CHECK-ERROR-NEXT:         ldur w2, [x30, #-257]
1971// CHECK-ERROR-NEXT:                  ^
1972// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
1973// CHECK-ERROR-NEXT:         stur q9, [x20, #-257]
1974// CHECK-ERROR-NEXT:                  ^
1975
1976        prfum pstl3strm, [xzr]
1977// CHECK-ERROR: error: invalid operand for instruction
1978// CHECK-ERROR-NEXT:         prfum pstl3strm, [xzr]
1979// CHECK-ERROR-NEXT:                           ^
1980
1981//------------------------------------------------------------------------------
1982// Load-store register (immediate post-indexed)
1983//------------------------------------------------------------------------------
1984        ldr v0, [x0], #0
1985        str v0, [x0], #0
1986// CHECK-ERROR: error: invalid operand for instruction
1987// CHECK-ERROR-NEXT:         ldr v0, [x0], #0
1988// CHECK-ERROR-NEXT:             ^
1989// CHECK-ERROR: error: invalid operand for instruction
1990// CHECK-ERROR-NEXT:         str v0, [x0], #0
1991// CHECK-ERROR-NEXT:             ^
1992
1993        ldr x3, [x4, #25], #0
1994        ldr x4, [x9, #0], #4
1995// CHECK-ERROR-AARCH64: error: invalid operand for instruction
1996// CHECK-ERROR-ARM64: error: invalid operand for instruction
1997// CHECK-ERROR-NEXT:         ldr x3, [x4, #25], #0
1998// CHECK-ERROR-NEXT:                 ^
1999// CHECK-ERROR-AARCH64-NEXT: error: expected label or encodable integer pc offset
2000// CHECK-ERROR-AARCH64-NEXT:         ldr x4, [x9, #0], #4
2001// CHECK-ERROR-AARCH64-NEXT:                           ^
2002
2003        strb w1, [x19], #256
2004        strb w9, [sp], #-257
2005        strh w1, [x19], #256
2006        strh w9, [sp], #-257
2007        str w1, [x19], #256
2008        str w9, [sp], #-257
2009// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2010// CHECK-ERROR-NEXT:         strb w1, [x19], #256
2011// CHECK-ERROR-NEXT:                         ^
2012// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2013// CHECK-ERROR-NEXT:         strb w9, [sp], #-257
2014// CHECK-ERROR-NEXT:                        ^
2015// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2016// CHECK-ERROR-NEXT:         strh w1, [x19], #256
2017// CHECK-ERROR-NEXT:                         ^
2018// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2019// CHECK-ERROR-NEXT:         strh w9, [sp], #-257
2020// CHECK-ERROR-NEXT:                        ^
2021// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2022// CHECK-ERROR-NEXT:         str w1, [x19], #256
2023// CHECK-ERROR-NEXT:                        ^
2024// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2025// CHECK-ERROR-NEXT:         str w9, [sp], #-257
2026// CHECK-ERROR-NEXT:                       ^
2027
2028        ldrb w1, [x19], #256
2029        ldrb w9, [sp], #-257
2030        ldrh w1, [x19], #256
2031        ldrh w9, [sp], #-257
2032        ldr w1, [x19], #256
2033        ldr w9, [sp], #-257
2034// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2035// CHECK-ERROR-NEXT:         ldrb w1, [x19], #256
2036// CHECK-ERROR-NEXT:                         ^
2037// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2038// CHECK-ERROR-NEXT:         ldrb w9, [sp], #-257
2039// CHECK-ERROR-NEXT:                        ^
2040// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2041// CHECK-ERROR-NEXT:         ldrh w1, [x19], #256
2042// CHECK-ERROR-NEXT:                         ^
2043// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2044// CHECK-ERROR-NEXT:         ldrh w9, [sp], #-257
2045// CHECK-ERROR-NEXT:                        ^
2046// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2047// CHECK-ERROR-NEXT:         ldr w1, [x19], #256
2048// CHECK-ERROR-NEXT:                        ^
2049// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2050// CHECK-ERROR-NEXT:         ldr w9, [sp], #-257
2051// CHECK-ERROR-NEXT:                       ^
2052
2053        ldrsb x2, [x3], #256
2054        ldrsb x22, [x13], #-257
2055        ldrsh x2, [x3], #256
2056        ldrsh x22, [x13], #-257
2057        ldrsw x2, [x3], #256
2058        ldrsw x22, [x13], #-257
2059// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2060// CHECK-ERROR-NEXT:         ldrsb x2, [x3], #256
2061// CHECK-ERROR-NEXT:                         ^
2062// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2063// CHECK-ERROR-NEXT:         ldrsb x22, [x13], #-257
2064// CHECK-ERROR-NEXT:                           ^
2065// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2066// CHECK-ERROR-NEXT:         ldrsh x2, [x3], #256
2067// CHECK-ERROR-NEXT:                         ^
2068// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2069// CHECK-ERROR-NEXT:         ldrsh x22, [x13], #-257
2070// CHECK-ERROR-NEXT:                           ^
2071// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2072// CHECK-ERROR-NEXT:         ldrsw x2, [x3], #256
2073// CHECK-ERROR-NEXT:                         ^
2074// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2075// CHECK-ERROR-NEXT:         ldrsw x22, [x13], #-257
2076// CHECK-ERROR-NEXT:                           ^
2077
2078        ldrsb w2, [x3], #256
2079        ldrsb w22, [x13], #-257
2080        ldrsh w2, [x3], #256
2081        ldrsh w22, [x13], #-257
2082// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2083// CHECK-ERROR-NEXT:         ldrsb w2, [x3], #256
2084// CHECK-ERROR-NEXT:                         ^
2085// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2086// CHECK-ERROR-NEXT:         ldrsb w22, [x13], #-257
2087// CHECK-ERROR-NEXT:                           ^
2088// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2089// CHECK-ERROR-NEXT:         ldrsh w2, [x3], #256
2090// CHECK-ERROR-NEXT:                         ^
2091// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2092// CHECK-ERROR-NEXT:         ldrsh w22, [x13], #-257
2093// CHECK-ERROR-NEXT:                           ^
2094
2095        str b3, [x3], #256
2096        str b3, [x13], #-257
2097        str h3, [x3], #256
2098        str h3, [x13], #-257
2099        str s3, [x3], #256
2100        str s3, [x13], #-257
2101        str d3, [x3], #256
2102        str d3, [x13], #-257
2103        str q3, [x3], #256
2104        str q3, [x13], #-257
2105// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2106// CHECK-ERROR-NEXT:         str b3, [x3], #256
2107// CHECK-ERROR-NEXT:                       ^
2108// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2109// CHECK-ERROR-NEXT:         str b3, [x13], #-257
2110// CHECK-ERROR-NEXT:                        ^
2111// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2112// CHECK-ERROR-NEXT:         str h3, [x3], #256
2113// CHECK-ERROR-NEXT:                       ^
2114// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2115// CHECK-ERROR-NEXT:         str h3, [x13], #-257
2116// CHECK-ERROR-NEXT:                        ^
2117// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2118// CHECK-ERROR-NEXT:         str s3, [x3], #256
2119// CHECK-ERROR-NEXT:                       ^
2120// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2121// CHECK-ERROR-NEXT:         str s3, [x13], #-257
2122// CHECK-ERROR-NEXT:                        ^
2123// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2124// CHECK-ERROR-NEXT:         str d3, [x3], #256
2125// CHECK-ERROR-NEXT:                       ^
2126// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2127// CHECK-ERROR-NEXT:         str d3, [x13], #-257
2128// CHECK-ERROR-NEXT:                        ^
2129// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2130// CHECK-ERROR-NEXT:         str q3, [x3], #256
2131// CHECK-ERROR-NEXT:                       ^
2132// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2133// CHECK-ERROR-NEXT:         str q3, [x13], #-257
2134// CHECK-ERROR-NEXT:                        ^
2135
2136        ldr b3, [x3], #256
2137        ldr b3, [x13], #-257
2138        ldr h3, [x3], #256
2139        ldr h3, [x13], #-257
2140        ldr s3, [x3], #256
2141        ldr s3, [x13], #-257
2142        ldr d3, [x3], #256
2143        ldr d3, [x13], #-257
2144        ldr q3, [x3], #256
2145        ldr q3, [x13], #-257
2146// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2147// CHECK-ERROR-NEXT:         ldr b3, [x3], #256
2148// CHECK-ERROR-NEXT:                       ^
2149// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2150// CHECK-ERROR-NEXT:         ldr b3, [x13], #-257
2151// CHECK-ERROR-NEXT:                        ^
2152// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2153// CHECK-ERROR-NEXT:         ldr h3, [x3], #256
2154// CHECK-ERROR-NEXT:                       ^
2155// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2156// CHECK-ERROR-NEXT:         ldr h3, [x13], #-257
2157// CHECK-ERROR-NEXT:                        ^
2158// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2159// CHECK-ERROR-NEXT:         ldr s3, [x3], #256
2160// CHECK-ERROR-NEXT:                       ^
2161// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2162// CHECK-ERROR-NEXT:         ldr s3, [x13], #-257
2163// CHECK-ERROR-NEXT:                        ^
2164// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2165// CHECK-ERROR-NEXT:         ldr d3, [x3], #256
2166// CHECK-ERROR-NEXT:                       ^
2167// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2168// CHECK-ERROR-NEXT:         ldr d3, [x13], #-257
2169// CHECK-ERROR-NEXT:                        ^
2170// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2171// CHECK-ERROR-NEXT:         ldr q3, [x3], #256
2172// CHECK-ERROR-NEXT:                       ^
2173// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2174// CHECK-ERROR-NEXT:         ldr q3, [x13], #-257
2175// CHECK-ERROR-NEXT:                        ^
2176
2177//------------------------------------------------------------------------------
2178// Load-store register (immediate pre-indexed)
2179//------------------------------------------------------------------------------
2180        ldr v0, [x0, #0]!
2181        str v0, [x0, #0]!
2182// CHECK-ERROR: error: invalid operand for instruction
2183// CHECK-ERROR-NEXT:         ldr v0, [x0, #0]!
2184// CHECK-ERROR-NEXT:             ^
2185// CHECK-ERROR: error: invalid operand for instruction
2186// CHECK-ERROR-NEXT:         str v0, [x0, #0]!
2187// CHECK-ERROR-NEXT:             ^
2188
2189        ldr x3, [x4]!
2190// CHECK-ERROR: error:
2191// CHECK-ERROR-NEXT:         ldr x3, [x4]!
2192// CHECK-ERROR-NEXT:                     ^
2193
2194        strb w1, [x19, #256]!
2195        strb w9, [sp, #-257]!
2196        strh w1, [x19, #256]!
2197        strh w9, [sp, #-257]!
2198        str w1, [x19, #256]!
2199        str w9, [sp, #-257]!
2200// CHECK-ERROR: error: invalid operand for instruction
2201// CHECK-ERROR-NEXT:         strb w1, [x19, #256]!
2202// CHECK-ERROR-NEXT:                             ^
2203// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2204// CHECK-ERROR-NEXT:         strb w9, [sp, #-257]!
2205// CHECK-ERROR-NEXT:                  ^
2206// CHECK-ERROR-NEXT: error: invalid operand for instruction
2207// CHECK-ERROR-NEXT:         strh w1, [x19, #256]!
2208// CHECK-ERROR-NEXT:                             ^
2209// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2210// CHECK-ERROR-NEXT:         strh w9, [sp, #-257]!
2211// CHECK-ERROR-NEXT:                  ^
2212// CHECK-ERROR-NEXT: error: invalid operand for instruction
2213// CHECK-ERROR-NEXT:         str w1, [x19, #256]!
2214// CHECK-ERROR-NEXT:                            ^
2215// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2216// CHECK-ERROR-NEXT:         str w9, [sp, #-257]!
2217// CHECK-ERROR-NEXT:                 ^
2218
2219        ldrb w1, [x19, #256]!
2220        ldrb w9, [sp, #-257]!
2221        ldrh w1, [x19, #256]!
2222        ldrh w9, [sp, #-257]!
2223        ldr w1, [x19, #256]!
2224        ldr w9, [sp, #-257]!
2225// CHECK-ERROR: error: invalid operand for instruction
2226// CHECK-ERROR-NEXT:         ldrb w1, [x19, #256]!
2227// CHECK-ERROR-NEXT:                             ^
2228// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2229// CHECK-ERROR-NEXT:         ldrb w9, [sp, #-257]!
2230// CHECK-ERROR-NEXT:                  ^
2231// CHECK-ERROR-NEXT: error: invalid operand for instruction
2232// CHECK-ERROR-NEXT:         ldrh w1, [x19, #256]!
2233// CHECK-ERROR-NEXT:                             ^
2234// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2235// CHECK-ERROR-NEXT:         ldrh w9, [sp, #-257]!
2236// CHECK-ERROR-NEXT:                  ^
2237// CHECK-ERROR-NEXT: error: invalid operand for instruction
2238// CHECK-ERROR-NEXT:         ldr w1, [x19, #256]!
2239// CHECK-ERROR-NEXT:                            ^
2240// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2241// CHECK-ERROR-NEXT:         ldr w9, [sp, #-257]!
2242// CHECK-ERROR-NEXT:                 ^
2243
2244        ldrsb x2, [x3, #256]!
2245        ldrsb x22, [x13, #-257]!
2246        ldrsh x2, [x3, #256]!
2247        ldrsh x22, [x13, #-257]!
2248        ldrsw x2, [x3, #256]!
2249        ldrsw x22, [x13, #-257]!
2250// CHECK-ERROR: error: invalid operand for instruction
2251// CHECK-ERROR-NEXT:         ldrsb x2, [x3, #256]!
2252// CHECK-ERROR-NEXT:                             ^
2253// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2254// CHECK-ERROR-NEXT:         ldrsb x22, [x13, #-257]!
2255// CHECK-ERROR-NEXT:                    ^
2256// CHECK-ERROR-NEXT: error: invalid operand for instruction
2257// CHECK-ERROR-NEXT:         ldrsh x2, [x3, #256]!
2258// CHECK-ERROR-NEXT:                             ^
2259// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2260// CHECK-ERROR-NEXT:         ldrsh x22, [x13, #-257]!
2261// CHECK-ERROR-NEXT:                    ^
2262// CHECK-ERROR-NEXT: error: invalid operand for instruction
2263// CHECK-ERROR-NEXT:         ldrsw x2, [x3, #256]!
2264// CHECK-ERROR-NEXT:                             ^
2265// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2266// CHECK-ERROR-NEXT:         ldrsw x22, [x13, #-257]!
2267// CHECK-ERROR-NEXT:                    ^
2268
2269        ldrsb w2, [x3, #256]!
2270        ldrsb w22, [x13, #-257]!
2271        ldrsh w2, [x3, #256]!
2272        ldrsh w22, [x13, #-257]!
2273// CHECK-ERROR: error: invalid operand for instruction
2274// CHECK-ERROR-NEXT:         ldrsb w2, [x3, #256]!
2275// CHECK-ERROR-NEXT:                             ^
2276// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2277// CHECK-ERROR-NEXT:         ldrsb w22, [x13, #-257]!
2278// CHECK-ERROR-NEXT:                    ^
2279// CHECK-ERROR-NEXT: error: invalid operand for instruction
2280// CHECK-ERROR-NEXT:         ldrsh w2, [x3, #256]!
2281// CHECK-ERROR-NEXT:                             ^
2282// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2283// CHECK-ERROR-NEXT:         ldrsh w22, [x13, #-257]!
2284// CHECK-ERROR-NEXT:                    ^
2285
2286        str b3, [x3, #256]!
2287        str b3, [x13, #-257]!
2288        str h3, [x3, #256]!
2289        str h3, [x13, #-257]!
2290        str s3, [x3, #256]!
2291        str s3, [x13, #-257]!
2292        str d3, [x3, #256]!
2293        str d3, [x13, #-257]!
2294// CHECK-ERROR: error: invalid operand for instruction
2295// CHECK-ERROR-NEXT:         str b3, [x3, #256]!
2296// CHECK-ERROR-NEXT:                           ^
2297// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2298// CHECK-ERROR-NEXT:         str b3, [x13, #-257]!
2299// CHECK-ERROR-NEXT:                 ^
2300// CHECK-ERROR-NEXT: error: invalid operand for instruction
2301// CHECK-ERROR-NEXT:         str h3, [x3, #256]!
2302// CHECK-ERROR-NEXT:                           ^
2303// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2304// CHECK-ERROR-NEXT:         str h3, [x13, #-257]!
2305// CHECK-ERROR-NEXT:                 ^
2306// CHECK-ERROR-NEXT: error: invalid operand for instruction
2307// CHECK-ERROR-NEXT:         str s3, [x3, #256]!
2308// CHECK-ERROR-NEXT:                           ^
2309// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2310// CHECK-ERROR-NEXT:         str s3, [x13, #-257]!
2311// CHECK-ERROR-NEXT:                 ^
2312// CHECK-ERROR-NEXT: error: invalid operand for instruction
2313// CHECK-ERROR-NEXT:         str d3, [x3, #256]!
2314// CHECK-ERROR-NEXT:                           ^
2315// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2316// CHECK-ERROR-NEXT:         str d3, [x13, #-257]!
2317// CHECK-ERROR-NEXT:                 ^
2318
2319        ldr b3, [x3, #256]!
2320        ldr b3, [x13, #-257]!
2321        ldr h3, [x3, #256]!
2322        ldr h3, [x13, #-257]!
2323        ldr s3, [x3, #256]!
2324        ldr s3, [x13, #-257]!
2325        ldr d3, [x3, #256]!
2326        ldr d3, [x13, #-257]!
2327// CHECK-ERROR: error: invalid operand for instruction
2328// CHECK-ERROR-NEXT:         ldr b3, [x3, #256]!
2329// CHECK-ERROR-NEXT:                           ^
2330// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2331// CHECK-ERROR-NEXT:         ldr b3, [x13, #-257]!
2332// CHECK-ERROR-NEXT:                 ^
2333// CHECK-ERROR-NEXT: error: invalid operand for instruction
2334// CHECK-ERROR-NEXT:         ldr h3, [x3, #256]!
2335// CHECK-ERROR-NEXT:                           ^
2336// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2337// CHECK-ERROR-NEXT:         ldr h3, [x13, #-257]!
2338// CHECK-ERROR-NEXT:                 ^
2339// CHECK-ERROR-NEXT: error: invalid operand for instruction
2340// CHECK-ERROR-NEXT:         ldr s3, [x3, #256]!
2341// CHECK-ERROR-NEXT:                           ^
2342// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2343// CHECK-ERROR-NEXT:         ldr s3, [x13, #-257]!
2344// CHECK-ERROR-NEXT:                 ^
2345// CHECK-ERROR-NEXT: error: invalid operand for instruction
2346// CHECK-ERROR-NEXT:         ldr d3, [x3, #256]!
2347// CHECK-ERROR-NEXT:                           ^
2348// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2349// CHECK-ERROR-NEXT:         ldr d3, [x13, #-257]!
2350// CHECK-ERROR-NEXT:                 ^
2351
2352//------------------------------------------------------------------------------
2353// Load/store (unprivileged)
2354//------------------------------------------------------------------------------
2355
2356        ldtrb w2, [sp, #256]
2357        sttrh w17, [x1, #256]
2358        ldtrsw x20, [x1, #256]
2359        ldtr x12, [sp, #256]
2360// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2361// CHECK-ERROR-NEXT:        ldtrb w2, [sp, #256]
2362// CHECK-ERROR-NEXT:                  ^
2363// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2364// CHECK-ERROR-NEXT:         sttrh w17, [x1, #256]
2365// CHECK-ERROR-NEXT:                    ^
2366// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2367// CHECK-ERROR-NEXT:         ldtrsw x20, [x1, #256]
2368// CHECK-ERROR-NEXT:                     ^
2369// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2370// CHECK-ERROR-NEXT:         ldtr x12, [sp, #256]
2371// CHECK-ERROR-NEXT:                   ^
2372
2373        sttr h2, [x2, #-257]
2374        sttr b2, [x2, #-257]
2375        ldtrsb x9, [sp, #-257]
2376        ldtr w2, [x30, #-257]
2377        sttr q9, [x20, #-257]
2378// CHECK-ERROR: error: invalid operand for instruction
2379// CHECK-ERROR-NEXT:         sttr h2, [x2, #-257]
2380// CHECK-ERROR-NEXT:              ^
2381// CHECK-ERROR-NEXT: error: invalid operand for instruction
2382// CHECK-ERROR-NEXT:         sttr b2, [x2, #-257]
2383// CHECK-ERROR-NEXT:              ^
2384// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2385// CHECK-ERROR-NEXT:         ldtrsb x9, [sp, #-257]
2386// CHECK-ERROR-NEXT:                    ^
2387// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2388// CHECK-ERROR-NEXT:         ldtr w2, [x30, #-257]
2389// CHECK-ERROR-NEXT:                  ^
2390// CHECK-ERROR-NEXT: error: invalid operand for instruction
2391// CHECK-ERROR-NEXT:         sttr q9, [x20, #-257]
2392// CHECK-ERROR-NEXT:                  ^
2393
2394
2395//------------------------------------------------------------------------------
2396// Load/store (unsigned immediate)
2397//------------------------------------------------------------------------------
2398        ldr v0, [x0, #0]
2399        str v0, [x0, #0]
2400// CHECK-ERROR: error: invalid operand for instruction
2401// CHECK-ERROR-NEXT:         ldr v0, [x0, #0]
2402// CHECK-ERROR-NEXT:             ^
2403// CHECK-ERROR: error: invalid operand for instruction
2404// CHECK-ERROR-NEXT:         str v0, [x0, #0]
2405// CHECK-ERROR-NEXT:             ^
2406
2407//// Out of range immediates
2408        ldr q0, [x11, #65536]
2409        ldr x0, [sp, #32768]
2410        ldr w0, [x4, #16384]
2411        ldrh w2, [x21, #8192]
2412        ldrb w3, [x12, #4096]
2413// CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
2414// CHECK-ERROR-NEXT:         ldr q0, [x11, #65536]
2415// CHECK-ERROR-NEXT:                 ^
2416// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2417// CHECK-ERROR-NEXT:         ldr x0, [sp, #32768]
2418// CHECK-ERROR-NEXT:                 ^
2419// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2420// CHECK-ERROR-NEXT:         ldr w0, [x4, #16384]
2421// CHECK-ERROR-NEXT:                 ^
2422// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2423// CHECK-ERROR-NEXT:         ldrh w2, [x21, #8192]
2424// CHECK-ERROR-NEXT:                  ^
2425// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2426// CHECK-ERROR-NEXT:         ldrb w3, [x12, #4096]
2427// CHECK-ERROR-NEXT:                  ^
2428
2429//// Misaligned addresses
2430        ldr w0, [x0, #2]
2431        ldrsh w2, [x0, #123]
2432        str q0, [x0, #8]
2433// CHECK-ERROR-AARCH64: error: too few operands for instruction
2434// CHECK-ERROR-AARCH64-NEXT:         ldr w0, [x0, #2]
2435// CHECK-ERROR-AARCH64-NEXT:                 ^
2436// CHECK-ERROR-AARCH64-NEXT: error: too few operands for instruction
2437// CHECK-ERROR-AARCH64-NEXT:         ldrsh w2, [x0, #123]
2438// CHECK-ERROR-AARCH64-NEXT:                   ^
2439// CHECK-ERROR-AARCH64-NEXT: error: too few operands for instruction
2440// CHECK-ERROR-AARCH64-NEXT:         str q0, [x0, #8]
2441// CHECK-ERROR-AARCH64-NEXT:                 ^
2442
2443//// 32-bit addresses
2444        ldr w0, [w20]
2445        ldrsh x3, [wsp]
2446// CHECK-ERROR: error: invalid operand for instruction
2447// CHECK-ERROR-NEXT:         ldr w0, [w20]
2448// CHECK-ERROR-NEXT:                  ^
2449// CHECK-ERROR-NEXT: error: invalid operand for instruction
2450// CHECK-ERROR-NEXT:         ldrsh x3, [wsp]
2451// CHECK-ERROR-NEXT:                    ^
2452
2453//// Store things
2454        strb w0, [wsp]
2455        strh w31, [x23, #1]
2456        str x5, [x22, #12]
2457        str w7, [x12, #16384]
2458// CHECK-ERROR: error: invalid operand for instruction
2459// CHECK-ERROR-NEXT: strb w0, [wsp]
2460// CHECK-ERROR-NEXT:           ^
2461// CHECK-ERROR-AARCH64: error: invalid operand for instruction
2462// CHECK-ERROR-AARCH64-NEXT:         strh w31, [x23, #1]
2463// CHECK-ERROR-AARCH64-NEXT:              ^
2464// CHECK-ERROR-AARCH64-NEXT: error: too few operands for instruction
2465// CHECK-ERROR-AARCH64-NEXT:         str x5, [x22, #12]
2466// CHECK-ERROR-AARCH64-NEXT:                 ^
2467// CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
2468// CHECK-ERROR-NEXT:         str w7, [x12, #16384]
2469// CHECK-ERROR-NEXT:                 ^
2470
2471//// Bad PRFMs
2472        prfm #-1, [sp]
2473        prfm #32, [sp, #8]
2474        prfm pldl1strm, [w3, #8]
2475        prfm wibble, [sp]
2476// CHECK-ERROR-AARCH64: error: Invalid immediate for instruction
2477// CHECK-ERROR-ARM64: error: prefetch operand out of range, [0,31] expected
2478// CHECK-ERROR-NEXT:        prfm #-1, [sp]
2479// CHECK-ERROR-NEXT:             ^
2480// CHECK-ERROR-AARCH64-NEXT: error: Invalid immediate for instruction
2481// CHECK-ERROR-ARM64-NEXT: error: prefetch operand out of range, [0,31] expected
2482// CHECK-ERROR-NEXT:        prfm #32, [sp, #8]
2483// CHECK-ERROR-NEXT:             ^
2484// CHECK-ERROR-NEXT: error: invalid operand for instruction
2485// CHECK-ERROR-NEXT:        prfm pldl1strm, [w3, #8]
2486// CHECK-ERROR-NEXT:                         ^
2487// CHECK-ERROR-AARCH64-NEXT: error: operand specifier not recognised
2488// CHECK-ERROR-ARM64-NEXT: error: prefetch hint expected
2489// CHECK-ERROR-NEXT:        prfm wibble, [sp]
2490// CHECK-ERROR-NEXT:             ^
2491
2492//------------------------------------------------------------------------------
2493// Load/store register (register offset)
2494//------------------------------------------------------------------------------
2495        ldr v0, [x0, xzr]
2496        ldr v0, [x0, x1, lsl #0]
2497        ldr v0, [x0, x1, lsl #0]
2498        str v0, [x0, xzr]
2499        str v0, [x0, x1, lsl #0]
2500        str v0, [x0, x1, lsl #0]
2501// CHECK-ERROR-NEXT: error: invalid operand for instruction
2502// CHECK-ERROR-NEXT:         ldr v0, [x0, xzr]
2503// CHECK-ERROR-NEXT:             ^
2504// CHECK-ERROR-NEXT: error: invalid operand for instruction
2505// CHECK-ERROR-NEXT:         ldr v0, [x0, x1, lsl #0]
2506// CHECK-ERROR-NEXT:             ^
2507// CHECK-ERROR-NEXT: error: invalid operand for instruction
2508// CHECK-ERROR-NEXT:         ldr v0, [x0, x1, lsl #0]
2509// CHECK-ERROR-NEXT:             ^
2510// CHECK-ERROR-NEXT: error: invalid operand for instruction
2511// CHECK-ERROR-NEXT:         str v0, [x0, xzr]
2512// CHECK-ERROR-NEXT:             ^
2513// CHECK-ERROR-NEXT: error: invalid operand for instruction
2514// CHECK-ERROR-NEXT:         str v0, [x0, x1, lsl #0]
2515// CHECK-ERROR-NEXT:             ^
2516// CHECK-ERROR-NEXT: error: invalid operand for instruction
2517// CHECK-ERROR-NEXT:         str v0, [x0, x1, lsl #0]
2518// CHECK-ERROR-NEXT:             ^
2519
2520        ldr w3, [xzr, x3]
2521        ldr w4, [x0, x4, lsl]
2522        ldr w9, [x5, x5, uxtw]
2523        ldr w10, [x6, x9, sxtw #2]
2524        ldr w11, [x7, w2, lsl #2]
2525        ldr w12, [x8, w1, sxtx]
2526// CHECK-ERROR-NEXT: error: invalid operand for instruction
2527// CHECK-ERROR-NEXT:        ldr w3, [xzr, x3]
2528// CHECK-ERROR-NEXT:                 ^
2529// CHECK-ERROR-NEXT: error: expected #imm after shift specifier
2530// CHECK-ERROR-NEXT:         ldr w4, [x0, x4, lsl]
2531// CHECK-ERROR-NEXT:                             ^
2532// CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #2
2533// CHECK-ERROR-NEXT:         ldr w9, [x5, x5, uxtw]
2534// CHECK-ERROR-NEXT:                          ^
2535// CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #2
2536// CHECK-ERROR-NEXT:         ldr w10, [x6, x9, sxtw #2]
2537// CHECK-ERROR-NEXT:                           ^
2538// CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #2
2539// CHECK-ERROR-NEXT:         ldr w11, [x7, w2, lsl #2]
2540// CHECK-ERROR-NEXT:                           ^
2541// CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #2
2542// CHECK-ERROR-NEXT:         ldr w12, [x8, w1, sxtx]
2543// CHECK-ERROR-NEXT:                           ^
2544
2545        ldrsb w9, [x4, x2, lsl #-1]
2546        strb w9, [x4, x2, lsl #1]
2547// CHECK-ERROR-NEXT: error: expected integer shift amount
2548// CHECK-ERROR-NEXT:         ldrsb w9, [x4, x2, lsl #-1]
2549// CHECK-ERROR-NEXT:                                 ^
2550// CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0
2551// CHECK-ERROR-NEXT:         strb w9, [x4, x2, lsl #1]
2552// CHECK-ERROR-NEXT:                  ^
2553
2554        ldrsh w9, [x4, x2, lsl #-1]
2555        ldr h13, [x4, w2, uxtw #2]
2556// CHECK-ERROR-NEXT: error: expected integer shift amount
2557// CHECK-ERROR-NEXT:         ldrsh w9, [x4, x2, lsl #-1]
2558// CHECK-ERROR-NEXT:                                 ^
2559// CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #1
2560// CHECK-ERROR-NEXT:         ldr h13, [x4, w2, uxtw #2]
2561// CHECK-ERROR-NEXT:                           ^
2562
2563        str w9, [x5, w9, sxtw #-1]
2564        str s3, [sp, w9, uxtw #1]
2565        ldrsw x9, [x15, x4, sxtx #3]
2566// CHECK-ERROR-NEXT: error: expected integer shift amount
2567// CHECK-ERROR-NEXT:         str w9, [x5, w9, sxtw #-1]
2568// CHECK-ERROR-NEXT:                                ^
2569// CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #2
2570// CHECK-ERROR-NEXT:         str s3, [sp, w9, uxtw #1]
2571// CHECK-ERROR-NEXT:                          ^
2572// CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #2
2573// CHECK-ERROR-NEXT:         ldrsw x9, [x15, x4, sxtx #3]
2574// CHECK-ERROR-NEXT:                             ^
2575
2576        str xzr, [x5, x9, sxtx #-1]
2577        prfm pldl3keep, [sp, x20, lsl #2]
2578        ldr d3, [x20, wzr, uxtw #4]
2579// CHECK-ERROR-NEXT: error: expected integer shift amount
2580// CHECK-ERROR-NEXT:         str xzr, [x5, x9, sxtx #-1]
2581// CHECK-ERROR-NEXT:                                 ^
2582// CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #3
2583// CHECK-ERROR-NEXT:         prfm pldl3keep, [sp, x20, lsl #2]
2584// CHECK-ERROR-NEXT:                         ^
2585// CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #3
2586// CHECK-ERROR-NEXT:         ldr d3, [x20, wzr, uxtw #4]
2587// CHECK-ERROR-NEXT:                 ^
2588
2589        ldr q5, [sp, x2, lsl #-1]
2590        ldr q10, [x20, w4, uxtw #2]
2591        str q21, [x20, w4, uxtw #5]
2592// CHECK-ERROR-NEXT: error: expected integer shift amount
2593// CHECK-ERROR-NEXT:         ldr q5, [sp, x2, lsl #-1]
2594// CHECK-ERROR-NEXT:                               ^
2595// CHECK-ERROR-AARCH64-NEXT: error: expected 'lsl' or 'sxtw' with optional shift of #0 or #4
2596// CHECK-ERROR-ARM64-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #4
2597// CHECK-ERROR-NEXT:         ldr q10, [x20, w4, uxtw #2]
2598// CHECK-ERROR-NEXT:                  ^
2599// CHECK-ERROR-AARCH64-NEXT: error: expected 'lsl' or 'sxtw' with optional shift of #0 or #4
2600// CHECK-ERROR-ARM64-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #4
2601// CHECK-ERROR-NEXT:         str q21, [x20, w4, uxtw #5]
2602// CHECK-ERROR-NEXT:                  ^
2603
2604//------------------------------------------------------------------------------
2605// Load/store register pair (offset)
2606//------------------------------------------------------------------------------
2607        ldp v0, v1, [x0, #0]
2608        stp v0, v1, [x0, #0]
2609// CHECK-ERROR-NEXT: error: invalid operand for instruction
2610// CHECK-ERROR-NEXT:         ldp v0, v1, [x0, #0]
2611// CHECK-ERROR-NEXT:             ^
2612// CHECK-ERROR-NEXT: error: invalid operand for instruction
2613// CHECK-ERROR-NEXT:         stp v0, v1, [x0, #0]
2614// CHECK-ERROR-NEXT:             ^
2615
2616        ldp w3, w2, [x4, #1]
2617        stp w1, w2, [x3, #253]
2618        stp w9, w10, [x5, #256]
2619        ldp w11, w12, [x9, #-260]
2620        stp wsp, w9, [sp]
2621// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2622// CHECK-ERROR-NEXT:         ldp w3, w2, [x4, #1]
2623// CHECK-ERROR-NEXT:                          ^
2624// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2625// CHECK-ERROR-NEXT:         stp w1, w2, [x3, #253]
2626// CHECK-ERROR-NEXT:                     ^
2627// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2628// CHECK-ERROR-NEXT:         stp w9, w10, [x5, #256]
2629// CHECK-ERROR-NEXT:                      ^
2630// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2631// CHECK-ERROR-NEXT:         ldp w11, w12, [x9, #-260]
2632// CHECK-ERROR-NEXT:                       ^
2633// CHECK-ERROR-NEXT: error: invalid operand for instruction
2634// CHECK-ERROR-NEXT:         stp wsp, w9, [sp]
2635// CHECK-ERROR-NEXT:             ^
2636
2637        ldpsw x9, x2, [sp, #2]
2638        ldpsw x1, x2, [x10, #256]
2639        ldpsw x3, x4, [x11, #-260]
2640// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2641// CHECK-ERROR-NEXT:         ldpsw x9, x2, [sp, #2]
2642// CHECK-ERROR-NEXT:                       ^
2643// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2644// CHECK-ERROR-NEXT:         ldpsw x1, x2, [x10, #256]
2645// CHECK-ERROR-NEXT:                       ^
2646// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2647// CHECK-ERROR-NEXT:         ldpsw x3, x4, [x11, #-260]
2648// CHECK-ERROR-NEXT:                       ^
2649
2650        ldp x2, x5, [sp, #4]
2651        ldp x5, x6, [x9, #512]
2652        stp x7, x8, [x10, #-520]
2653// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2654// CHECK-ERROR-NEXT:         ldp x2, x5, [sp, #4]
2655// CHECK-ERROR-NEXT:                     ^
2656// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2657// CHECK-ERROR-NEXT:         ldp x5, x6, [x9, #512]
2658// CHECK-ERROR-NEXT:                     ^
2659// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2660// CHECK-ERROR-NEXT:         stp x7, x8, [x10, #-520]
2661// CHECK-ERROR-NEXT:                     ^
2662
2663        ldp sp, x3, [x10]
2664        stp x3, sp, [x9]
2665// CHECK-ERROR: error: invalid operand for instruction
2666// CHECK-ERROR-NEXT:         ldp sp, x3, [x10]
2667// CHECK-ERROR-NEXT:             ^
2668// CHECK-ERROR-NEXT: error: invalid operand for instruction
2669// CHECK-ERROR-NEXT:         stp x3, sp, [x9]
2670// CHECK-ERROR-NEXT:                 ^
2671
2672        stp s3, s5, [sp, #-2]
2673        ldp s6, s26, [x4, #-260]
2674        stp s13, s19, [x5, #256]
2675// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2676// CHECK-ERROR-NEXT:         stp s3, s5, [sp, #-2]
2677// CHECK-ERROR-NEXT:                     ^
2678// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2679// CHECK-ERROR-NEXT:         ldp s6, s26, [x4, #-260]
2680// CHECK-ERROR-NEXT:                      ^
2681// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2682// CHECK-ERROR-NEXT:         stp s13, s19, [x5, #256]
2683// CHECK-ERROR-NEXT:                       ^
2684
2685        ldp d3, d4, [xzr]
2686        ldp d5, d6, [x0, #512]
2687        stp d7, d8, [x0, #-520]
2688// CHECK-ERROR: error: invalid operand for instruction
2689// CHECK-ERROR-NEXT:         ldp d3, d4, [xzr]
2690// CHECK-ERROR-NEXT:                      ^
2691// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2692// CHECK-ERROR-NEXT:         ldp d5, d6, [x0, #512]
2693// CHECK-ERROR-NEXT:                     ^
2694// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2695// CHECK-ERROR-NEXT:         stp d7, d8, [x0, #-520]
2696// CHECK-ERROR-NEXT:                     ^
2697
2698        ldp d3, q2, [sp]
2699        ldp q3, q5, [sp, #8]
2700        stp q20, q25, [x5, #1024]
2701        ldp q30, q15, [x23, #-1040]
2702// CHECK-ERROR: error: invalid operand for instruction
2703// CHECK-ERROR-NEXT:         ldp d3, q2, [sp]
2704// CHECK-ERROR-NEXT:                 ^
2705// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2706// CHECK-ERROR-NEXT:         ldp q3, q5, [sp, #8]
2707// CHECK-ERROR-NEXT:                     ^
2708// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2709// CHECK-ERROR-NEXT:         stp q20, q25, [x5, #1024]
2710// CHECK-ERROR-NEXT:                       ^
2711// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2712// CHECK-ERROR-NEXT:         ldp q30, q15, [x23, #-1040]
2713// CHECK-ERROR-NEXT:                       ^
2714
2715//------------------------------------------------------------------------------
2716// Load/store register pair (post-indexed)
2717//------------------------------------------------------------------------------
2718        ldp v0, v1, [x0], #0
2719        stp v0, v1, [x0], #0
2720// CHECK-ERROR-NEXT: error: invalid operand for instruction
2721// CHECK-ERROR-NEXT:         ldp v0, v1, [x0], #0
2722// CHECK-ERROR-NEXT:             ^
2723// CHECK-ERROR-NEXT: error: invalid operand for instruction
2724// CHECK-ERROR-NEXT:         stp v0, v1, [x0], #0
2725// CHECK-ERROR-NEXT:             ^
2726
2727        ldp w3, w2, [x4], #1
2728        stp w1, w2, [x3], #253
2729        stp w9, w10, [x5], #256
2730        ldp w11, w12, [x9], #-260
2731        stp wsp, w9, [sp], #0
2732// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2733// CHECK-ERROR-NEXT:         ldp w3, w2, [x4], #1
2734// CHECK-ERROR-NEXT:                           ^
2735// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2736// CHECK-ERROR-NEXT:         stp w1, w2, [x3], #253
2737// CHECK-ERROR-NEXT:                     ^
2738// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2739// CHECK-ERROR-NEXT:         stp w9, w10, [x5], #256
2740// CHECK-ERROR-NEXT:                      ^
2741// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2742// CHECK-ERROR-NEXT:         ldp w11, w12, [x9], #-260
2743// CHECK-ERROR-NEXT:                       ^
2744// CHECK-ERROR-NEXT: error: invalid operand for instruction
2745// CHECK-ERROR-NEXT:         stp wsp, w9, [sp], #0
2746// CHECK-ERROR-NEXT:             ^
2747
2748        ldpsw x9, x2, [sp], #2
2749        ldpsw x1, x2, [x10], #256
2750        ldpsw x3, x4, [x11], #-260
2751// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2752// CHECK-ERROR-NEXT:         ldpsw x9, x2, [sp], #2
2753// CHECK-ERROR-NEXT:                       ^
2754// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2755// CHECK-ERROR-NEXT:         ldpsw x1, x2, [x10], #256
2756// CHECK-ERROR-NEXT:                       ^
2757// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2758// CHECK-ERROR-NEXT:         ldpsw x3, x4, [x11], #-260
2759// CHECK-ERROR-NEXT:                       ^
2760
2761        ldp x2, x5, [sp], #4
2762        ldp x5, x6, [x9], #512
2763        stp x7, x8, [x10], #-520
2764// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2765// CHECK-ERROR-NEXT:         ldp x2, x5, [sp], #4
2766// CHECK-ERROR-NEXT:                           ^
2767// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2768// CHECK-ERROR-NEXT:         ldp x5, x6, [x9], #512
2769// CHECK-ERROR-NEXT:                           ^
2770// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2771// CHECK-ERROR-NEXT:         stp x7, x8, [x10], #-520
2772// CHECK-ERROR-NEXT:                            ^
2773
2774        ldp sp, x3, [x10], #0
2775        stp x3, sp, [x9], #0
2776// CHECK-ERROR: error: invalid operand for instruction
2777// CHECK-ERROR-NEXT:         ldp sp, x3, [x10], #0
2778// CHECK-ERROR-NEXT:             ^
2779// CHECK-ERROR-NEXT: error: invalid operand for instruction
2780// CHECK-ERROR-NEXT:         stp x3, sp, [x9], #0
2781// CHECK-ERROR-NEXT:                 ^
2782
2783        stp s3, s5, [sp], #-2
2784        ldp s6, s26, [x4], #-260
2785        stp s13, s19, [x5], #256
2786// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2787// CHECK-ERROR-NEXT:         stp s3, s5, [sp], #-2
2788// CHECK-ERROR-NEXT:                     ^
2789// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2790// CHECK-ERROR-NEXT:         ldp s6, s26, [x4], #-260
2791// CHECK-ERROR-NEXT:                      ^
2792// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2793// CHECK-ERROR-NEXT:         stp s13, s19, [x5], #256
2794// CHECK-ERROR-NEXT:                       ^
2795
2796        ldp d3, d4, [xzr], #0
2797        ldp d5, d6, [x0], #512
2798        stp d7, d8, [x0], #-520
2799// CHECK-ERROR: error: invalid operand for instruction
2800// CHECK-ERROR-NEXT:         ldp d3, d4, [xzr], #0
2801// CHECK-ERROR-NEXT:                      ^
2802// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2803// CHECK-ERROR-NEXT:         ldp d5, d6, [x0], #512
2804// CHECK-ERROR-NEXT:                     ^
2805// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2806// CHECK-ERROR-NEXT:         stp d7, d8, [x0], #-520
2807// CHECK-ERROR-NEXT:                     ^
2808
2809        ldp d3, q2, [sp], #0
2810        ldp q3, q5, [sp], #8
2811        stp q20, q25, [x5], #1024
2812        ldp q30, q15, [x23], #-1040
2813// CHECK-ERROR: error: invalid operand for instruction
2814// CHECK-ERROR-NEXT:         ldp d3, q2, [sp], #0
2815// CHECK-ERROR-NEXT:                 ^
2816// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2817// CHECK-ERROR-NEXT:         ldp q3, q5, [sp], #8
2818// CHECK-ERROR-NEXT:                     ^
2819// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2820// CHECK-ERROR-NEXT:         stp q20, q25, [x5], #1024
2821// CHECK-ERROR-NEXT:                       ^
2822// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2823// CHECK-ERROR-NEXT:         ldp q30, q15, [x23], #-1040
2824// CHECK-ERROR-NEXT:                       ^
2825
2826//------------------------------------------------------------------------------
2827// Load/store register pair (pre-indexed)
2828//------------------------------------------------------------------------------
2829        ldp v0, v1, [x0, #0]!
2830        stp v0, v1, [x0, #0]!
2831// CHECK-ERROR-NEXT: error: invalid operand for instruction
2832// CHECK-ERROR-NEXT:         ldp v0, v1, [x0, #0]!
2833// CHECK-ERROR-NEXT:             ^
2834// CHECK-ERROR-NEXT: error: invalid operand for instruction
2835// CHECK-ERROR-NEXT:         stp v0, v1, [x0, #0]!
2836// CHECK-ERROR-NEXT:             ^
2837
2838        ldp w3, w2, [x4, #1]!
2839        stp w1, w2, [x3, #253]!
2840        stp w9, w10, [x5, #256]!
2841        ldp w11, w12, [x9, #-260]!
2842        stp wsp, w9, [sp, #0]!
2843// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2844// CHECK-ERROR-NEXT:         ldp w3, w2, [x4, #1]!
2845// CHECK-ERROR-NEXT:                           ^
2846// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2847// CHECK-ERROR-NEXT:         stp w1, w2, [x3, #253]!
2848// CHECK-ERROR-NEXT:                     ^
2849// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2850// CHECK-ERROR-NEXT:         stp w9, w10, [x5, #256]!
2851// CHECK-ERROR-NEXT:                      ^
2852// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2853// CHECK-ERROR-NEXT:         ldp w11, w12, [x9, #-260]!
2854// CHECK-ERROR-NEXT:                       ^
2855// CHECK-ERROR-NEXT: error: invalid operand for instruction
2856// CHECK-ERROR-NEXT:         stp wsp, w9, [sp, #0]!
2857// CHECK-ERROR-NEXT:             ^
2858
2859        ldpsw x9, x2, [sp, #2]!
2860        ldpsw x1, x2, [x10, #256]!
2861        ldpsw x3, x4, [x11, #-260]!
2862// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2863// CHECK-ERROR-NEXT:         ldpsw x9, x2, [sp, #2]!
2864// CHECK-ERROR-NEXT:                       ^
2865// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2866// CHECK-ERROR-NEXT:         ldpsw x1, x2, [x10, #256]!
2867// CHECK-ERROR-NEXT:                       ^
2868// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2869// CHECK-ERROR-NEXT:         ldpsw x3, x4, [x11, #-260]!
2870// CHECK-ERROR-NEXT:                       ^
2871
2872        ldp x2, x5, [sp, #4]!
2873        ldp x5, x6, [x9, #512]!
2874        stp x7, x8, [x10, #-520]!
2875// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2876// CHECK-ERROR-NEXT:         ldp x2, x5, [sp, #4]!
2877// CHECK-ERROR-NEXT:                     ^
2878// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2879// CHECK-ERROR-NEXT:         ldp x5, x6, [x9, #512]!
2880// CHECK-ERROR-NEXT:                     ^
2881// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2882// CHECK-ERROR-NEXT:         stp x7, x8, [x10, #-520]!
2883// CHECK-ERROR-NEXT:                     ^
2884
2885        ldp sp, x3, [x10, #0]!
2886        stp x3, sp, [x9, #0]!
2887// CHECK-ERROR: error: invalid operand for instruction
2888// CHECK-ERROR-NEXT:         ldp sp, x3, [x10, #0]!
2889// CHECK-ERROR-NEXT:             ^
2890// CHECK-ERROR-NEXT: error: invalid operand for instruction
2891// CHECK-ERROR-NEXT:         stp x3, sp, [x9, #0]!
2892// CHECK-ERROR-NEXT:                 ^
2893
2894        stp s3, s5, [sp, #-2]!
2895        ldp s6, s26, [x4, #-260]!
2896        stp s13, s19, [x5, #256]!
2897// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2898// CHECK-ERROR-NEXT:         stp s3, s5, [sp, #-2]!
2899// CHECK-ERROR-NEXT:                     ^
2900// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2901// CHECK-ERROR-NEXT:         ldp s6, s26, [x4, #-260]!
2902// CHECK-ERROR-NEXT:                      ^
2903// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2904// CHECK-ERROR-NEXT:         stp s13, s19, [x5, #256]!
2905// CHECK-ERROR-NEXT:                       ^
2906
2907        ldp d3, d4, [xzr, #0]!
2908        ldp d5, d6, [x0, #512]!
2909        stp d7, d8, [x0, #-520]!
2910// CHECK-ERROR: error: invalid operand for instruction
2911// CHECK-ERROR-NEXT:         ldp d3, d4, [xzr, #0]!
2912// CHECK-ERROR-NEXT:                      ^
2913// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2914// CHECK-ERROR-NEXT:         ldp d5, d6, [x0, #512]!
2915// CHECK-ERROR-NEXT:                     ^
2916// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2917// CHECK-ERROR-NEXT:         stp d7, d8, [x0, #-520]!
2918// CHECK-ERROR-NEXT:                     ^
2919
2920        ldp d3, q2, [sp, #0]!
2921        ldp q3, q5, [sp, #8]!
2922        stp q20, q25, [x5, #1024]!
2923        ldp q30, q15, [x23, #-1040]!
2924// CHECK-ERROR: error: invalid operand for instruction
2925// CHECK-ERROR-NEXT:         ldp d3, q2, [sp, #0]!
2926// CHECK-ERROR-NEXT:                 ^
2927// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2928// CHECK-ERROR-NEXT:         ldp q3, q5, [sp, #8]!
2929// CHECK-ERROR-NEXT:                     ^
2930// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2931// CHECK-ERROR-NEXT:         stp q20, q25, [x5, #1024]!
2932// CHECK-ERROR-NEXT:                       ^
2933// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
2934// CHECK-ERROR-NEXT:         ldp q30, q15, [x23, #-1040]!
2935// CHECK-ERROR-NEXT:                       ^
2936
2937//------------------------------------------------------------------------------
2938// Load/store register pair (offset)
2939//------------------------------------------------------------------------------
2940        ldnp v0, v1, [x0, #0]
2941        stnp v0, v1, [x0, #0]
2942// CHECK-ERROR-NEXT: error: invalid operand for instruction
2943// CHECK-ERROR-NEXT:         ldnp v0, v1, [x0, #0]
2944// CHECK-ERROR-NEXT:              ^
2945// CHECK-ERROR-NEXT: error: invalid operand for instruction
2946// CHECK-ERROR-NEXT:         stnp v0, v1, [x0, #0]
2947// CHECK-ERROR-NEXT:              ^
2948
2949        ldnp w3, w2, [x4, #1]
2950        stnp w1, w2, [x3, #253]
2951        stnp w9, w10, [x5, #256]
2952        ldnp w11, w12, [x9, #-260]
2953        stnp wsp, w9, [sp]
2954// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2955// CHECK-ERROR-NEXT:         ldnp w3, w2, [x4, #1]
2956// CHECK-ERROR-NEXT:                           ^
2957// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2958// CHECK-ERROR-NEXT:         stnp w1, w2, [x3, #253]
2959// CHECK-ERROR-NEXT:                           ^
2960// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2961// CHECK-ERROR-NEXT:         stnp w9, w10, [x5, #256]
2962// CHECK-ERROR-NEXT:                            ^
2963// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2964// CHECK-ERROR-NEXT:         ldnp w11, w12, [x9, #-260]
2965// CHECK-ERROR-NEXT:                             ^
2966// CHECK-ERROR-NEXT: error: invalid operand for instruction
2967// CHECK-ERROR-NEXT:         stnp wsp, w9, [sp]
2968// CHECK-ERROR-NEXT:              ^
2969
2970        ldnp x2, x5, [sp, #4]
2971        ldnp x5, x6, [x9, #512]
2972        stnp x7, x8, [x10, #-520]
2973// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2974// CHECK-ERROR-NEXT:         ldnp x2, x5, [sp, #4]
2975// CHECK-ERROR-NEXT:                           ^
2976// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2977// CHECK-ERROR-NEXT:         ldnp x5, x6, [x9, #512]
2978// CHECK-ERROR-NEXT:                           ^
2979// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
2980// CHECK-ERROR-NEXT:         stnp x7, x8, [x10, #-520]
2981// CHECK-ERROR-NEXT:                            ^
2982
2983        ldnp sp, x3, [x10]
2984        stnp x3, sp, [x9]
2985// CHECK-ERROR: error: invalid operand for instruction
2986// CHECK-ERROR-NEXT:         ldnp sp, x3, [x10]
2987// CHECK-ERROR-NEXT:             ^
2988// CHECK-ERROR-NEXT: error: invalid operand for instruction
2989// CHECK-ERROR-NEXT:         stnp x3, sp, [x9]
2990// CHECK-ERROR-NEXT:                 ^
2991
2992        stnp s3, s5, [sp, #-2]
2993        ldnp s6, s26, [x4, #-260]
2994        stnp s13, s19, [x5, #256]
2995// CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2996// CHECK-ERROR-NEXT:         stnp s3, s5, [sp, #-2]
2997// CHECK-ERROR-NEXT:                     ^
2998// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
2999// CHECK-ERROR-NEXT:         ldnp s6, s26, [x4, #-260]
3000// CHECK-ERROR-NEXT:                      ^
3001// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
3002// CHECK-ERROR-NEXT:         stnp s13, s19, [x5, #256]
3003// CHECK-ERROR-NEXT:                       ^
3004
3005        ldnp d3, d4, [xzr]
3006        ldnp d5, d6, [x0, #512]
3007        stnp d7, d8, [x0, #-520]
3008// CHECK-ERROR: error: invalid operand for instruction
3009// CHECK-ERROR-NEXT:         ldnp d3, d4, [xzr]
3010// CHECK-ERROR-NEXT:                      ^
3011// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
3012// CHECK-ERROR-NEXT:         ldnp d5, d6, [x0, #512]
3013// CHECK-ERROR-NEXT:                     ^
3014// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
3015// CHECK-ERROR-NEXT:         stnp d7, d8, [x0, #-520]
3016// CHECK-ERROR-NEXT:                     ^
3017
3018        ldnp d3, q2, [sp]
3019        ldnp q3, q5, [sp, #8]
3020        stnp q20, q25, [x5, #1024]
3021        ldnp q30, q15, [x23, #-1040]
3022// CHECK-ERROR: error: invalid operand for instruction
3023// CHECK-ERROR-NEXT:         ldnp d3, q2, [sp]
3024// CHECK-ERROR-NEXT:                 ^
3025// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
3026// CHECK-ERROR-NEXT:         ldnp q3, q5, [sp, #8]
3027// CHECK-ERROR-NEXT:                     ^
3028// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
3029// CHECK-ERROR-NEXT:         stnp q20, q25, [x5, #1024]
3030// CHECK-ERROR-NEXT:                       ^
3031// CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
3032// CHECK-ERROR-NEXT:         ldnp q30, q15, [x23, #-1040]
3033// CHECK-ERROR-NEXT:                       ^
3034
3035//------------------------------------------------------------------------------
3036// Logical (shifted register)
3037//------------------------------------------------------------------------------
3038        orr w0, w1, #0xffffffff
3039        and x3, x5, #0xffffffffffffffff
3040// CHECK-ERROR: error: expected compatible register or logical immediate
3041// CHECK-ERROR-NEXT:         orr w0, w1, #0xffffffff
3042// CHECK-ERROR-NEXT:                     ^
3043// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
3044// CHECK-ERROR-NEXT:         and x3, x5, #0xffffffffffffffff
3045// CHECK-ERROR-NEXT:                     ^
3046
3047        ands w3, w9, #0x0
3048        eor x2, x0, #0x0
3049// CHECK-ERROR: error: expected compatible register or logical immediate
3050// CHECK-ERROR-NEXT:         ands w3, w9, #0x0
3051// CHECK-ERROR-NEXT:                      ^
3052// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
3053// CHECK-ERROR-NEXT:         eor x2, x0, #0x0
3054// CHECK-ERROR-NEXT:                     ^
3055
3056        eor w3, w5, #0x83
3057        eor x9, x20, #0x1234
3058// CHECK-ERROR: error: expected compatible register or logical immediate
3059// CHECK-ERROR-NEXT:         eor w3, w5, #0x83
3060// CHECK-ERROR-NEXT:                     ^
3061// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
3062// CHECK-ERROR-NEXT:         eor x9, x20, #0x1234
3063// CHECK-ERROR-NEXT:                      ^
3064
3065        and wzr, w4, 0xffff0000
3066        eor xzr, x9, #0xffff0000ffff0000
3067// CHECK-ERROR: error: invalid operand for instruction
3068// CHECK-ERROR-NEXT:         and wzr, w4, 0xffff0000
3069// CHECK-ERROR-NEXT:                      ^
3070// CHECK-ERROR-NEXT: error: invalid operand for instruction
3071// CHECK-ERROR-NEXT:         eor xzr, x9, #0xffff0000ffff0000
3072// CHECK-ERROR-NEXT:                      ^
3073
3074        orr w3, wsp, #0xf0f0f0f0
3075        ands x3, sp, #0xaaaaaaaaaaaaaaaa
3076// CHECK-ERROR: error: invalid operand for instruction
3077// CHECK-ERROR-NEXT:         orr w3, wsp, #0xf0f0f0f0
3078// CHECK-ERROR-NEXT:                 ^
3079// CHECK-ERROR-NEXT: error: invalid operand for instruction
3080// CHECK-ERROR-NEXT:         ands x3, sp, #0xaaaaaaaaaaaaaaaa
3081// CHECK-ERROR-NEXT:                  ^
3082
3083        tst sp, #0xe0e0e0e0e0e0e0e0
3084// CHECK-ERROR: error: invalid operand for instruction
3085// CHECK-ERROR-NEXT:         tst sp, #0xe0e0e0e0e0e0e0e0
3086// CHECK-ERROR-NEXT:             ^
3087
3088        // movi has been removed from the specification. Make sure it's really gone.
3089        movi wzr, #0x44444444
3090        movi w3, #0xffff
3091        movi x9, #0x0000ffff00000000
3092// CHECK-ERROR: error: invalid operand for instruction
3093// CHECK-ERROR-NEXT:         movi wzr, #0x44444444
3094// CHECK-ERROR-NEXT:         ^
3095// CHECK-ERROR: error: invalid operand for instruction
3096// CHECK-ERROR-NEXT:         movi w3, #0xffff
3097// CHECK-ERROR-NEXT:         ^
3098// CHECK-ERROR: error: invalid operand for instruction
3099// CHECK-ERROR-NEXT:         movi x9, #0x0000ffff00000000
3100// CHECK-ERROR-NEXT:         ^
3101
3102//------------------------------------------------------------------------------
3103// Logical (shifted register)
3104//------------------------------------------------------------------------------
3105
3106        //// Out of range shifts
3107        and w2, w24, w6, lsl #-1
3108        and w4, w6, w12, lsl #32
3109        and x4, x6, x12, lsl #64
3110        and x2, x5, x11, asr
3111// CHECK-ERROR: error: expected integer shift amount
3112// CHECK-ERROR-NEXT:         and w2, w24, w6, lsl #-1
3113// CHECK-ERROR-NEXT:                               ^
3114// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
3115// CHECK-ERROR-NEXT:         and w4, w6, w12, lsl #32
3116// CHECK-ERROR-NEXT:                          ^
3117// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
3118// CHECK-ERROR-NEXT:         and x4, x6, x12, lsl #64
3119// CHECK-ERROR-NEXT:                          ^
3120// CHECK-ERROR-NEXT: error: expected #imm after shift specifier
3121// CHECK-ERROR-NEXT:         and x2, x5, x11, asr
3122// CHECK-ERROR-NEXT:                             ^
3123
3124        //// sp not allowed
3125        orn wsp, w3, w5
3126        bics x20, sp, x9, lsr #0
3127        orn x2, x6, sp, lsl #3
3128// FIXME: the diagnostic we get for 'orn wsp, w3, w5' is from the orn alias,
3129// which is a better match than the genuine ORNWri, whereas it would be better
3130// to get the ORNWri diagnostic when the alias did not match, i.e. the
3131// alias' diagnostics should have a lower priority.
3132// CHECK-ERROR: error: expected compatible register or logical immediate
3133// CHECK-ERROR-NEXT:         orn wsp, w3, w5
3134// CHECK-ERROR-NEXT:                      ^
3135// CHECK-ERROR-NEXT: error: invalid operand for instruction
3136// CHECK-ERROR-NEXT:         bics x20, sp, x9, lsr #0
3137// CHECK-ERROR-NEXT:                   ^
3138// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
3139// CHECK-ERROR-NEXT:         orn x2, x6, sp, lsl #3
3140// CHECK-ERROR-NEXT:                     ^
3141
3142        //// Mismatched registers
3143        and x3, w2, w1
3144        ands w1, x12, w2
3145        and x4, x5, w6, lsl #12
3146        orr w2, w5, x7, asr #0
3147// CHECK-ERROR: error: invalid operand for instruction
3148// CHECK-ERROR-NEXT:         and x3, w2, w1
3149// CHECK-ERROR-NEXT:                 ^
3150// CHECK-ERROR-NEXT: error: invalid operand for instruction
3151// CHECK-ERROR-NEXT:         ands w1, x12, w2
3152// CHECK-ERROR-NEXT:                  ^
3153// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
3154// CHECK-ERROR-NEXT:         and x4, x5, w6, lsl #12
3155// CHECK-ERROR-NEXT:                     ^
3156// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
3157// CHECK-ERROR-NEXT:         orr w2, w5, x7, asr #0
3158// CHECK-ERROR-NEXT:                     ^
3159
3160        //// Shifts should not be allowed on mov
3161        mov w3, w7, lsl #13
3162// CHECK-ERROR: error: invalid operand for instruction
3163// CHECK-ERROR-NEXT:         mov w3, w7, lsl #13
3164// CHECK-ERROR-NEXT:                     ^
3165
3166//------------------------------------------------------------------------------
3167// Move wide (immediate)
3168//------------------------------------------------------------------------------
3169
3170        movz w3, #65536, lsl #0
3171        movz w4, #65536
3172        movn w1, #2, lsl #1
3173        movk w3, #0, lsl #-1
3174        movn w2, #-1, lsl #0
3175        movz x3, #-1
3176        movk w3, #1, lsl #32
3177        movn x2, #12, lsl #64
3178// CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3179// CHECK-ERROR-NEXT:         movz w3, #65536, lsl #0
3180// CHECK-ERROR-NEXT:                  ^
3181// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3182// CHECK-ERROR-NEXT:         movz w4, #65536
3183// CHECK-ERROR-NEXT:                  ^
3184// CHECK-ERROR-AARCH64-NEXT: error: expected relocated symbol or integer in range [0, 65535]
3185// CHECK-ERROR-ARM64-NEXT: error: expected 'lsl' with optional integer 0 or 16
3186// CHECK-ERROR-NEXT:         movn w1, #2, lsl #1
3187// CHECK-ERROR-NEXT:                  ^
3188// CHECK-ERROR-AARCH64-NEXT: error: only 'lsl #+N' valid after immediate
3189// CHECK-ERROR-ARM64-NEXT: error: expected integer shift amount
3190// CHECK-ERROR-NEXT:         movk w3, #0, lsl #-1
3191// CHECK-ERROR-NEXT:                           ^
3192// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3193// CHECK-ERROR-NEXT:         movn w2, #-1, lsl #0
3194// CHECK-ERROR-NEXT:                  ^
3195// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3196// CHECK-ERROR-NEXT:         movz x3, #-1
3197// CHECK-ERROR-NEXT:                  ^
3198// CHECK-ERROR-AARCH64-NEXT: error: expected relocated symbol or integer in range [0, 65535]
3199// CHECK-ERROR-ARM64-NEXT: error: expected 'lsl' with optional integer 0 or 16
3200// CHECK-ERROR-NEXT:         movk w3, #1, lsl #32
3201// CHECK-ERROR-NEXT:                  ^
3202// CHECK-ERROR-AARCH64-NEXT: error: expected relocated symbol or integer in range [0, 65535]
3203// CHECK-ERROR-ARM64-NEXT: error: expected 'lsl' with optional integer 0, 16, 32 or 48
3204// CHECK-ERROR-NEXT:         movn x2, #12, lsl #64
3205// CHECK-ERROR-NEXT:                  ^
3206
3207        movz x12, #:abs_g0:sym, lsl #16
3208        movz x12, #:abs_g0:sym, lsl #0
3209        movn x2, #:abs_g0:sym
3210        movk w3, #:abs_g0:sym
3211        movz x3, #:abs_g0_nc:sym
3212        movn x4, #:abs_g0_nc:sym
3213// CHECK-ERROR: error: invalid operand for instruction
3214// CHECK-ERROR-NEXT:         movz x12, #:abs_g0:sym, lsl #16
3215// CHECK-ERROR-NEXT:                                 ^
3216// CHECK-ERROR:  error: invalid operand for instruction
3217// CHECK-ERROR-NEXT:         movz x12, #:abs_g0:sym, lsl #0
3218// CHECK-ERROR-NEXT:                                 ^
3219
3220        movn x2, #:abs_g1:sym
3221        movk w3, #:abs_g1:sym
3222        movz x3, #:abs_g1_nc:sym
3223        movn x4, #:abs_g1_nc:sym
3224
3225        movz w12, #:abs_g2:sym
3226        movn x12, #:abs_g2:sym
3227        movk x13, #:abs_g2:sym
3228        movk w3, #:abs_g2_nc:sym
3229        movz x13, #:abs_g2_nc:sym
3230        movn x24, #:abs_g2_nc:sym
3231// CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3232// CHECK-ERROR-NEXT:         movz w12, #:abs_g2:sym
3233// CHECK-ERROR-NEXT:                   ^
3234// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3235// CHECK-ERROR-NEXT:         movk w3, #:abs_g2_nc:sym
3236// CHECK-ERROR-NEXT:                  ^
3237
3238        movn x19, #:abs_g3:sym
3239        movz w20, #:abs_g3:sym
3240        movk w21, #:abs_g3:sym
3241// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3242// CHECK-ERROR-NEXT:         movz w20, #:abs_g3:sym
3243// CHECK-ERROR-NEXT:                   ^
3244// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3245// CHECK-ERROR-NEXT:         movk w21, #:abs_g3:sym
3246// CHECK-ERROR-NEXT:                   ^
3247
3248        movk x19, #:abs_g0_s:sym
3249        movk w23, #:abs_g0_s:sym
3250
3251        movk x19, #:abs_g1_s:sym
3252        movk w23, #:abs_g1_s:sym
3253
3254        movz w2, #:abs_g2_s:sym
3255        movn w29, #:abs_g2_s:sym
3256        movk x19, #:abs_g2_s:sym
3257        movk w23, #:abs_g2_s:sym
3258// CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3259// CHECK-ERROR-NEXT:         movz w2, #:abs_g2_s:sym
3260// CHECK-ERROR-NEXT:                    ^
3261// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3262// CHECK-ERROR-NEXT:         movn w29, #:abs_g2_s:sym
3263// CHECK-ERROR-NEXT:                   ^
3264// CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
3265// CHECK-ERROR-NEXT:         movk w23, #:abs_g2_s:sym
3266// CHECK-ERROR-NEXT:                   ^
3267
3268//------------------------------------------------------------------------------
3269// PC-relative addressing
3270//------------------------------------------------------------------------------
3271
3272        adr sp, loc             // expects xzr
3273        adr x0, :got:loc        // bad relocation type
3274        adr x1, :lo12:loc
3275        adrp x3, #20            // Immediate unaligned
3276        adrp w2, loc            // 64-bit register needed
3277        adrp x5, :got_lo12:loc  // bad relocation type
3278// CHECK-ERROR: error: invalid operand for instruction
3279// CHECK-ERROR-NEXT:         adr sp, loc
3280// CHECK-ERROR-NEXT:             ^
3281// CHECK-ERROR-NEXT: error: unexpected adr label
3282// CHECK-ERROR-NEXT:         adr x0, :got:loc
3283// CHECK-ERROR-NEXT:             ^
3284// CHECK-ERROR-NEXT: error: unexpected adr label
3285// CHECK-ERROR-NEXT:         adr x1, :lo12:loc
3286// CHECK-ERROR-NEXT:             ^
3287// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
3288// CHECK-ERROR-NEXT:         adrp x3, #20
3289// CHECK-ERROR-NEXT:                  ^
3290// CHECK-ERROR-NEXT: error: invalid operand for instruction
3291// CHECK-ERROR-NEXT:         adrp w2, loc
3292// CHECK-ERROR-NEXT:              ^
3293// CHECK-ERROR-NEXT: error: page or gotpage label reference expected
3294// CHECK-ERROR-NEXT:         adrp x5, :got_lo12:loc
3295// CHECK-ERROR-NEXT:             ^
3296
3297        adr x9, #1048576
3298        adr x2, #-1048577
3299        adrp x9, #4294967296
3300        adrp x20, #-4294971392
3301// CHECK-ERROR: error: expected label or encodable integer pc offset
3302// CHECK-ERROR-NEXT:         adr x9, #1048576
3303// CHECK-ERROR-NEXT:                 ^
3304// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
3305// CHECK-ERROR-NEXT:         adr x2, #-1048577
3306// CHECK-ERROR-NEXT:                  ^
3307// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
3308// CHECK-ERROR-NEXT:         adrp x9, #4294967296
3309// CHECK-ERROR-NEXT:                  ^
3310// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
3311// CHECK-ERROR-NEXT:         adrp x20, #-4294971392
3312// CHECK-ERROR-NEXT:                   ^
3313
3314//------------------------------------------------------------------------------
3315// System
3316//------------------------------------------------------------------------------
3317
3318        hint #-1
3319        hint #128
3320// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 127]
3321// CHECK-ERROR-NEXT:         hint #-1
3322// CHECK-ERROR-NEXT:              ^
3323// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 127]
3324// CHECK-ERROR-NEXT:         hint #128
3325// CHECK-ERROR-NEXT:              ^
3326
3327        clrex #-1
3328        clrex #16
3329// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
3330// CHECK-ERROR-NEXT:         clrex #-1
3331// CHECK-ERROR-NEXT:               ^
3332// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
3333// CHECK-ERROR-NEXT:         clrex #16
3334// CHECK-ERROR-NEXT:               ^
3335
3336        dsb #-1
3337        dsb #17
3338        dsb foo
3339        dmb #-1
3340        dmb #17
3341        dmb foo
3342// CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
3343// CHECK-ERROR-NEXT:         dsb #-1
3344// CHECK-ERROR-NEXT:             ^
3345// CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
3346// CHECK-ERROR-NEXT:         dsb #17
3347// CHECK-ERROR-NEXT:             ^
3348// CHECK-ERROR-NEXT: error: invalid barrier option name
3349// CHECK-ERROR-NEXT:         dsb foo
3350// CHECK-ERROR-NEXT:             ^
3351// CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
3352// CHECK-ERROR-NEXT:         dmb #-1
3353// CHECK-ERROR-NEXT:             ^
3354// CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
3355// CHECK-ERROR-NEXT:         dmb #17
3356// CHECK-ERROR-NEXT:             ^
3357// CHECK-ERROR-NEXT: error: invalid barrier option name
3358// CHECK-ERROR-NEXT:         dmb foo
3359// CHECK-ERROR-NEXT:             ^
3360
3361        isb #-1
3362        isb #16
3363        isb foo
3364// CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
3365// CHECK-ERROR-NEXT:         isb #-1
3366// CHECK-ERROR-NEXT:             ^
3367// CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
3368// CHECK-ERROR-NEXT:         isb #16
3369// CHECK-ERROR-NEXT:             ^
3370// CHECK-ERROR-NEXT: error: 'sy' or #imm operand expected
3371// CHECK-ERROR-NEXT:        isb foo
3372// CHECK-ERROR-NEXT:            ^
3373
3374        msr daifset, x4
3375        msr spsel, #-1
3376        msr spsel #-1
3377        msr daifclr, #16
3378        msr CurrentEL, x12
3379// CHECK-ERROR: [[@LINE-5]]:22: error: {{expected|immediate must be an}} integer in range [0, 15]
3380// CHECK-ERROR: [[@LINE-5]]:20: error: {{expected|immediate must be an}} integer in range [0, 15]
3381// CHECK-ERROR: [[@LINE-5]]:{{9|19}}: error: {{too few operands for instruction|expected comma before next operand|unexpected token in argument list}}
3382// CHECK-ERROR: [[@LINE-5]]:22: error: {{expected|immediate must be an}} integer in range [0, 15]
3383// CHECK-ERROR: [[@LINE-5]]:13: error: expected writable system register or pstate
3384
3385        sys #8, c1, c2, #7, x9
3386        sys #3, c16, c2, #3, x10
3387        sys #2, c11, c16, #5
3388        sys #4, c9, c8, #8, xzr
3389        sysl x11, #8, c1, c2, #7
3390        sysl x13, #3, c16, c2, #3
3391        sysl x9, #2, c11, c16, #5
3392        sysl x4, #4, c9, c8, #8
3393// CHECK-ERROR: error:  {{expected|immediate must be an}} integer in range [0, 7]
3394// CHECK-ERROR-NEXT:         sys #8, c1, c2, #7, x9
3395// CHECK-ERROR-NEXT:             ^
3396// CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
3397// CHECK-ERROR-NEXT:         sys #3, c16, c2, #3, x10
3398// CHECK-ERROR-NEXT:                 ^
3399// CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
3400// CHECK-ERROR-NEXT:         sys #2, c11, c16, #5
3401// CHECK-ERROR-NEXT:                      ^
3402// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 7]
3403// CHECK-ERROR-NEXT:         sys #4, c9, c8, #8, xzr
3404// CHECK-ERROR-NEXT:                         ^
3405// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 7]
3406// CHECK-ERROR-NEXT:         sysl x11, #8, c1, c2, #7
3407// CHECK-ERROR-NEXT:                   ^
3408// CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
3409// CHECK-ERROR-NEXT:         sysl x13, #3, c16, c2, #3
3410// CHECK-ERROR-NEXT:                       ^
3411// CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
3412// CHECK-ERROR-NEXT:         sysl x9, #2, c11, c16, #5
3413// CHECK-ERROR-NEXT:                           ^
3414// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 7]
3415// CHECK-ERROR-NEXT:         sysl x4, #4, c9, c8, #8
3416// CHECK-ERROR-NEXT:                              ^
3417
3418        ic ialluis, x2
3419        ic allu, x7
3420        ic ivau
3421// CHECK-ERROR-NEXT: error: specified {{IC|ic}} op does not use a register
3422// CHECK-ERROR-NEXT:         ic ialluis, x2
3423// CHECK-ERROR-NEXT:                     ^
3424// CHECK-ERROR-AARCH64-NEXT: error: operand specifier not recognised
3425// CHECK-ERROR-ARM64-NEXT: error: invalid operand for IC instruction
3426// CHECK-ERROR-NEXT:         ic allu, x7
3427// CHECK-ERROR-NEXT:            ^
3428// CHECK-ERROR-NEXT: error: specified {{IC|ic}} op requires a register
3429// CHECK-ERROR-NEXT:         ic ivau
3430// CHECK-ERROR-NEXT:            ^
3431
3432        tlbi IPAS2E1IS
3433        tlbi IPAS2LE1IS
3434        tlbi VMALLE1IS, x12
3435        tlbi ALLE2IS, x11
3436        tlbi ALLE3IS, x20
3437        tlbi VAE1IS
3438        tlbi VAE2IS
3439        tlbi VAE3IS
3440        tlbi ASIDE1IS
3441        tlbi VAAE1IS
3442        tlbi ALLE1IS, x0
3443        tlbi VALE1IS
3444        tlbi VALE2IS
3445        tlbi VALE3IS
3446        tlbi VMALLS12E1IS, xzr
3447        tlbi VAALE1IS
3448        tlbi IPAS2E1
3449        tlbi IPAS2LE1
3450        tlbi VMALLE1, x9
3451        tlbi ALLE2, x10
3452        tlbi ALLE3, x11
3453        tlbi VAE1
3454        tlbi VAE2
3455        tlbi VAE3
3456        tlbi ASIDE1
3457        tlbi VAAE1
3458        tlbi ALLE1, x25
3459        tlbi VALE1
3460        tlbi VALE2
3461        tlbi VALE3
3462        tlbi VMALLS12E1, x15
3463        tlbi VAALE1
3464// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3465// CHECK-ERROR-NEXT:         tlbi IPAS2E1IS
3466// CHECK-ERROR-NEXT:              ^
3467// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3468// CHECK-ERROR-NEXT:         tlbi IPAS2LE1IS
3469// CHECK-ERROR-NEXT:              ^
3470// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3471// CHECK-ERROR-NEXT:         tlbi VMALLE1IS, x12
3472// CHECK-ERROR-NEXT:                         ^
3473// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3474// CHECK-ERROR-NEXT:         tlbi ALLE2IS, x11
3475// CHECK-ERROR-NEXT:                       ^
3476// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3477// CHECK-ERROR-NEXT:         tlbi ALLE3IS, x20
3478// CHECK-ERROR-NEXT:                       ^
3479// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3480// CHECK-ERROR-NEXT:         tlbi VAE1IS
3481// CHECK-ERROR-NEXT:              ^
3482// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3483// CHECK-ERROR-NEXT:         tlbi VAE2IS
3484// CHECK-ERROR-NEXT:              ^
3485// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3486// CHECK-ERROR-NEXT:         tlbi VAE3IS
3487// CHECK-ERROR-NEXT:              ^
3488// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3489// CHECK-ERROR-NEXT:         tlbi ASIDE1IS
3490// CHECK-ERROR-NEXT:              ^
3491// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3492// CHECK-ERROR-NEXT:         tlbi VAAE1IS
3493// CHECK-ERROR-NEXT:              ^
3494// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3495// CHECK-ERROR-NEXT:         tlbi ALLE1IS, x0
3496// CHECK-ERROR-NEXT:                       ^
3497// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3498// CHECK-ERROR-NEXT:         tlbi VALE1IS
3499// CHECK-ERROR-NEXT:              ^
3500// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3501// CHECK-ERROR-NEXT:         tlbi VALE2IS
3502// CHECK-ERROR-NEXT:              ^
3503// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3504// CHECK-ERROR-NEXT:         tlbi VALE3IS
3505// CHECK-ERROR-NEXT:              ^
3506// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3507// CHECK-ERROR-NEXT:         tlbi VMALLS12E1IS, xzr
3508// CHECK-ERROR-NEXT:                            ^
3509// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3510// CHECK-ERROR-NEXT:         tlbi VAALE1IS
3511// CHECK-ERROR-NEXT:              ^
3512// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3513// CHECK-ERROR-NEXT:         tlbi IPAS2E1
3514// CHECK-ERROR-NEXT:              ^
3515// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3516// CHECK-ERROR-NEXT:         tlbi IPAS2LE1
3517// CHECK-ERROR-NEXT:              ^
3518// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3519// CHECK-ERROR-NEXT:         tlbi VMALLE1, x9
3520// CHECK-ERROR-NEXT:                       ^
3521// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3522// CHECK-ERROR-NEXT:         tlbi ALLE2, x10
3523// CHECK-ERROR-NEXT:                     ^
3524// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3525// CHECK-ERROR-NEXT:         tlbi ALLE3, x11
3526// CHECK-ERROR-NEXT:                     ^
3527// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3528// CHECK-ERROR-NEXT:         tlbi VAE1
3529// CHECK-ERROR-NEXT:              ^
3530// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3531// CHECK-ERROR-NEXT:         tlbi VAE2
3532// CHECK-ERROR-NEXT:              ^
3533// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3534// CHECK-ERROR-NEXT:         tlbi VAE3
3535// CHECK-ERROR-NEXT:              ^
3536// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3537// CHECK-ERROR-NEXT:         tlbi ASIDE1
3538// CHECK-ERROR-NEXT:              ^
3539// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3540// CHECK-ERROR-NEXT:         tlbi VAAE1
3541// CHECK-ERROR-NEXT:              ^
3542// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3543// CHECK-ERROR-NEXT:         tlbi ALLE1, x25
3544// CHECK-ERROR-NEXT:                     ^
3545// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3546// CHECK-ERROR-NEXT:         tlbi VALE1
3547// CHECK-ERROR-NEXT:              ^
3548// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3549// CHECK-ERROR-NEXT:         tlbi VALE2
3550// CHECK-ERROR-NEXT:              ^
3551// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3552// CHECK-ERROR-NEXT:         tlbi VALE3
3553// CHECK-ERROR-NEXT:              ^
3554// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
3555// CHECK-ERROR-NEXT:         tlbi VMALLS12E1, x15
3556// CHECK-ERROR-NEXT:                          ^
3557// CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
3558// CHECK-ERROR-NEXT:         tlbi VAALE1
3559// CHECK-ERROR-NEXT:              ^
3560
3561// For the MSR/MRS instructions, first make sure read-only and
3562// write-only registers actually are.
3563        msr MDCCSR_EL0, x12
3564        msr DBGDTRRX_EL0, x12
3565        msr MDRAR_EL1, x12
3566        msr OSLSR_EL1, x12
3567        msr DBGAUTHSTATUS_EL1, x12
3568        msr MIDR_EL1, x12
3569        msr CCSIDR_EL1, x12
3570        msr CLIDR_EL1, x12
3571        msr CCSIDR2_EL1, x12
3572        msr CTR_EL0, x12
3573        msr MPIDR_EL1, x12
3574        msr REVIDR_EL1, x12
3575        msr AIDR_EL1, x12
3576        msr DCZID_EL0, x12
3577        msr ID_PFR0_EL1, x12
3578        msr ID_PFR1_EL1, x12
3579        msr ID_DFR0_EL1, x12
3580        msr ID_AFR0_EL1, x12
3581        msr ID_MMFR0_EL1, x12
3582        msr ID_MMFR1_EL1, x12
3583        msr ID_MMFR2_EL1, x12
3584        msr ID_MMFR3_EL1, x12
3585        msr ID_MMFR4_EL1, x12
3586        msr ID_MMFR5_EL1, x12
3587        msr ID_ISAR0_EL1, x12
3588        msr ID_ISAR1_EL1, x12
3589        msr ID_ISAR2_EL1, x12
3590        msr ID_ISAR3_EL1, x12
3591        msr ID_ISAR4_EL1, x12
3592        msr ID_ISAR5_EL1, x12
3593        msr MVFR0_EL1, x12
3594        msr MVFR1_EL1, x12
3595        msr MVFR2_EL1, x12
3596        msr ID_AA64PFR0_EL1, x12
3597        msr ID_AA64PFR1_EL1, x12
3598        msr ID_AA64DFR0_EL1, x12
3599        msr ID_AA64DFR1_EL1, x12
3600        msr ID_AA64AFR0_EL1, x12
3601        msr ID_AA64AFR1_EL1, x12
3602        msr ID_AA64ISAR0_EL1, x12
3603        msr ID_AA64ISAR1_EL1, x12
3604        msr ID_AA64MMFR0_EL1, x12
3605        msr ID_AA64MMFR1_EL1, x12
3606        msr PMCEID0_EL0, x12
3607        msr PMCEID1_EL0, x12
3608        msr RVBAR_EL1, x12
3609        msr RVBAR_EL2, x12
3610        msr RVBAR_EL3, x12
3611        msr ISR_EL1, x12
3612        msr CNTPCT_EL0, x12
3613        msr CNTVCT_EL0, x12
3614        msr PMEVCNTR31_EL0, x12
3615        msr PMEVTYPER31_EL0, x12
3616// CHECK-ERROR: error: expected writable system register or pstate
3617// CHECK-ERROR-NEXT:         msr MDCCSR_EL0, x12
3618// CHECK-ERROR-NEXT:             ^
3619// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3620// CHECK-ERROR-NEXT:         msr DBGDTRRX_EL0, x12
3621// CHECK-ERROR-NEXT:             ^
3622// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3623// CHECK-ERROR-NEXT:         msr MDRAR_EL1, x12
3624// CHECK-ERROR-NEXT:             ^
3625// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3626// CHECK-ERROR-NEXT:         msr OSLSR_EL1, x12
3627// CHECK-ERROR-NEXT:             ^
3628// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3629// CHECK-ERROR-NEXT:         msr DBGAUTHSTATUS_EL1, x12
3630// CHECK-ERROR-NEXT:             ^
3631// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3632// CHECK-ERROR-NEXT:         msr MIDR_EL1, x12
3633// CHECK-ERROR-NEXT:             ^
3634// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3635// CHECK-ERROR-NEXT:         msr CCSIDR_EL1, x12
3636// CHECK-ERROR-NEXT:             ^
3637// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3638// CHECK-ERROR-NEXT:         msr CLIDR_EL1, x12
3639// CHECK-ERROR-NEXT:             ^
3640// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3641// CHECK-ERROR-NEXT:         msr CCSIDR2_EL1, x12
3642// CHECK-ERROR-NEXT:             ^
3643// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3644// CHECK-ERROR-NEXT:         msr CTR_EL0, x12
3645// CHECK-ERROR-NEXT:             ^
3646// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3647// CHECK-ERROR-NEXT:         msr MPIDR_EL1, x12
3648// CHECK-ERROR-NEXT:             ^
3649// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3650// CHECK-ERROR-NEXT:         msr REVIDR_EL1, x12
3651// CHECK-ERROR-NEXT:             ^
3652// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3653// CHECK-ERROR-NEXT:         msr AIDR_EL1, x12
3654// CHECK-ERROR-NEXT:             ^
3655// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3656// CHECK-ERROR-NEXT:         msr DCZID_EL0, x12
3657// CHECK-ERROR-NEXT:             ^
3658// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3659// CHECK-ERROR-NEXT:         msr ID_PFR0_EL1, x12
3660// CHECK-ERROR-NEXT:             ^
3661// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3662// CHECK-ERROR-NEXT:         msr ID_PFR1_EL1, x12
3663// CHECK-ERROR-NEXT:             ^
3664// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3665// CHECK-ERROR-NEXT:         msr ID_DFR0_EL1, x12
3666// CHECK-ERROR-NEXT:             ^
3667// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3668// CHECK-ERROR-NEXT:         msr ID_AFR0_EL1, x12
3669// CHECK-ERROR-NEXT:             ^
3670// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3671// CHECK-ERROR-NEXT:         msr ID_MMFR0_EL1, x12
3672// CHECK-ERROR-NEXT:             ^
3673// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3674// CHECK-ERROR-NEXT:         msr ID_MMFR1_EL1, x12
3675// CHECK-ERROR-NEXT:             ^
3676// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3677// CHECK-ERROR-NEXT:         msr ID_MMFR2_EL1, x12
3678// CHECK-ERROR-NEXT:             ^
3679// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3680// CHECK-ERROR-NEXT:         msr ID_MMFR3_EL1, x12
3681// CHECK-ERROR-NEXT:             ^
3682// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3683// CHECK-ERROR-NEXT:         msr ID_MMFR4_EL1, x12
3684// CHECK-ERROR-NEXT:             ^
3685// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3686// CHECK-ERROR-NEXT:         msr ID_MMFR5_EL1, x12
3687// CHECK-ERROR-NEXT:             ^
3688// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3689// CHECK-ERROR-NEXT:         msr ID_ISAR0_EL1, x12
3690// CHECK-ERROR-NEXT:             ^
3691// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3692// CHECK-ERROR-NEXT:         msr ID_ISAR1_EL1, x12
3693// CHECK-ERROR-NEXT:             ^
3694// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3695// CHECK-ERROR-NEXT:         msr ID_ISAR2_EL1, x12
3696// CHECK-ERROR-NEXT:             ^
3697// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3698// CHECK-ERROR-NEXT:         msr ID_ISAR3_EL1, x12
3699// CHECK-ERROR-NEXT:             ^
3700// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3701// CHECK-ERROR-NEXT:         msr ID_ISAR4_EL1, x12
3702// CHECK-ERROR-NEXT:             ^
3703// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3704// CHECK-ERROR-NEXT:         msr ID_ISAR5_EL1, x12
3705// CHECK-ERROR-NEXT:             ^
3706// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3707// CHECK-ERROR-NEXT:         msr MVFR0_EL1, x12
3708// CHECK-ERROR-NEXT:             ^
3709// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3710// CHECK-ERROR-NEXT:         msr MVFR1_EL1, x12
3711// CHECK-ERROR-NEXT:             ^
3712// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3713// CHECK-ERROR-NEXT:         msr MVFR2_EL1, x12
3714// CHECK-ERROR-NEXT:             ^
3715// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3716// CHECK-ERROR-NEXT:         msr ID_AA64PFR0_EL1, x12
3717// CHECK-ERROR-NEXT:             ^
3718// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3719// CHECK-ERROR-NEXT:         msr ID_AA64PFR1_EL1, x12
3720// CHECK-ERROR-NEXT:             ^
3721// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3722// CHECK-ERROR-NEXT:         msr ID_AA64DFR0_EL1, x12
3723// CHECK-ERROR-NEXT:             ^
3724// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3725// CHECK-ERROR-NEXT:         msr ID_AA64DFR1_EL1, x12
3726// CHECK-ERROR-NEXT:             ^
3727// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3728// CHECK-ERROR-NEXT:         msr ID_AA64AFR0_EL1, x12
3729// CHECK-ERROR-NEXT:             ^
3730// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3731// CHECK-ERROR-NEXT:         msr ID_AA64AFR1_EL1, x12
3732// CHECK-ERROR-NEXT:             ^
3733// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3734// CHECK-ERROR-NEXT:         msr ID_AA64ISAR0_EL1, x12
3735// CHECK-ERROR-NEXT:             ^
3736// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3737// CHECK-ERROR-NEXT:         msr ID_AA64ISAR1_EL1, x12
3738// CHECK-ERROR-NEXT:             ^
3739// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3740// CHECK-ERROR-NEXT:         msr ID_AA64MMFR0_EL1, x12
3741// CHECK-ERROR-NEXT:             ^
3742// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3743// CHECK-ERROR-NEXT:         msr ID_AA64MMFR1_EL1, x12
3744// CHECK-ERROR-NEXT:             ^
3745// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3746// CHECK-ERROR-NEXT:         msr PMCEID0_EL0, x12
3747// CHECK-ERROR-NEXT:             ^
3748// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3749// CHECK-ERROR-NEXT:         msr PMCEID1_EL0, x12
3750// CHECK-ERROR-NEXT:             ^
3751// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3752// CHECK-ERROR-NEXT:         msr RVBAR_EL1, x12
3753// CHECK-ERROR-NEXT:             ^
3754// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3755// CHECK-ERROR-NEXT:         msr RVBAR_EL2, x12
3756// CHECK-ERROR-NEXT:             ^
3757// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3758// CHECK-ERROR-NEXT:         msr RVBAR_EL3, x12
3759// CHECK-ERROR-NEXT:             ^
3760// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3761// CHECK-ERROR-NEXT:         msr ISR_EL1, x12
3762// CHECK-ERROR-NEXT:             ^
3763// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3764// CHECK-ERROR-NEXT:         msr CNTPCT_EL0, x12
3765// CHECK-ERROR-NEXT:             ^
3766// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3767// CHECK-ERROR-NEXT:         msr CNTVCT_EL0, x12
3768// CHECK-ERROR-NEXT:             ^
3769// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3770// CHECK-ERROR-NEXT:         msr PMEVCNTR31_EL0, x12
3771// CHECK-ERROR-NEXT:             ^
3772// CHECK-ERROR-NEXT: error: expected writable system register or pstate
3773// CHECK-ERROR-NEXT:         msr PMEVTYPER31_EL0, x12
3774// CHECK-ERROR-NEXT:             ^
3775
3776        mrs x9, DBGDTRTX_EL0
3777        mrs x9, OSLAR_EL1
3778        mrs x9, PMSWINC_EL0
3779        mrs x9, PMEVCNTR31_EL0
3780        mrs x9, PMEVTYPER31_EL0
3781// CHECK-ERROR: error: expected readable system register
3782// CHECK-ERROR-NEXT:         mrs x9, DBGDTRTX_EL0
3783// CHECK-ERROR-NEXT:                 ^
3784// CHECK-ERROR-NEXT: error: expected readable system register
3785// CHECK-ERROR-NEXT:         mrs x9, OSLAR_EL1
3786// CHECK-ERROR-NEXT:                 ^
3787// CHECK-ERROR-NEXT: error: expected readable system register
3788// CHECK-ERROR-NEXT:         mrs x9, PMSWINC_EL0
3789// CHECK-ERROR-NEXT:                 ^
3790// CHECK-ERROR-NEXT: error: expected readable system register
3791// CHECK-ERROR-NEXT:         mrs x9, PMEVCNTR31_EL0
3792// CHECK-ERROR-NEXT:                 ^
3793// CHECK-ERROR-NEXT: error: expected readable system register
3794// CHECK-ERROR-NEXT:         mrs x9, PMEVTYPER31_EL0
3795// CHECK-ERROR-NEXT:                 ^
3796
3797// Now check some invalid generic names
3798        mrs x12, s3_8_c11_c13_2
3799        mrs x19, s3_2_c15_c16_2
3800        mrs x30, s3_2_c15_c1_8
3801        mrs x4, s4_7_c15_c15_7
3802        mrs x14, s3_7_c16_c15_7
3803// CHECK-ERROR-NEXT: error: expected readable system register
3804// CHECK-ERROR-NEXT:         mrs x12, s3_8_c11_c13_2
3805// CHECK-ERROR-NEXT:                  ^
3806// CHECK-ERROR-NEXT: error: expected readable system register
3807// CHECK-ERROR-NEXT:         mrs x19, s3_2_c15_c16_2
3808// CHECK-ERROR-NEXT:                  ^
3809// CHECK-ERROR-NEXT: error: expected readable system register
3810// CHECK-ERROR-NEXT:         mrs x30, s3_2_c15_c1_8
3811// CHECK-ERROR-NEXT:                  ^
3812// CHECK-ERROR-NEXT: error: expected readable system register
3813// CHECK-ERROR-NEXT:         mrs x4, s4_7_c15_c15_7
3814// CHECK-ERROR-NEXT:                 ^
3815// CHECK-ERROR-NEXT: error: expected readable system register
3816// CHECK-ERROR-NEXT:         mrs x14, s3_7_c16_c15_7
3817// CHECK-ERROR-NEXT:                  ^
3818
3819//------------------------------------------------------------------------------
3820// Test and branch (immediate)
3821//------------------------------------------------------------------------------
3822
3823        tbz w3, #-1, addr
3824        tbz w3, #32, nowhere
3825        tbz x9, #-1, there
3826        tbz x20, #64, dont
3827// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
3828// CHECK-ERROR-NEXT:     tbz w3, #-1, addr
3829// CHECK-ERROR-NEXT:             ^
3830// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
3831// CHECK-ERROR-NEXT:        tbz w3, #32, nowhere
3832// CHECK-ERROR-NEXT:                ^
3833// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
3834// CHECK-ERROR-NEXT:        tbz x9, #-1, there
3835// CHECK-ERROR-NEXT:                ^
3836// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
3837// CHECK-ERROR-NEXT:        tbz x20, #64, dont
3838// CHECK-ERROR-NEXT:                 ^
3839
3840        tbnz w3, #-1, addr
3841        tbnz w3, #32, nowhere
3842        tbnz x9, #-1, there
3843        tbnz x20, #64, dont
3844// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
3845// CHECK-ERROR-NEXT:        tbnz w3, #-1, addr
3846// CHECK-ERROR-NEXT:                 ^
3847// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
3848// CHECK-ERROR-NEXT:        tbnz w3, #32, nowhere
3849// CHECK-ERROR-NEXT:                 ^
3850// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
3851// CHECK-ERROR-NEXT:        tbnz x9, #-1, there
3852// CHECK-ERROR-NEXT:                 ^
3853// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
3854// CHECK-ERROR-NEXT:        tbnz x20, #64, dont
3855
3856//------------------------------------------------------------------------------
3857// Unconditional branch (immediate)
3858//------------------------------------------------------------------------------
3859
3860        b #134217728
3861        b #-134217732
3862        b #1
3863// CHECK-ERROR: error: expected label or encodable integer pc offset
3864// CHECK-ERROR-NEXT:         b #134217728
3865// CHECK-ERROR-NEXT:           ^
3866// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
3867// CHECK-ERROR-NEXT:         b #-134217732
3868// CHECK-ERROR-NEXT:           ^
3869// CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
3870// CHECK-ERROR-NEXT:         b #1
3871// CHECK-ERROR-NEXT:           ^
3872
3873//------------------------------------------------------------------------------
3874// Unconditional branch (register)
3875//------------------------------------------------------------------------------
3876
3877        br w2
3878        br sp
3879// CHECK-ERROR: error: invalid operand for instruction
3880// CHECK-ERROR-NEXT:         br w2
3881// CHECK-ERROR-NEXT:            ^
3882// CHECK-ERROR-NEXT: error: invalid operand for instruction
3883// CHECK-ERROR-NEXT:         br sp
3884// CHECK-ERROR-NEXT:            ^
3885
3886        //// These ones shouldn't allow any registers
3887        eret x2
3888        drps x2
3889// CHECK-ERROR: error: invalid operand for instruction
3890// CHECK-ERROR-NEXT:         eret x2
3891// CHECK-ERROR-NEXT:              ^
3892// CHECK-ERROR-NEXT: error: invalid operand for instruction
3893// CHECK-ERROR-NEXT:         drps x2
3894// CHECK-ERROR-NEXT:              ^
3895
3896