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