Home | History | Annotate | Download | only in AArch64
      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: more than 12 bits
     79         add w4, w5, #-4096
     80         add w5, w6, #0x1000
     81         add w4, w5, #-4096, 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, #-4096
     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, #-4096, 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         bfc wsp, #3, #6
   1092         bfc w4, #2, #31
   1093         bfc sp, #0, #1
   1094         bfc x6, #0, #0
   1095 // CHECK-ERROR: error: invalid operand for instruction
   1096 // CHECK-ERROR-NEXT:        bfc wsp, #3, #6
   1097 // CHECK-ERROR-NEXT:            ^
   1098 // CHECK-ERROR-NEXT: error: requested insert overflows register
   1099 // CHECK-ERROR-NEXT:         bfc w4, #2, #31
   1100 // CHECK-ERROR-NEXT:                     ^
   1101 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1102 // CHECK-ERROR-NEXT:         bfc sp, #0, #1
   1103 // CHECK-ERROR-NEXT:             ^
   1104 // CHECK-ERROR-NEXT: error: expected integer in range [1, 32]
   1105 // CHECK-ERROR-NEXT:         bfc x6, #0, #0
   1106 // CHECK-ERROR-NEXT:                     ^
   1107 
   1108 //------------------------------------------------------------------------------
   1109 // Compare & branch (immediate)
   1110 //------------------------------------------------------------------------------
   1111 
   1112         cbnz wsp, lbl
   1113         cbz  sp, lbl
   1114         cbz  x3, x5
   1115 // CHECK-ERROR: error: invalid operand for instruction
   1116 // CHECK-ERROR-NEXT:           cbnz wsp, lbl
   1117 // CHECK-ERROR-NEXT:                ^
   1118 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1119 // CHECK-ERROR-NEXT:           cbz sp, lbl
   1120 // CHECK-ERROR-NEXT:               ^
   1121 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1122 // CHECK-ERROR-NEXT:           cbz x3, x5
   1123 // CHECK-ERROR-NEXT:                   ^
   1124 
   1125         cbz w20, #1048576
   1126         cbnz xzr, #-1048580
   1127         cbz x29, #1
   1128 // CHECK-ERROR: error: expected label or encodable integer pc offset
   1129 // CHECK-ERROR-NEXT:           cbz w20, #1048576
   1130 // CHECK-ERROR-NEXT:                     ^
   1131 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1132 // CHECK-ERROR-NEXT:           cbnz xzr, #-1048580
   1133 // CHECK-ERROR-NEXT:                    ^
   1134 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1135 // CHECK-ERROR-NEXT:           cbz x29, #1
   1136 // CHECK-ERROR-NEXT:                    ^
   1137 
   1138 //------------------------------------------------------------------------------
   1139 // Conditional branch (immediate)
   1140 //------------------------------------------------------------------------------
   1141 
   1142         b.zf lbl
   1143 // CHECK-ERROR: error: invalid condition code
   1144 // CHECK-ERROR-NEXT:           b.zf lbl
   1145 // CHECK-ERROR-NEXT:             ^
   1146 
   1147         b.eq #1048576
   1148         b.ge #-1048580
   1149         b.cc #1
   1150 // CHECK-ERROR: error: expected label or encodable integer pc offset
   1151 // CHECK-ERROR-NEXT:           b.eq #1048576
   1152 // CHECK-ERROR-NEXT:                ^
   1153 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1154 // CHECK-ERROR-NEXT:           b.ge #-1048580
   1155 // CHECK-ERROR-NEXT:                ^
   1156 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1157 // CHECK-ERROR-NEXT:           b.cc #1
   1158 // CHECK-ERROR-NEXT:                ^
   1159 
   1160 //------------------------------------------------------------------------------
   1161 // Conditional compare (immediate)
   1162 //------------------------------------------------------------------------------
   1163 
   1164         ccmp wsp, #4, #2, ne
   1165         ccmp w25, #-1, #15, hs
   1166         ccmp w3, #32, #0, ge
   1167         ccmp w19, #5, #-1, lt
   1168         ccmp w20, #7, #16, hs
   1169 // CHECK-ERROR: error: invalid operand for instruction
   1170 // CHECK-ERROR-NEXT:        ccmp wsp, #4, #2, ne
   1171 // CHECK-ERROR-NEXT:             ^
   1172 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1173 // CHECK-ERROR-NEXT:        ccmp w25, #-1, #15, hs
   1174 // CHECK-ERROR-NEXT:                  ^
   1175 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1176 // CHECK-ERROR-NEXT:        ccmp w3, #32, #0, ge
   1177 // CHECK-ERROR-NEXT:                 ^
   1178 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1179 // CHECK-ERROR-NEXT:        ccmp w19, #5, #-1, lt
   1180 // CHECK-ERROR-NEXT:                      ^
   1181 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1182 // CHECK-ERROR-NEXT:        ccmp w20, #7, #16, hs
   1183 // CHECK-ERROR-NEXT:                      ^
   1184 
   1185         ccmp sp, #4, #2, ne
   1186         ccmp x25, #-1, #15, hs
   1187         ccmp x3, #32, #0, ge
   1188         ccmp x19, #5, #-1, lt
   1189         ccmp x20, #7, #16, hs
   1190 // CHECK-ERROR: error: invalid operand for instruction
   1191 // CHECK-ERROR-NEXT:        ccmp sp, #4, #2, ne
   1192 // CHECK-ERROR-NEXT:             ^
   1193 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1194 // CHECK-ERROR-NEXT:        ccmp x25, #-1, #15, hs
   1195 // CHECK-ERROR-NEXT:                  ^
   1196 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1197 // CHECK-ERROR-NEXT:        ccmp x3, #32, #0, ge
   1198 // CHECK-ERROR-NEXT:                 ^
   1199 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1200 // CHECK-ERROR-NEXT:        ccmp x19, #5, #-1, lt
   1201 // CHECK-ERROR-NEXT:                      ^
   1202 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1203 // CHECK-ERROR-NEXT:        ccmp x20, #7, #16, hs
   1204 // CHECK-ERROR-NEXT:                      ^
   1205 
   1206         ccmn wsp, #4, #2, ne
   1207         ccmn w25, #-1, #15, hs
   1208         ccmn w3, #32, #0, ge
   1209         ccmn w19, #5, #-1, lt
   1210         ccmn w20, #7, #16, hs
   1211 // CHECK-ERROR: error: invalid operand for instruction
   1212 // CHECK-ERROR-NEXT:        ccmn wsp, #4, #2, ne
   1213 // CHECK-ERROR-NEXT:             ^
   1214 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1215 // CHECK-ERROR-NEXT:        ccmn w25, #-1, #15, hs
   1216 // CHECK-ERROR-NEXT:                  ^
   1217 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1218 // CHECK-ERROR-NEXT:        ccmn w3, #32, #0, ge
   1219 // CHECK-ERROR-NEXT:                 ^
   1220 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1221 // CHECK-ERROR-NEXT:        ccmn w19, #5, #-1, lt
   1222 // CHECK-ERROR-NEXT:                      ^
   1223 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1224 // CHECK-ERROR-NEXT:        ccmn w20, #7, #16, hs
   1225 // CHECK-ERROR-NEXT:                      ^
   1226 
   1227         ccmn sp, #4, #2, ne
   1228         ccmn x25, #-1, #15, hs
   1229         ccmn x3, #32, #0, ge
   1230         ccmn x19, #5, #-1, lt
   1231         ccmn x20, #7, #16, hs
   1232 // CHECK-ERROR: error: invalid operand for instruction
   1233 // CHECK-ERROR-NEXT:        ccmn sp, #4, #2, ne
   1234 // CHECK-ERROR-NEXT:             ^
   1235 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1236 // CHECK-ERROR-NEXT:        ccmn x25, #-1, #15, hs
   1237 // CHECK-ERROR-NEXT:                  ^
   1238 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1239 // CHECK-ERROR-NEXT:        ccmn x3, #32, #0, ge
   1240 // CHECK-ERROR-NEXT:                 ^
   1241 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1242 // CHECK-ERROR-NEXT:        ccmn x19, #5, #-1, lt
   1243 // CHECK-ERROR-NEXT:                      ^
   1244 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1245 // CHECK-ERROR-NEXT:        ccmn x20, #7, #16, hs
   1246 // CHECK-ERROR-NEXT:                      ^
   1247 
   1248 //------------------------------------------------------------------------------
   1249 // Conditional compare (register)
   1250 //------------------------------------------------------------------------------
   1251 
   1252         ccmp wsp, w4, #2, ne
   1253         ccmp w3, wsp, #0, ge
   1254         ccmp w19, w5, #-1, lt
   1255         ccmp w20, w7, #16, hs
   1256 // CHECK-ERROR: error: invalid operand for instruction
   1257 // CHECK-ERROR-NEXT:        ccmp wsp, w4, #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 w3, wsp, #0, ge
   1261 // CHECK-ERROR-NEXT:                 ^
   1262 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1263 // CHECK-ERROR-NEXT:        ccmp w19, w5, #-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 w20, w7, #16, hs
   1267 // CHECK-ERROR-NEXT:                      ^
   1268 
   1269         ccmp sp, x4, #2, ne
   1270         ccmp x25, sp, #15, hs
   1271         ccmp x19, x5, #-1, lt
   1272         ccmp x20, x7, #16, hs
   1273 // CHECK-ERROR: error: invalid operand for instruction
   1274 // CHECK-ERROR-NEXT:        ccmp sp, x4, #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:        ccmp x25, sp, #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:        ccmp x19, x5, #-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:        ccmp x20, x7, #16, hs
   1284 // CHECK-ERROR-NEXT:                      ^
   1285 
   1286         ccmn wsp, w4, #2, ne
   1287         ccmn w25, wsp, #15, hs
   1288         ccmn w19, w5, #-1, lt
   1289         ccmn w20, w7, #16, hs
   1290 // CHECK-ERROR: error: invalid operand for instruction
   1291 // CHECK-ERROR-NEXT:        ccmn wsp, w4, #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 w25, wsp, #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 w19, w5, #-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 w20, w7, #16, hs
   1301 // CHECK-ERROR-NEXT:                      ^
   1302 
   1303         ccmn sp, x4, #2, ne
   1304         ccmn x25, sp, #15, hs
   1305         ccmn x19, x5, #-1, lt
   1306         ccmn x20, x7, #16, hs
   1307 // CHECK-ERROR: error: invalid operand for instruction
   1308 // CHECK-ERROR-NEXT:        ccmn sp, x4, #2, ne
   1309 // CHECK-ERROR-NEXT:             ^
   1310 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1311 // CHECK-ERROR-NEXT:        ccmn x25, sp, #15, hs
   1312 // CHECK-ERROR-NEXT:                  ^
   1313 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1314 // CHECK-ERROR-NEXT:        ccmn x19, x5, #-1, lt
   1315 // CHECK-ERROR-NEXT:                      ^
   1316 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1317 // CHECK-ERROR-NEXT:        ccmn x20, x7, #16, hs
   1318 // CHECK-ERROR-NEXT:                      ^
   1319 
   1320 //------------------------------------------------------------------------------
   1321 // Conditional select
   1322 //------------------------------------------------------------------------------
   1323 
   1324         csel w4, wsp, w9, eq
   1325         csel wsp, w2, w3, ne
   1326         csel w10, w11, wsp, ge
   1327         csel w1, w2, w3, #3
   1328         csel x4, sp, x9, eq
   1329         csel sp, x2, x3, ne
   1330         csel x10, x11, sp, ge
   1331         csel x1, x2, x3, #3
   1332 // CHECK-ERROR: error: invalid operand for instruction
   1333 // CHECK-ERROR-NEXT:        csel w4, wsp, w9, eq
   1334 // CHECK-ERROR-NEXT:                 ^
   1335 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1336 // CHECK-ERROR-NEXT:        csel wsp, w2, w3, ne
   1337 // CHECK-ERROR-NEXT:             ^
   1338 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1339 // CHECK-ERROR-NEXT:        csel w10, w11, wsp, ge
   1340 // CHECK-ERROR-NEXT:                       ^
   1341 // CHECK-ERROR-NEXT: error: expected AArch64 condition code
   1342 // CHECK-ERROR-NEXT:        csel w1, w2, w3, #3
   1343 // CHECK-ERROR-NEXT:                         ^
   1344 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1345 // CHECK-ERROR-NEXT:        csel x4, sp, x9, eq
   1346 // CHECK-ERROR-NEXT:                 ^
   1347 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1348 // CHECK-ERROR-NEXT:        csel sp, x2, x3, ne
   1349 // CHECK-ERROR-NEXT:             ^
   1350 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1351 // CHECK-ERROR-NEXT:        csel x10, x11, sp, ge
   1352 // CHECK-ERROR-NEXT:                       ^
   1353 // CHECK-ERROR-NEXT: error: expected AArch64 condition code
   1354 // CHECK-ERROR-NEXT:        csel x1, x2, x3, #3
   1355 // CHECK-ERROR-NEXT:                         ^
   1356 
   1357         csinc w20, w21, wsp, mi
   1358         csinc sp, x30, x29, eq
   1359 // CHECK-ERROR: error: invalid operand for instruction
   1360 // CHECK-ERROR-NEXT:        csinc w20, w21, wsp, mi
   1361 // CHECK-ERROR-NEXT:                        ^
   1362 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1363 // CHECK-ERROR-NEXT:        csinc sp, x30, x29, eq
   1364 // CHECK-ERROR-NEXT:              ^
   1365 
   1366         csinv w20, wsp, wsp, mi
   1367         csinv sp, x30, x29, le
   1368 // CHECK-ERROR: error: invalid operand for instruction
   1369 // CHECK-ERROR-NEXT:        csinv w20, wsp, wsp, mi
   1370 // CHECK-ERROR-NEXT:                   ^
   1371 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1372 // CHECK-ERROR-NEXT:        csinv sp, x30, x29, le
   1373 // CHECK-ERROR-NEXT:              ^
   1374 
   1375         csneg w20, w21, wsp, mi
   1376         csneg x0, sp, x29, le
   1377 // CHECK-ERROR: error: invalid operand for instruction
   1378 // CHECK-ERROR-NEXT:        csneg w20, w21, wsp, mi
   1379 // CHECK-ERROR-NEXT:                        ^
   1380 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1381 // CHECK-ERROR-NEXT:        csneg x0, sp, x29, le
   1382 // CHECK-ERROR-NEXT:                  ^
   1383 
   1384         cset wsp, lt
   1385         csetm sp, ge
   1386         cset w1, al
   1387         csetm x6, nv
   1388 // CHECK-ERROR: error: invalid operand for instruction
   1389 // CHECK-ERROR-NEXT:        cset wsp, lt
   1390 // CHECK-ERROR-NEXT:             ^
   1391 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1392 // CHECK-ERROR-NEXT:        csetm sp, ge
   1393 // CHECK-ERROR-NEXT:              ^
   1394 // CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
   1395 // CHECK-ERROR-NEXT:        cset w1, al
   1396 // CHECK-ERROR-NEXT:                   ^
   1397 // CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
   1398 // CHECK-ERROR-NEXT:        csetm x6, nv
   1399 // CHECK-ERROR-NEXT:                    ^
   1400 
   1401         cinc w3, wsp, ne
   1402         cinc sp, x9, eq
   1403         cinc x2, x0, nv
   1404 // CHECK-ERROR: error: invalid operand for instruction
   1405 // CHECK-ERROR-NEXT:        cinc w3, wsp, ne
   1406 // CHECK-ERROR-NEXT:                 ^
   1407 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1408 // CHECK-ERROR-NEXT:        cinc sp, x9, eq
   1409 // CHECK-ERROR-NEXT:             ^
   1410 // CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
   1411 // CHECK-ERROR-NEXT:        cinc x2, x0, nv
   1412 // CHECK-ERROR-NEXT:                       ^
   1413 
   1414         cinv w3, wsp, ne
   1415         cinv sp, x9, eq
   1416         cinv w8, x7, nv
   1417 // CHECK-ERROR: error: invalid operand for instruction
   1418 // CHECK-ERROR-NEXT:        cinv w3, wsp, ne
   1419 // CHECK-ERROR-NEXT:                 ^
   1420 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1421 // CHECK-ERROR-NEXT:        cinv sp, x9, eq
   1422 // CHECK-ERROR-NEXT:             ^
   1423 // CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
   1424 // CHECK-ERROR-NEXT:        cinv w8, x7, nv
   1425 // CHECK-ERROR-NEXT:                       ^
   1426 
   1427         cneg w3, wsp, ne
   1428         cneg sp, x9, eq
   1429         cneg x4, x5, al
   1430 // CHECK-ERROR: error: invalid operand for instruction
   1431 // CHECK-ERROR-NEXT:        cneg w3, wsp, ne
   1432 // CHECK-ERROR-NEXT:                 ^
   1433 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1434 // CHECK-ERROR-NEXT:        cneg sp, x9, eq
   1435 // CHECK-ERROR-NEXT:             ^
   1436 // CHECK-ERROR-NEXT: error: condition codes AL and NV are invalid for this instruction
   1437 // CHECK-ERROR-NEXT:        cneg x4, x5, al
   1438 // CHECK-ERROR-NEXT:                       ^
   1439 
   1440 //------------------------------------------------------------------------------
   1441 // Data Processing (1 source)
   1442 //------------------------------------------------------------------------------
   1443         rbit x23, w2
   1444 //CHECK-ERROR: error: invalid operand for instruction
   1445 //CHECK-ERROR-NEXT:     rbit x23, w2
   1446 
   1447         cls sp, x2
   1448 //CHECK-ERROR: error: invalid operand for instruction
   1449 //CHECK-ERROR-NEXT:     cls sp, x2
   1450 
   1451         clz wsp, w3
   1452 //CHECK-ERROR: error: invalid operand for instruction
   1453 //CHECK-ERROR-NEXT:     clz wsp, w3
   1454 
   1455 //------------------------------------------------------------------------------
   1456 // Data Processing (2 sources)
   1457 //------------------------------------------------------------------------------
   1458         udiv x23, w2, x18
   1459 //CHECK-ERROR: error: invalid operand for instruction
   1460 //CHECK-ERROR-NEXT:     udiv x23, w2, x18
   1461 
   1462         lsl sp, x2, x4
   1463 //CHECK-ERROR: error: invalid operand for instruction
   1464 //CHECK-ERROR-NEXT:     lsl sp, x2, x4
   1465 
   1466         asr wsp, w3, w9
   1467 //CHECK-ERROR: error: invalid operand for instruction
   1468 //CHECK-ERROR-NEXT:     asr wsp, w3, w9
   1469 
   1470 //------------------------------------------------------------------------------
   1471 // Data Processing (3 sources)
   1472 //------------------------------------------------------------------------------
   1473 
   1474         madd sp, x3, x9, x10
   1475 //CHECK-ERROR: error: invalid operand for instruction
   1476 //CHECK-ERROR-NEXT:     madd sp, x3, x9, x10
   1477 
   1478 //------------------------------------------------------------------------------
   1479 // Exception generation
   1480 //------------------------------------------------------------------------------
   1481         svc #-1
   1482         hlt #65536
   1483         dcps4 #43
   1484         dcps4
   1485 // CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 65535]
   1486 // CHECK-ERROR-NEXT:         svc #-1
   1487 // CHECK-ERROR-NEXT:             ^
   1488 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 65535]
   1489 // CHECK-ERROR-NEXT:         hlt #65536
   1490 // CHECK-ERROR-NEXT:             ^
   1491 // CHECK-ERROR-NEXT: error: {{invalid instruction|unrecognized instruction mnemonic}}
   1492 // CHECK-ERROR-NEXT:         dcps4 #43
   1493 // CHECK-ERROR-NEXT:         ^
   1494 // CHECK-ERROR-NEXT: error: {{invalid instruction|unrecognized instruction mnemonic}}
   1495 // CHECK-ERROR-NEXT:         dcps4
   1496 // CHECK-ERROR-NEXT:         ^
   1497 
   1498 //------------------------------------------------------------------------------
   1499 // Extract (immediate)
   1500 //------------------------------------------------------------------------------
   1501 
   1502         extr w2, w20, w30, #-1
   1503         extr w9, w19, w20, #32
   1504 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1505 // CHECK-ERROR-NEXT:         extr w2, w20, w30, #-1
   1506 // CHECK-ERROR-NEXT:                            ^
   1507 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1508 // CHECK-ERROR-NEXT:         extr w9, w19, w20, #32
   1509 // CHECK-ERROR-NEXT:                            ^
   1510 
   1511         extr x10, x15, x20, #-1
   1512         extr x20, x25, x30, #64
   1513 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   1514 // CHECK-ERROR-NEXT:         extr x10, x15, x20, #-1
   1515 // CHECK-ERROR-NEXT:                             ^
   1516 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   1517 // CHECK-ERROR-NEXT:         extr x20, x25, x30, #64
   1518 // CHECK-ERROR-NEXT:                             ^
   1519 
   1520         ror w9, w10, #32
   1521         ror x10, x11, #64
   1522 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   1523 // CHECK-ERROR-NEXT:         ror w9, w10, #32
   1524 // CHECK-ERROR-NEXT:                      ^
   1525 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   1526 // CHECK-ERROR-NEXT:         ror x10, x11, #64
   1527 // CHECK-ERROR-NEXT:                       ^
   1528 
   1529 //------------------------------------------------------------------------------
   1530 // Floating-point compare
   1531 //------------------------------------------------------------------------------
   1532 
   1533         fcmp s3, d2
   1534 // CHECK-ERROR-AARCH64: error: expected floating-point constant #0.0
   1535 // CHECK-ERROR-ARM64: error: invalid operand for instruction
   1536 // CHECK-ERROR-NEXT:         fcmp s3, d2
   1537 // CHECK-ERROR-NEXT:                  ^
   1538 
   1539         fcmp s9, #-0.0
   1540         fcmp d3, #-0.0
   1541         fcmp s1, #1.0
   1542         fcmpe s30, #-0.0
   1543 // CHECK-ERROR: error: expected floating-point constant #0.0
   1544 // CHECK-ERROR-NEXT:         fcmp s9, #-0.0
   1545 // CHECK-ERROR-NEXT:                  ^
   1546 // CHECK-ERROR-NEXT: error: expected floating-point constant #0.0
   1547 // CHECK-ERROR-NEXT:         fcmp d3, #-0.0
   1548 // CHECK-ERROR-NEXT:                  ^
   1549 // CHECK-ERROR-NEXT: error: expected floating-point constant #0.0
   1550 // CHECK-ERROR-NEXT:         fcmp s1, #1.0
   1551 // CHECK-ERROR-NEXT:                  ^
   1552 // CHECK-ERROR-NEXT: error: expected floating-point constant #0.0
   1553 // CHECK-ERROR-NEXT:         fcmpe s30, #-0.0
   1554 // CHECK-ERROR-NEXT:                    ^
   1555 
   1556 //------------------------------------------------------------------------------
   1557 // Floating-point conditional compare
   1558 //------------------------------------------------------------------------------
   1559 
   1560         fccmp s19, s5, #-1, lt
   1561         fccmp s20, s7, #16, hs
   1562 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1563 // CHECK-ERROR-NEXT:        fccmp s19, s5, #-1, lt
   1564 // CHECK-ERROR-NEXT:                      ^
   1565 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1566 // CHECK-ERROR-NEXT:        fccmp s20, s7, #16, hs
   1567 // CHECK-ERROR-NEXT:                      ^
   1568 
   1569         fccmp d19, d5, #-1, lt
   1570         fccmp d20, d7, #16, hs
   1571 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1572 // CHECK-ERROR-NEXT:        fccmp d19, d5, #-1, lt
   1573 // CHECK-ERROR-NEXT:                      ^
   1574 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1575 // CHECK-ERROR-NEXT:        fccmp d20, d7, #16, hs
   1576 // CHECK-ERROR-NEXT:                      ^
   1577 
   1578         fccmpe s19, s5, #-1, lt
   1579         fccmpe s20, s7, #16, hs
   1580 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1581 // CHECK-ERROR-NEXT:        fccmpe s19, s5, #-1, lt
   1582 // CHECK-ERROR-NEXT:                      ^
   1583 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1584 // CHECK-ERROR-NEXT:        fccmpe s20, s7, #16, hs
   1585 // CHECK-ERROR-NEXT:                      ^
   1586 
   1587         fccmpe d19, d5, #-1, lt
   1588         fccmpe d20, d7, #16, hs
   1589 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1590 // CHECK-ERROR-NEXT:        fccmpe d19, d5, #-1, lt
   1591 // CHECK-ERROR-NEXT:                      ^
   1592 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   1593 // CHECK-ERROR-NEXT:        fccmpe d20, d7, #16, hs
   1594 // CHECK-ERROR-NEXT:                      ^
   1595 
   1596 //------------------------------------------------------------------------------
   1597 // Floating-point conditional compare
   1598 //------------------------------------------------------------------------------
   1599 
   1600         fcsel q3, q20, q9, pl
   1601         fcsel h9, h10, h11, mi
   1602         fcsel b9, b10, b11, mi
   1603 // CHECK-ERROR: error: invalid operand for instruction
   1604 // CHECK-ERROR-NEXT:         fcsel q3, q20, q9, pl
   1605 // CHECK-ERROR-NEXT:               ^
   1606 // CHECK-ERROR-NEXT: error: instruction requires: fullfp16
   1607 // CHECK-ERROR-NEXT:         fcsel h9, h10, h11, mi
   1608 // CHECK-ERROR-NEXT:               ^
   1609 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1610 // CHECK-ERROR-NEXT:         fcsel b9, b10, b11, mi
   1611 // CHECK-ERROR-NEXT:               ^
   1612 
   1613 //------------------------------------------------------------------------------
   1614 // Floating-point data-processing (1 source)
   1615 //------------------------------------------------------------------------------
   1616 
   1617         fmov d0, s3
   1618         fcvt d0, d1
   1619 // CHECK-ERROR: error: expected compatible register or floating-point constant
   1620 // CHECK-ERROR-NEXT:           fmov d0, s3
   1621 // CHECK-ERROR-NEXT:                    ^
   1622 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1623 // CHECK-ERROR-NEXT:           fcvt d0, d1
   1624 // CHECK-ERROR-NEXT:                    ^
   1625 
   1626 
   1627 //------------------------------------------------------------------------------
   1628 // Floating-point data-processing (2 sources)
   1629 //------------------------------------------------------------------------------
   1630 
   1631         fadd s0, d3, d7
   1632         fmaxnm d3, s19, d12
   1633         fnmul d1, d9, s18
   1634 // CHECK-ERROR: error: invalid operand for instruction
   1635 // CHECK-ERROR-NEXT:           fadd s0, d3, d7
   1636 // CHECK-ERROR-NEXT: ^
   1637 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1638 // CHECK-ERROR-NEXT:           fmaxnm d3, s19, d12
   1639 // CHECK-ERROR-NEXT: ^
   1640 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1641 // CHECK-ERROR-NEXT:           fnmul d1, d9, s18
   1642 // CHECK-ERROR-NEXT: ^
   1643 
   1644 //------------------------------------------------------------------------------
   1645 // Floating-point data-processing (3 sources)
   1646 //------------------------------------------------------------------------------
   1647 
   1648         fmadd b3, b4, b5, b6
   1649         fmsub h1, h2, h3, h4
   1650         fnmadd q3, q5, q6, q7
   1651         fnmsub s2, s4, d5, h9
   1652 // CHECK-ERROR: error: invalid operand for instruction
   1653 // CHECK-ERROR-NEXT:         fmadd b3, b4, b5, b6
   1654 // CHECK-ERROR-NEXT:               ^
   1655 // CHECK-ERROR-NEXT: error: instruction requires: fullfp16
   1656 // CHECK-ERROR-NEXT:         fmsub h1, h2, h3, h4
   1657 // CHECK-ERROR-NEXT:               ^
   1658 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1659 // CHECK-ERROR-NEXT:         fnmadd q3, q5, q6, q7
   1660 // CHECK-ERROR-NEXT:                ^
   1661 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1662 // CHECK-ERROR-NEXT:         fnmsub s2, s4, d5, h9
   1663 // CHECK-ERROR-NEXT:                ^
   1664 
   1665 //------------------------------------------------------------------------------
   1666 // Floating-point conditional compare
   1667 //------------------------------------------------------------------------------
   1668 
   1669         fcvtzs w13, s31, #0
   1670         fcvtzs w19, s20, #33
   1671         fcvtzs wsp, s19, #14
   1672 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
   1673 // CHECK-ERROR-NEXT:        fcvtzs w13, s31, #0
   1674 // CHECK-ERROR-NEXT:                         ^
   1675 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
   1676 // CHECK-ERROR-NEXT:        fcvtzs w19, s20, #33
   1677 // CHECK-ERROR-NEXT:                         ^
   1678 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1679 // CHECK-ERROR-NEXT:        fcvtzs wsp, s19, #14
   1680 // CHECK-ERROR-NEXT:               ^
   1681 
   1682         fcvtzs x13, s31, #0
   1683         fcvtzs x19, s20, #65
   1684         fcvtzs sp, s19, #14
   1685 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
   1686 // CHECK-ERROR-NEXT:        fcvtzs x13, s31, #0
   1687 // CHECK-ERROR-NEXT:                         ^
   1688 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
   1689 // CHECK-ERROR-NEXT:        fcvtzs x19, s20, #65
   1690 // CHECK-ERROR-NEXT:                         ^
   1691 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1692 // CHECK-ERROR-NEXT:        fcvtzs sp, s19, #14
   1693 // CHECK-ERROR-NEXT:               ^
   1694 
   1695         fcvtzu w13, s31, #0
   1696         fcvtzu w19, s20, #33
   1697         fcvtzu wsp, s19, #14
   1698 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
   1699 // CHECK-ERROR-NEXT:        fcvtzu w13, s31, #0
   1700 // CHECK-ERROR-NEXT:                         ^
   1701 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 32]
   1702 // CHECK-ERROR-NEXT:        fcvtzu w19, s20, #33
   1703 // CHECK-ERROR-NEXT:                         ^
   1704 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1705 // CHECK-ERROR-NEXT:        fcvtzu wsp, s19, #14
   1706 // CHECK-ERROR-NEXT:               ^
   1707 
   1708         fcvtzu x13, s31, #0
   1709         fcvtzu x19, s20, #65
   1710         fcvtzu sp, s19, #14
   1711 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
   1712 // CHECK-ERROR-NEXT:        fcvtzu x13, s31, #0
   1713 // CHECK-ERROR-NEXT:                         ^
   1714 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [1, 64]
   1715 // CHECK-ERROR-NEXT:        fcvtzu x19, s20, #65
   1716 // CHECK-ERROR-NEXT:                         ^
   1717 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1718 // CHECK-ERROR-NEXT:        fcvtzu sp, s19, #14
   1719 // CHECK-ERROR-NEXT:               ^
   1720 
   1721         scvtf w13, s31, #0
   1722         scvtf w19, s20, #33
   1723         scvtf wsp, s19, #14
   1724 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1725 // CHECK-ERROR-NEXT:        scvtf w13, s31, #0
   1726 // CHECK-ERROR-NEXT:              ^
   1727 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1728 // CHECK-ERROR-NEXT:        scvtf w19, s20, #33
   1729 // CHECK-ERROR-NEXT:              ^
   1730 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1731 // CHECK-ERROR-NEXT:        scvtf wsp, s19, #14
   1732 // CHECK-ERROR-NEXT:              ^
   1733 
   1734         scvtf x13, s31, #0
   1735         scvtf x19, s20, #65
   1736         scvtf sp, s19, #14
   1737 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1738 // CHECK-ERROR-NEXT:        scvtf x13, s31, #0
   1739 // CHECK-ERROR-NEXT:              ^
   1740 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1741 // CHECK-ERROR-NEXT:        scvtf x19, s20, #65
   1742 // CHECK-ERROR-NEXT:              ^
   1743 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1744 // CHECK-ERROR-NEXT:        scvtf sp, s19, #14
   1745 // CHECK-ERROR-NEXT:              ^
   1746 
   1747         ucvtf w13, s31, #0
   1748         ucvtf w19, s20, #33
   1749         ucvtf wsp, s19, #14
   1750 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1751 // CHECK-ERROR-NEXT:        ucvtf w13, s31, #0
   1752 // CHECK-ERROR-NEXT:              ^
   1753 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1754 // CHECK-ERROR-NEXT:        ucvtf w19, s20, #33
   1755 // CHECK-ERROR-NEXT:              ^
   1756 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1757 // CHECK-ERROR-NEXT:        ucvtf wsp, s19, #14
   1758 // CHECK-ERROR-NEXT:              ^
   1759 
   1760         ucvtf x13, s31, #0
   1761         ucvtf x19, s20, #65
   1762         ucvtf sp, s19, #14
   1763 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1764 // CHECK-ERROR-NEXT:        ucvtf x13, s31, #0
   1765 // CHECK-ERROR-NEXT:              ^
   1766 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1767 // CHECK-ERROR-NEXT:        ucvtf x19, s20, #65
   1768 // CHECK-ERROR-NEXT:              ^
   1769 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1770 // CHECK-ERROR-NEXT:        ucvtf sp, s19, #14
   1771 // CHECK-ERROR-NEXT:              ^
   1772 
   1773 //------------------------------------------------------------------------------
   1774 // Floating-point immediate
   1775 //------------------------------------------------------------------------------
   1776         ;; Exponent too large
   1777         fmov d3, #0.0625
   1778         fmov s2, #32.0
   1779 // CHECK-ERROR: error: expected compatible register or floating-point constant
   1780 // CHECK-ERROR-NEXT:           fmov d3, #0.0625
   1781 // CHECK-ERROR-NEXT:                    ^
   1782 // CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant
   1783 // CHECK-ERROR-NEXT:           fmov s2, #32.0
   1784 // CHECK-ERROR-NEXT:                    ^
   1785 
   1786         ;; Fraction too precise
   1787         fmov s9, #1.03125
   1788         fmov s28, #1.96875
   1789 // CHECK-ERROR: error: expected compatible register or floating-point constant
   1790 // CHECK-ERROR-NEXT:           fmov s9, #1.03125
   1791 // CHECK-ERROR-NEXT:                    ^
   1792 // CHECK-ERROR-NEXT: error: expected compatible register or floating-point constant
   1793 // CHECK-ERROR-NEXT:           fmov s28, #1.96875
   1794 // CHECK-ERROR-NEXT:                     ^
   1795 
   1796         ;; No particular reason, but a striking omission
   1797         fmov d0, #0.0
   1798 // CHECK-ERROR-AARCH64: error: expected compatible register or floating-point constant
   1799 // CHECK-ERROR-AARCH64-NEXT:           fmov d0, #0.0
   1800 // CHECK-ERROR-AARCH64-NEXT:                    ^
   1801 
   1802 //------------------------------------------------------------------------------
   1803 // Floating-point <-> integer conversion
   1804 //------------------------------------------------------------------------------
   1805 
   1806         fmov x3, v0.d[0]
   1807         fmov v29.1d[1], x2
   1808         fmov x7, v0.d[2]
   1809         fcvtns sp, s5
   1810         scvtf s6, wsp
   1811 // CHECK-ERROR: error: expected lane specifier '[1]'
   1812 // CHECK-ERROR-NEXT:         fmov x3, v0.d[0]
   1813 // CHECK-ERROR-NEXT:                       ^
   1814 // CHECK-ERROR-AARCH64-NEXT: error: lane number incompatible with layout
   1815 // CHECK-ERROR-ARM64-NEXT: error: invalid operand for instruction
   1816 // CHECK-ERROR-NEXT: fmov v29.1d[1], x2
   1817 // CHECK-ERROR-NEXT:             ^
   1818 // CHECK-ERROR-AARCH64-NEXT: error: lane number incompatible with layout
   1819 // CHECK-ERROR-ARM64-NEXT: error: expected lane specifier '[1]'
   1820 // CHECK-ERROR-NEXT: fmov x7, v0.d[2]
   1821 // CHECK-ERROR-NEXT:               ^
   1822 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1823 // CHECK-ERROR-NEXT:         fcvtns sp, s5
   1824 // CHECK-ERROR-NEXT:                ^
   1825 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1826 // CHECK-ERROR-NEXT:         scvtf s6, wsp
   1827 // CHECK-ERROR-NEXT:                   ^
   1828 
   1829 //------------------------------------------------------------------------------
   1830 // Load-register (literal)
   1831 //------------------------------------------------------------------------------
   1832 
   1833         ldr sp, some_label
   1834         ldrsw w3, somewhere
   1835 // CHECK-ERROR: error: invalid operand for instruction
   1836 // CHECK-ERROR-NEXT:         ldr sp, some_label
   1837 // CHECK-ERROR-NEXT:             ^
   1838 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   1839 // CHECK-ERROR-NEXT:         ldrsw w3, somewhere
   1840 // CHECK-ERROR-NEXT:               ^
   1841 
   1842         ldrsw x2, #1048576
   1843         ldr q0, #-1048580
   1844         ldr x0, #2
   1845 // CHECK-ERROR: error: expected label or encodable integer pc offset
   1846 // CHECK-ERROR-NEXT:         ldrsw x2, #1048576
   1847 // CHECK-ERROR-NEXT:                   ^
   1848 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1849 // CHECK-ERROR-NEXT:         ldr q0, #-1048580
   1850 // CHECK-ERROR-NEXT:                   ^
   1851 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   1852 // CHECK-ERROR-NEXT:         ldr x0, #2
   1853 // CHECK-ERROR-NEXT:                 ^
   1854 
   1855 //------------------------------------------------------------------------------
   1856 // Load/store exclusive
   1857 //------------------------------------------------------------------------------
   1858 
   1859        stxrb w2, w3, [x4, #20]
   1860        stlxrh w10, w11, [w2]
   1861 // CHECK-ERROR-AARCH64: error: expected '#0'
   1862 // CHECK-ERROR-ARM64: error: index must be absent or #0
   1863 // CHECK-ERROR-NEXT:         stxrb w2, w3, [x4, #20]
   1864 // CHECK-ERROR-NEXT:                       ^
   1865 // CHECK-ERROR: error: invalid operand for instruction
   1866 // CHECK-ERROR-NEXT:         stlxrh w10, w11, [w2]
   1867 // CHECK-ERROR-NEXT:                           ^
   1868 
   1869        stlxr  x20, w21, [sp]
   1870 // CHECK-ERROR: error: invalid operand for instruction
   1871 // CHECK-ERROR-NEXT:         stlxr  x20, w21, [sp]
   1872 // CHECK-ERROR-NEXT:                ^
   1873 
   1874        ldxr   sp, [sp]
   1875 // CHECK-ERROR: error: invalid operand for instruction
   1876 // CHECK-ERROR-NEXT:         ldxr   sp, [sp]
   1877 // CHECK-ERROR-NEXT:                ^
   1878 
   1879        stxp x1, x2, x3, [x4]
   1880 // CHECK-ERROR: error: invalid operand for instruction
   1881 // CHECK-ERROR-NEXT:         stxp x1, x2,  x3, [x4]
   1882 // CHECK-ERROR-NEXT:              ^
   1883 
   1884        stlxp w5, x1, w4, [x5]
   1885 // CHECK-ERROR: error: invalid operand for instruction
   1886 // CHECK-ERROR-NEXT:         stlxp w5, x1, w4, [x5]
   1887 // CHECK-ERROR-NEXT:                       ^
   1888 
   1889        stlxp w17, w6, x7, [x22]
   1890 // CHECK-ERROR: error: invalid operand for instruction
   1891 // CHECK-ERROR-NEXT:         stlxp w17, w6, x7, [x22]
   1892 // CHECK-ERROR-NEXT:                        ^
   1893 
   1894 //------------------------------------------------------------------------------
   1895 // Load/store (unscaled immediate)
   1896 //------------------------------------------------------------------------------
   1897 
   1898         ldurb w2, [sp, #256]
   1899         sturh w17, [x1, #256]
   1900         ldursw x20, [x1, #256]
   1901         ldur x12, [sp, #256]
   1902 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   1903 // CHECK-ERROR-NEXT:        ldurb w2, [sp, #256]
   1904 // CHECK-ERROR-NEXT:                  ^
   1905 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1906 // CHECK-ERROR-NEXT:         sturh w17, [x1, #256]
   1907 // CHECK-ERROR-NEXT:                    ^
   1908 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1909 // CHECK-ERROR-NEXT:         ldursw x20, [x1, #256]
   1910 // CHECK-ERROR-NEXT:                     ^
   1911 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1912 // CHECK-ERROR-NEXT:         ldur x12, [sp, #256]
   1913 // CHECK-ERROR-NEXT:                   ^
   1914 
   1915         stur h2, [x2, #-257]
   1916         stur b2, [x2, #-257]
   1917         ldursb x9, [sp, #-257]
   1918         ldur w2, [x30, #-257]
   1919         stur q9, [x20, #-257]
   1920 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   1921 // CHECK-ERROR-NEXT:         stur h2, [x2, #-257]
   1922 // CHECK-ERROR-NEXT:                  ^
   1923 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1924 // CHECK-ERROR-NEXT:         stur b2, [x2, #-257]
   1925 // CHECK-ERROR-NEXT:                  ^
   1926 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1927 // CHECK-ERROR-NEXT:         ldursb x9, [sp, #-257]
   1928 // CHECK-ERROR-NEXT:                    ^
   1929 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1930 // CHECK-ERROR-NEXT:         ldur w2, [x30, #-257]
   1931 // CHECK-ERROR-NEXT:                  ^
   1932 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1933 // CHECK-ERROR-NEXT:         stur q9, [x20, #-257]
   1934 // CHECK-ERROR-NEXT:                  ^
   1935 
   1936         prfum pstl3strm, [xzr]
   1937 // CHECK-ERROR: error: invalid operand for instruction
   1938 // CHECK-ERROR-NEXT:         prfum pstl3strm, [xzr]
   1939 // CHECK-ERROR-NEXT:                           ^
   1940 
   1941 //------------------------------------------------------------------------------
   1942 // Load-store register (immediate post-indexed)
   1943 //------------------------------------------------------------------------------
   1944         ldr x3, [x4, #25], #0
   1945         ldr x4, [x9, #0], #4
   1946 // CHECK-ERROR-AARCH64: error: {{expected symbolic reference or integer|index must be a multiple of 8}} in range [0, 32760]
   1947 // CHECK-ERROR-ARM64: error: invalid operand for instruction
   1948 // CHECK-ERROR-NEXT:         ldr x3, [x4, #25], #0
   1949 // CHECK-ERROR-NEXT:                 ^
   1950 // CHECK-ERROR-AARCH64-NEXT: error: invalid operand for instruction
   1951 // CHECK-ERROR-AARCH64-NEXT:         ldr x4, [x9, #0], #4
   1952 // CHECK-ERROR-AARCH64-NEXT:                           ^
   1953 
   1954         strb w1, [x19], #256
   1955         strb w9, [sp], #-257
   1956         strh w1, [x19], #256
   1957         strh w9, [sp], #-257
   1958         str w1, [x19], #256
   1959         str w9, [sp], #-257
   1960 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   1961 // CHECK-ERROR-NEXT:         strb w1, [x19], #256
   1962 // CHECK-ERROR-NEXT:                         ^
   1963 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1964 // CHECK-ERROR-NEXT:         strb w9, [sp], #-257
   1965 // CHECK-ERROR-NEXT:                        ^
   1966 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1967 // CHECK-ERROR-NEXT:         strh w1, [x19], #256
   1968 // CHECK-ERROR-NEXT:                         ^
   1969 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1970 // CHECK-ERROR-NEXT:         strh w9, [sp], #-257
   1971 // CHECK-ERROR-NEXT:                        ^
   1972 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1973 // CHECK-ERROR-NEXT:         str w1, [x19], #256
   1974 // CHECK-ERROR-NEXT:                        ^
   1975 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1976 // CHECK-ERROR-NEXT:         str w9, [sp], #-257
   1977 // CHECK-ERROR-NEXT:                       ^
   1978 
   1979         ldrb w1, [x19], #256
   1980         ldrb w9, [sp], #-257
   1981         ldrh w1, [x19], #256
   1982         ldrh w9, [sp], #-257
   1983         ldr w1, [x19], #256
   1984         ldr w9, [sp], #-257
   1985 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   1986 // CHECK-ERROR-NEXT:         ldrb w1, [x19], #256
   1987 // CHECK-ERROR-NEXT:                         ^
   1988 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1989 // CHECK-ERROR-NEXT:         ldrb w9, [sp], #-257
   1990 // CHECK-ERROR-NEXT:                        ^
   1991 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1992 // CHECK-ERROR-NEXT:         ldrh w1, [x19], #256
   1993 // CHECK-ERROR-NEXT:                         ^
   1994 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1995 // CHECK-ERROR-NEXT:         ldrh w9, [sp], #-257
   1996 // CHECK-ERROR-NEXT:                        ^
   1997 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   1998 // CHECK-ERROR-NEXT:         ldr w1, [x19], #256
   1999 // CHECK-ERROR-NEXT:                        ^
   2000 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2001 // CHECK-ERROR-NEXT:         ldr w9, [sp], #-257
   2002 // CHECK-ERROR-NEXT:                       ^
   2003 
   2004         ldrsb x2, [x3], #256
   2005         ldrsb x22, [x13], #-257
   2006         ldrsh x2, [x3], #256
   2007         ldrsh x22, [x13], #-257
   2008         ldrsw x2, [x3], #256
   2009         ldrsw x22, [x13], #-257
   2010 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   2011 // CHECK-ERROR-NEXT:         ldrsb x2, [x3], #256
   2012 // CHECK-ERROR-NEXT:                         ^
   2013 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2014 // CHECK-ERROR-NEXT:         ldrsb x22, [x13], #-257
   2015 // CHECK-ERROR-NEXT:                           ^
   2016 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2017 // CHECK-ERROR-NEXT:         ldrsh x2, [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:         ldrsh x22, [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:         ldrsw x2, [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:         ldrsw x22, [x13], #-257
   2027 // CHECK-ERROR-NEXT:                           ^
   2028 
   2029         ldrsb w2, [x3], #256
   2030         ldrsb w22, [x13], #-257
   2031         ldrsh w2, [x3], #256
   2032         ldrsh w22, [x13], #-257
   2033 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   2034 // CHECK-ERROR-NEXT:         ldrsb w2, [x3], #256
   2035 // CHECK-ERROR-NEXT:                         ^
   2036 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2037 // CHECK-ERROR-NEXT:         ldrsb w22, [x13], #-257
   2038 // CHECK-ERROR-NEXT:                           ^
   2039 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2040 // CHECK-ERROR-NEXT:         ldrsh w2, [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:         ldrsh w22, [x13], #-257
   2044 // CHECK-ERROR-NEXT:                           ^
   2045 
   2046         str b3, [x3], #256
   2047         str b3, [x13], #-257
   2048         str h3, [x3], #256
   2049         str h3, [x13], #-257
   2050         str s3, [x3], #256
   2051         str s3, [x13], #-257
   2052         str d3, [x3], #256
   2053         str d3, [x13], #-257
   2054         str q3, [x3], #256
   2055         str q3, [x13], #-257
   2056 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   2057 // CHECK-ERROR-NEXT:         str b3, [x3], #256
   2058 // CHECK-ERROR-NEXT:                       ^
   2059 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2060 // CHECK-ERROR-NEXT:         str b3, [x13], #-257
   2061 // CHECK-ERROR-NEXT:                        ^
   2062 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2063 // CHECK-ERROR-NEXT:         str h3, [x3], #256
   2064 // CHECK-ERROR-NEXT:                       ^
   2065 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2066 // CHECK-ERROR-NEXT:         str h3, [x13], #-257
   2067 // CHECK-ERROR-NEXT:                        ^
   2068 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2069 // CHECK-ERROR-NEXT:         str s3, [x3], #256
   2070 // CHECK-ERROR-NEXT:                       ^
   2071 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2072 // CHECK-ERROR-NEXT:         str s3, [x13], #-257
   2073 // CHECK-ERROR-NEXT:                        ^
   2074 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2075 // CHECK-ERROR-NEXT:         str d3, [x3], #256
   2076 // CHECK-ERROR-NEXT:                       ^
   2077 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2078 // CHECK-ERROR-NEXT:         str d3, [x13], #-257
   2079 // CHECK-ERROR-NEXT:                        ^
   2080 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2081 // CHECK-ERROR-NEXT:         str q3, [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:         str q3, [x13], #-257
   2085 // CHECK-ERROR-NEXT:                        ^
   2086 
   2087         ldr b3, [x3], #256
   2088         ldr b3, [x13], #-257
   2089         ldr h3, [x3], #256
   2090         ldr h3, [x13], #-257
   2091         ldr s3, [x3], #256
   2092         ldr s3, [x13], #-257
   2093         ldr d3, [x3], #256
   2094         ldr d3, [x13], #-257
   2095         ldr q3, [x3], #256
   2096         ldr q3, [x13], #-257
   2097 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   2098 // CHECK-ERROR-NEXT:         ldr b3, [x3], #256
   2099 // CHECK-ERROR-NEXT:                       ^
   2100 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2101 // CHECK-ERROR-NEXT:         ldr b3, [x13], #-257
   2102 // CHECK-ERROR-NEXT:                        ^
   2103 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2104 // CHECK-ERROR-NEXT:         ldr h3, [x3], #256
   2105 // CHECK-ERROR-NEXT:                       ^
   2106 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2107 // CHECK-ERROR-NEXT:         ldr h3, [x13], #-257
   2108 // CHECK-ERROR-NEXT:                        ^
   2109 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2110 // CHECK-ERROR-NEXT:         ldr s3, [x3], #256
   2111 // CHECK-ERROR-NEXT:                       ^
   2112 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2113 // CHECK-ERROR-NEXT:         ldr s3, [x13], #-257
   2114 // CHECK-ERROR-NEXT:                        ^
   2115 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2116 // CHECK-ERROR-NEXT:         ldr d3, [x3], #256
   2117 // CHECK-ERROR-NEXT:                       ^
   2118 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2119 // CHECK-ERROR-NEXT:         ldr d3, [x13], #-257
   2120 // CHECK-ERROR-NEXT:                        ^
   2121 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2122 // CHECK-ERROR-NEXT:         ldr q3, [x3], #256
   2123 // CHECK-ERROR-NEXT:                       ^
   2124 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2125 // CHECK-ERROR-NEXT:         ldr q3, [x13], #-257
   2126 // CHECK-ERROR-NEXT:                        ^
   2127 
   2128 //------------------------------------------------------------------------------
   2129 // Load-store register (immediate pre-indexed)
   2130 //------------------------------------------------------------------------------
   2131 
   2132         ldr x3, [x4]!
   2133 // CHECK-ERROR: error:
   2134 // CHECK-ERROR-NEXT:         ldr x3, [x4]!
   2135 // CHECK-ERROR-NEXT:                     ^
   2136 
   2137         strb w1, [x19, #256]!
   2138         strb w9, [sp, #-257]!
   2139         strh w1, [x19, #256]!
   2140         strh w9, [sp, #-257]!
   2141         str w1, [x19, #256]!
   2142         str w9, [sp, #-257]!
   2143 // CHECK-ERROR: error: invalid operand for instruction
   2144 // CHECK-ERROR-NEXT:         strb w1, [x19, #256]!
   2145 // CHECK-ERROR-NEXT:                             ^
   2146 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2147 // CHECK-ERROR-NEXT:         strb w9, [sp, #-257]!
   2148 // CHECK-ERROR-NEXT:                  ^
   2149 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2150 // CHECK-ERROR-NEXT:         strh w1, [x19, #256]!
   2151 // CHECK-ERROR-NEXT:                             ^
   2152 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2153 // CHECK-ERROR-NEXT:         strh w9, [sp, #-257]!
   2154 // CHECK-ERROR-NEXT:                  ^
   2155 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2156 // CHECK-ERROR-NEXT:         str w1, [x19, #256]!
   2157 // CHECK-ERROR-NEXT:                            ^
   2158 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2159 // CHECK-ERROR-NEXT:         str w9, [sp, #-257]!
   2160 // CHECK-ERROR-NEXT:                 ^
   2161 
   2162         ldrb w1, [x19, #256]!
   2163         ldrb w9, [sp, #-257]!
   2164         ldrh w1, [x19, #256]!
   2165         ldrh w9, [sp, #-257]!
   2166         ldr w1, [x19, #256]!
   2167         ldr w9, [sp, #-257]!
   2168 // CHECK-ERROR: error: invalid operand for instruction
   2169 // CHECK-ERROR-NEXT:         ldrb w1, [x19, #256]!
   2170 // CHECK-ERROR-NEXT:                             ^
   2171 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2172 // CHECK-ERROR-NEXT:         ldrb w9, [sp, #-257]!
   2173 // CHECK-ERROR-NEXT:                  ^
   2174 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2175 // CHECK-ERROR-NEXT:         ldrh w1, [x19, #256]!
   2176 // CHECK-ERROR-NEXT:                             ^
   2177 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2178 // CHECK-ERROR-NEXT:         ldrh w9, [sp, #-257]!
   2179 // CHECK-ERROR-NEXT:                  ^
   2180 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2181 // CHECK-ERROR-NEXT:         ldr w1, [x19, #256]!
   2182 // CHECK-ERROR-NEXT:                            ^
   2183 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2184 // CHECK-ERROR-NEXT:         ldr w9, [sp, #-257]!
   2185 // CHECK-ERROR-NEXT:                 ^
   2186 
   2187         ldrsb x2, [x3, #256]!
   2188         ldrsb x22, [x13, #-257]!
   2189         ldrsh x2, [x3, #256]!
   2190         ldrsh x22, [x13, #-257]!
   2191         ldrsw x2, [x3, #256]!
   2192         ldrsw x22, [x13, #-257]!
   2193 // CHECK-ERROR: error: invalid operand for instruction
   2194 // CHECK-ERROR-NEXT:         ldrsb x2, [x3, #256]!
   2195 // CHECK-ERROR-NEXT:                             ^
   2196 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2197 // CHECK-ERROR-NEXT:         ldrsb x22, [x13, #-257]!
   2198 // CHECK-ERROR-NEXT:                    ^
   2199 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2200 // CHECK-ERROR-NEXT:         ldrsh x2, [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:         ldrsh x22, [x13, #-257]!
   2204 // CHECK-ERROR-NEXT:                    ^
   2205 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2206 // CHECK-ERROR-NEXT:         ldrsw x2, [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:         ldrsw x22, [x13, #-257]!
   2210 // CHECK-ERROR-NEXT:                    ^
   2211 
   2212         ldrsb w2, [x3, #256]!
   2213         ldrsb w22, [x13, #-257]!
   2214         ldrsh w2, [x3, #256]!
   2215         ldrsh w22, [x13, #-257]!
   2216 // CHECK-ERROR: error: invalid operand for instruction
   2217 // CHECK-ERROR-NEXT:         ldrsb w2, [x3, #256]!
   2218 // CHECK-ERROR-NEXT:                             ^
   2219 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2220 // CHECK-ERROR-NEXT:         ldrsb w22, [x13, #-257]!
   2221 // CHECK-ERROR-NEXT:                    ^
   2222 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2223 // CHECK-ERROR-NEXT:         ldrsh w2, [x3, #256]!
   2224 // CHECK-ERROR-NEXT:                             ^
   2225 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2226 // CHECK-ERROR-NEXT:         ldrsh w22, [x13, #-257]!
   2227 // CHECK-ERROR-NEXT:                    ^
   2228 
   2229         str b3, [x3, #256]!
   2230         str b3, [x13, #-257]!
   2231         str h3, [x3, #256]!
   2232         str h3, [x13, #-257]!
   2233         str s3, [x3, #256]!
   2234         str s3, [x13, #-257]!
   2235         str d3, [x3, #256]!
   2236         str d3, [x13, #-257]!
   2237 // CHECK-ERROR: error: invalid operand for instruction
   2238 // CHECK-ERROR-NEXT:         str b3, [x3, #256]!
   2239 // CHECK-ERROR-NEXT:                           ^
   2240 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2241 // CHECK-ERROR-NEXT:         str b3, [x13, #-257]!
   2242 // CHECK-ERROR-NEXT:                 ^
   2243 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2244 // CHECK-ERROR-NEXT:         str h3, [x3, #256]!
   2245 // CHECK-ERROR-NEXT:                           ^
   2246 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2247 // CHECK-ERROR-NEXT:         str h3, [x13, #-257]!
   2248 // CHECK-ERROR-NEXT:                 ^
   2249 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2250 // CHECK-ERROR-NEXT:         str s3, [x3, #256]!
   2251 // CHECK-ERROR-NEXT:                           ^
   2252 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2253 // CHECK-ERROR-NEXT:         str s3, [x13, #-257]!
   2254 // CHECK-ERROR-NEXT:                 ^
   2255 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2256 // CHECK-ERROR-NEXT:         str d3, [x3, #256]!
   2257 // CHECK-ERROR-NEXT:                           ^
   2258 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2259 // CHECK-ERROR-NEXT:         str d3, [x13, #-257]!
   2260 // CHECK-ERROR-NEXT:                 ^
   2261 
   2262         ldr b3, [x3, #256]!
   2263         ldr b3, [x13, #-257]!
   2264         ldr h3, [x3, #256]!
   2265         ldr h3, [x13, #-257]!
   2266         ldr s3, [x3, #256]!
   2267         ldr s3, [x13, #-257]!
   2268         ldr d3, [x3, #256]!
   2269         ldr d3, [x13, #-257]!
   2270 // CHECK-ERROR: error: invalid operand for instruction
   2271 // CHECK-ERROR-NEXT:         ldr b3, [x3, #256]!
   2272 // CHECK-ERROR-NEXT:                           ^
   2273 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2274 // CHECK-ERROR-NEXT:         ldr b3, [x13, #-257]!
   2275 // CHECK-ERROR-NEXT:                 ^
   2276 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2277 // CHECK-ERROR-NEXT:         ldr h3, [x3, #256]!
   2278 // CHECK-ERROR-NEXT:                           ^
   2279 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2280 // CHECK-ERROR-NEXT:         ldr h3, [x13, #-257]!
   2281 // CHECK-ERROR-NEXT:                 ^
   2282 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2283 // CHECK-ERROR-NEXT:         ldr s3, [x3, #256]!
   2284 // CHECK-ERROR-NEXT:                           ^
   2285 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2286 // CHECK-ERROR-NEXT:         ldr s3, [x13, #-257]!
   2287 // CHECK-ERROR-NEXT:                 ^
   2288 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2289 // CHECK-ERROR-NEXT:         ldr d3, [x3, #256]!
   2290 // CHECK-ERROR-NEXT:                           ^
   2291 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2292 // CHECK-ERROR-NEXT:         ldr d3, [x13, #-257]!
   2293 // CHECK-ERROR-NEXT:                 ^
   2294 
   2295 //------------------------------------------------------------------------------
   2296 // Load/store (unprivileged)
   2297 //------------------------------------------------------------------------------
   2298 
   2299         ldtrb w2, [sp, #256]
   2300         sttrh w17, [x1, #256]
   2301         ldtrsw x20, [x1, #256]
   2302         ldtr x12, [sp, #256]
   2303 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   2304 // CHECK-ERROR-NEXT:        ldtrb w2, [sp, #256]
   2305 // CHECK-ERROR-NEXT:                  ^
   2306 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2307 // CHECK-ERROR-NEXT:         sttrh w17, [x1, #256]
   2308 // CHECK-ERROR-NEXT:                    ^
   2309 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2310 // CHECK-ERROR-NEXT:         ldtrsw x20, [x1, #256]
   2311 // CHECK-ERROR-NEXT:                     ^
   2312 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2313 // CHECK-ERROR-NEXT:         ldtr x12, [sp, #256]
   2314 // CHECK-ERROR-NEXT:                   ^
   2315 
   2316         sttr h2, [x2, #-257]
   2317         sttr b2, [x2, #-257]
   2318         ldtrsb x9, [sp, #-257]
   2319         ldtr w2, [x30, #-257]
   2320         sttr q9, [x20, #-257]
   2321 // CHECK-ERROR: error: invalid operand for instruction
   2322 // CHECK-ERROR-NEXT:         sttr h2, [x2, #-257]
   2323 // CHECK-ERROR-NEXT:              ^
   2324 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2325 // CHECK-ERROR-NEXT:         sttr b2, [x2, #-257]
   2326 // CHECK-ERROR-NEXT:              ^
   2327 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2328 // CHECK-ERROR-NEXT:         ldtrsb x9, [sp, #-257]
   2329 // CHECK-ERROR-NEXT:                    ^
   2330 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2331 // CHECK-ERROR-NEXT:         ldtr w2, [x30, #-257]
   2332 // CHECK-ERROR-NEXT:                  ^
   2333 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2334 // CHECK-ERROR-NEXT:         sttr q9, [x20, #-257]
   2335 // CHECK-ERROR-NEXT:                  ^
   2336 
   2337 
   2338 //------------------------------------------------------------------------------
   2339 // Load/store (unsigned immediate)
   2340 //------------------------------------------------------------------------------
   2341 
   2342 //// Out of range immediates
   2343         ldr q0, [x11, #65536]
   2344         ldr x0, [sp, #32768]
   2345         ldr w0, [x4, #16384]
   2346         ldrh w2, [x21, #8192]
   2347         ldrb w3, [x12, #4096]
   2348 // CHECK-ERROR: error: {{expected|index must be an}} integer in range [-256, 255]
   2349 // CHECK-ERROR-NEXT:         ldr q0, [x11, #65536]
   2350 // CHECK-ERROR-NEXT:                 ^
   2351 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2352 // CHECK-ERROR-NEXT:         ldr x0, [sp, #32768]
   2353 // CHECK-ERROR-NEXT:                 ^
   2354 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2355 // CHECK-ERROR-NEXT:         ldr w0, [x4, #16384]
   2356 // CHECK-ERROR-NEXT:                 ^
   2357 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2358 // CHECK-ERROR-NEXT:         ldrh w2, [x21, #8192]
   2359 // CHECK-ERROR-NEXT:                  ^
   2360 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2361 // CHECK-ERROR-NEXT:         ldrb w3, [x12, #4096]
   2362 // CHECK-ERROR-NEXT:                  ^
   2363 
   2364 //// Misaligned addresses
   2365         ldr w0, [x0, #2]
   2366         ldrsh w2, [x0, #123]
   2367         str q0, [x0, #8]
   2368 // CHECK-ERROR-AARCH64: error: too few operands for instruction
   2369 // CHECK-ERROR-AARCH64-NEXT:         ldr w0, [x0, #2]
   2370 // CHECK-ERROR-AARCH64-NEXT:                 ^
   2371 // CHECK-ERROR-AARCH64-NEXT: error: too few operands for instruction
   2372 // CHECK-ERROR-AARCH64-NEXT:         ldrsh w2, [x0, #123]
   2373 // CHECK-ERROR-AARCH64-NEXT:                   ^
   2374 // CHECK-ERROR-AARCH64-NEXT: error: too few operands for instruction
   2375 // CHECK-ERROR-AARCH64-NEXT:         str q0, [x0, #8]
   2376 // CHECK-ERROR-AARCH64-NEXT:                 ^
   2377 
   2378 //// 32-bit addresses
   2379         ldr w0, [w20]
   2380         ldrsh x3, [wsp]
   2381 // CHECK-ERROR: error: invalid operand for instruction
   2382 // CHECK-ERROR-NEXT:         ldr w0, [w20]
   2383 // CHECK-ERROR-NEXT:                  ^
   2384 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2385 // CHECK-ERROR-NEXT:         ldrsh x3, [wsp]
   2386 // CHECK-ERROR-NEXT:                    ^
   2387 
   2388 //// Store things
   2389         strb w0, [wsp]
   2390         strh w31, [x23, #1]
   2391         str x5, [x22, #12]
   2392         str w7, [x12, #16384]
   2393 // CHECK-ERROR: error: invalid operand for instruction
   2394 // CHECK-ERROR-NEXT: strb w0, [wsp]
   2395 // CHECK-ERROR-NEXT:           ^
   2396 // CHECK-ERROR-AARCH64: error: invalid operand for instruction
   2397 // CHECK-ERROR-AARCH64-NEXT:         strh w31, [x23, #1]
   2398 // CHECK-ERROR-AARCH64-NEXT:              ^
   2399 // CHECK-ERROR-AARCH64-NEXT: error: too few operands for instruction
   2400 // CHECK-ERROR-AARCH64-NEXT:         str x5, [x22, #12]
   2401 // CHECK-ERROR-AARCH64-NEXT:                 ^
   2402 // CHECK-ERROR-NEXT: error: {{expected|index must be an}} integer in range [-256, 255]
   2403 // CHECK-ERROR-NEXT:         str w7, [x12, #16384]
   2404 // CHECK-ERROR-NEXT:                 ^
   2405 
   2406 //// Bad PRFMs
   2407         prfm #-1, [sp]
   2408         prfm #32, [sp, #8]
   2409         prfm pldl1strm, [w3, #8]
   2410         prfm wibble, [sp]
   2411 // CHECK-ERROR-AARCH64: error: Invalid immediate for instruction
   2412 // CHECK-ERROR-ARM64: error: prefetch operand out of range, [0,31] expected
   2413 // CHECK-ERROR-NEXT:        prfm #-1, [sp]
   2414 // CHECK-ERROR-NEXT:             ^
   2415 // CHECK-ERROR-AARCH64-NEXT: error: Invalid immediate for instruction
   2416 // CHECK-ERROR-ARM64-NEXT: error: prefetch operand out of range, [0,31] expected
   2417 // CHECK-ERROR-NEXT:        prfm #32, [sp, #8]
   2418 // CHECK-ERROR-NEXT:             ^
   2419 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2420 // CHECK-ERROR-NEXT:        prfm pldl1strm, [w3, #8]
   2421 // CHECK-ERROR-NEXT:                         ^
   2422 // CHECK-ERROR-AARCH64-NEXT: error: operand specifier not recognised
   2423 // CHECK-ERROR-ARM64-NEXT: error: pre-fetch hint expected
   2424 // CHECK-ERROR-NEXT:        prfm wibble, [sp]
   2425 // CHECK-ERROR-NEXT:             ^
   2426 
   2427 //------------------------------------------------------------------------------
   2428 // Load/store register (register offset)
   2429 //------------------------------------------------------------------------------
   2430 
   2431         ldr w3, [xzr, x3]
   2432         ldr w4, [x0, x4, lsl]
   2433         ldr w9, [x5, x5, uxtw]
   2434         ldr w10, [x6, x9, sxtw #2]
   2435         ldr w11, [x7, w2, lsl #2]
   2436         ldr w12, [x8, w1, sxtx]
   2437 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2438 // CHECK-ERROR-NEXT:        ldr w3, [xzr, x3]
   2439 // CHECK-ERROR-NEXT:                 ^
   2440 // CHECK-ERROR-NEXT: error: expected #imm after shift specifier
   2441 // CHECK-ERROR-NEXT:         ldr w4, [x0, x4, lsl]
   2442 // CHECK-ERROR-NEXT:                             ^
   2443 // CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #2
   2444 // CHECK-ERROR-NEXT:         ldr w9, [x5, x5, uxtw]
   2445 // CHECK-ERROR-NEXT:                          ^
   2446 // CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #2
   2447 // CHECK-ERROR-NEXT:         ldr w10, [x6, x9, sxtw #2]
   2448 // CHECK-ERROR-NEXT:                           ^
   2449 // CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #2
   2450 // CHECK-ERROR-NEXT:         ldr w11, [x7, w2, lsl #2]
   2451 // CHECK-ERROR-NEXT:                           ^
   2452 // CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #2
   2453 // CHECK-ERROR-NEXT:         ldr w12, [x8, w1, sxtx]
   2454 // CHECK-ERROR-NEXT:                           ^
   2455 
   2456         ldrsb w9, [x4, x2, lsl #-1]
   2457         strb w9, [x4, x2, lsl #1]
   2458 // CHECK-ERROR-NEXT: error: expected integer shift amount
   2459 // CHECK-ERROR-NEXT:         ldrsb w9, [x4, x2, lsl #-1]
   2460 // CHECK-ERROR-NEXT:                                 ^
   2461 // CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0
   2462 // CHECK-ERROR-NEXT:         strb w9, [x4, x2, lsl #1]
   2463 // CHECK-ERROR-NEXT:                  ^
   2464 
   2465         ldrsh w9, [x4, x2, lsl #-1]
   2466         ldr h13, [x4, w2, uxtw #2]
   2467 // CHECK-ERROR-NEXT: error: expected integer shift amount
   2468 // CHECK-ERROR-NEXT:         ldrsh w9, [x4, x2, lsl #-1]
   2469 // CHECK-ERROR-NEXT:                                 ^
   2470 // CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #1
   2471 // CHECK-ERROR-NEXT:         ldr h13, [x4, w2, uxtw #2]
   2472 // CHECK-ERROR-NEXT:                           ^
   2473 
   2474         str w9, [x5, w9, sxtw #-1]
   2475         str s3, [sp, w9, uxtw #1]
   2476         ldrsw x9, [x15, x4, sxtx #3]
   2477 // CHECK-ERROR-NEXT: error: expected integer shift amount
   2478 // CHECK-ERROR-NEXT:         str w9, [x5, w9, sxtw #-1]
   2479 // CHECK-ERROR-NEXT:                                ^
   2480 // CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #2
   2481 // CHECK-ERROR-NEXT:         str s3, [sp, w9, uxtw #1]
   2482 // CHECK-ERROR-NEXT:                          ^
   2483 // CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #2
   2484 // CHECK-ERROR-NEXT:         ldrsw x9, [x15, x4, sxtx #3]
   2485 // CHECK-ERROR-NEXT:                             ^
   2486 
   2487         str xzr, [x5, x9, sxtx #-1]
   2488         prfm pldl3keep, [sp, x20, lsl #2]
   2489         ldr d3, [x20, wzr, uxtw #4]
   2490 // CHECK-ERROR-NEXT: error: expected integer shift amount
   2491 // CHECK-ERROR-NEXT:         str xzr, [x5, x9, sxtx #-1]
   2492 // CHECK-ERROR-NEXT:                                 ^
   2493 // CHECK-ERROR-NEXT: error: expected 'lsl' or 'sxtx' with optional shift of #0 or #3
   2494 // CHECK-ERROR-NEXT:         prfm pldl3keep, [sp, x20, lsl #2]
   2495 // CHECK-ERROR-NEXT:                         ^
   2496 // CHECK-ERROR-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #3
   2497 // CHECK-ERROR-NEXT:         ldr d3, [x20, wzr, uxtw #4]
   2498 // CHECK-ERROR-NEXT:                 ^
   2499 
   2500         ldr q5, [sp, x2, lsl #-1]
   2501         ldr q10, [x20, w4, uxtw #2]
   2502         str q21, [x20, w4, uxtw #5]
   2503 // CHECK-ERROR-NEXT: error: expected integer shift amount
   2504 // CHECK-ERROR-NEXT:         ldr q5, [sp, x2, lsl #-1]
   2505 // CHECK-ERROR-NEXT:                               ^
   2506 // CHECK-ERROR-AARCH64-NEXT: error: expected 'lsl' or 'sxtw' with optional shift of #0 or #4
   2507 // CHECK-ERROR-ARM64-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #4
   2508 // CHECK-ERROR-NEXT:         ldr q10, [x20, w4, uxtw #2]
   2509 // CHECK-ERROR-NEXT:                  ^
   2510 // CHECK-ERROR-AARCH64-NEXT: error: expected 'lsl' or 'sxtw' with optional shift of #0 or #4
   2511 // CHECK-ERROR-ARM64-NEXT: error: expected 'uxtw' or 'sxtw' with optional shift of #0 or #4
   2512 // CHECK-ERROR-NEXT:         str q21, [x20, w4, uxtw #5]
   2513 // CHECK-ERROR-NEXT:                  ^
   2514 
   2515 //------------------------------------------------------------------------------
   2516 // Load/store register pair (offset)
   2517 //------------------------------------------------------------------------------
   2518         ldp w3, w2, [x4, #1]
   2519         stp w1, w2, [x3, #253]
   2520         stp w9, w10, [x5, #256]
   2521         ldp w11, w12, [x9, #-260]
   2522         stp wsp, w9, [sp]
   2523 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2524 // CHECK-ERROR-NEXT:         ldp w3, w2, [x4, #1]
   2525 // CHECK-ERROR-NEXT:                          ^
   2526 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2527 // CHECK-ERROR-NEXT:         stp w1, w2, [x3, #253]
   2528 // CHECK-ERROR-NEXT:                     ^
   2529 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2530 // CHECK-ERROR-NEXT:         stp w9, w10, [x5, #256]
   2531 // CHECK-ERROR-NEXT:                      ^
   2532 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2533 // CHECK-ERROR-NEXT:         ldp w11, w12, [x9, #-260]
   2534 // CHECK-ERROR-NEXT:                       ^
   2535 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2536 // CHECK-ERROR-NEXT:         stp wsp, w9, [sp]
   2537 // CHECK-ERROR-NEXT:             ^
   2538 
   2539         ldpsw x9, x2, [sp, #2]
   2540         ldpsw x1, x2, [x10, #256]
   2541         ldpsw x3, x4, [x11, #-260]
   2542 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2543 // CHECK-ERROR-NEXT:         ldpsw x9, x2, [sp, #2]
   2544 // CHECK-ERROR-NEXT:                       ^
   2545 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2546 // CHECK-ERROR-NEXT:         ldpsw x1, x2, [x10, #256]
   2547 // CHECK-ERROR-NEXT:                       ^
   2548 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2549 // CHECK-ERROR-NEXT:         ldpsw x3, x4, [x11, #-260]
   2550 // CHECK-ERROR-NEXT:                       ^
   2551 
   2552         ldp x2, x5, [sp, #4]
   2553         ldp x5, x6, [x9, #512]
   2554         stp x7, x8, [x10, #-520]
   2555 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2556 // CHECK-ERROR-NEXT:         ldp x2, x5, [sp, #4]
   2557 // CHECK-ERROR-NEXT:                     ^
   2558 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2559 // CHECK-ERROR-NEXT:         ldp x5, x6, [x9, #512]
   2560 // CHECK-ERROR-NEXT:                     ^
   2561 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2562 // CHECK-ERROR-NEXT:         stp x7, x8, [x10, #-520]
   2563 // CHECK-ERROR-NEXT:                     ^
   2564 
   2565         ldp sp, x3, [x10]
   2566         stp x3, sp, [x9]
   2567 // CHECK-ERROR: error: invalid operand for instruction
   2568 // CHECK-ERROR-NEXT:         ldp sp, x3, [x10]
   2569 // CHECK-ERROR-NEXT:             ^
   2570 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2571 // CHECK-ERROR-NEXT:         stp x3, sp, [x9]
   2572 // CHECK-ERROR-NEXT:                 ^
   2573 
   2574         stp s3, s5, [sp, #-2]
   2575         ldp s6, s26, [x4, #-260]
   2576         stp s13, s19, [x5, #256]
   2577 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2578 // CHECK-ERROR-NEXT:         stp s3, s5, [sp, #-2]
   2579 // CHECK-ERROR-NEXT:                     ^
   2580 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2581 // CHECK-ERROR-NEXT:         ldp s6, s26, [x4, #-260]
   2582 // CHECK-ERROR-NEXT:                      ^
   2583 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2584 // CHECK-ERROR-NEXT:         stp s13, s19, [x5, #256]
   2585 // CHECK-ERROR-NEXT:                       ^
   2586 
   2587         ldp d3, d4, [xzr]
   2588         ldp d5, d6, [x0, #512]
   2589         stp d7, d8, [x0, #-520]
   2590 // CHECK-ERROR: error: invalid operand for instruction
   2591 // CHECK-ERROR-NEXT:         ldp d3, d4, [xzr]
   2592 // CHECK-ERROR-NEXT:                      ^
   2593 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2594 // CHECK-ERROR-NEXT:         ldp d5, d6, [x0, #512]
   2595 // CHECK-ERROR-NEXT:                     ^
   2596 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2597 // CHECK-ERROR-NEXT:         stp d7, d8, [x0, #-520]
   2598 // CHECK-ERROR-NEXT:                     ^
   2599 
   2600         ldp d3, q2, [sp]
   2601         ldp q3, q5, [sp, #8]
   2602         stp q20, q25, [x5, #1024]
   2603         ldp q30, q15, [x23, #-1040]
   2604 // CHECK-ERROR: error: invalid operand for instruction
   2605 // CHECK-ERROR-NEXT:         ldp d3, q2, [sp]
   2606 // CHECK-ERROR-NEXT:                 ^
   2607 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2608 // CHECK-ERROR-NEXT:         ldp q3, q5, [sp, #8]
   2609 // CHECK-ERROR-NEXT:                     ^
   2610 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2611 // CHECK-ERROR-NEXT:         stp q20, q25, [x5, #1024]
   2612 // CHECK-ERROR-NEXT:                       ^
   2613 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2614 // CHECK-ERROR-NEXT:         ldp q30, q15, [x23, #-1040]
   2615 // CHECK-ERROR-NEXT:                       ^
   2616 
   2617 //------------------------------------------------------------------------------
   2618 // Load/store register pair (post-indexed)
   2619 //------------------------------------------------------------------------------
   2620 
   2621         ldp w3, w2, [x4], #1
   2622         stp w1, w2, [x3], #253
   2623         stp w9, w10, [x5], #256
   2624         ldp w11, w12, [x9], #-260
   2625         stp wsp, w9, [sp], #0
   2626 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2627 // CHECK-ERROR-NEXT:         ldp w3, w2, [x4], #1
   2628 // CHECK-ERROR-NEXT:                           ^
   2629 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2630 // CHECK-ERROR-NEXT:         stp w1, w2, [x3], #253
   2631 // CHECK-ERROR-NEXT:                     ^
   2632 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2633 // CHECK-ERROR-NEXT:         stp w9, w10, [x5], #256
   2634 // CHECK-ERROR-NEXT:                      ^
   2635 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2636 // CHECK-ERROR-NEXT:         ldp w11, w12, [x9], #-260
   2637 // CHECK-ERROR-NEXT:                       ^
   2638 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2639 // CHECK-ERROR-NEXT:         stp wsp, w9, [sp], #0
   2640 // CHECK-ERROR-NEXT:             ^
   2641 
   2642         ldpsw x9, x2, [sp], #2
   2643         ldpsw x1, x2, [x10], #256
   2644         ldpsw x3, x4, [x11], #-260
   2645 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2646 // CHECK-ERROR-NEXT:         ldpsw x9, x2, [sp], #2
   2647 // CHECK-ERROR-NEXT:                       ^
   2648 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2649 // CHECK-ERROR-NEXT:         ldpsw x1, x2, [x10], #256
   2650 // CHECK-ERROR-NEXT:                       ^
   2651 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2652 // CHECK-ERROR-NEXT:         ldpsw x3, x4, [x11], #-260
   2653 // CHECK-ERROR-NEXT:                       ^
   2654 
   2655         ldp x2, x5, [sp], #4
   2656         ldp x5, x6, [x9], #512
   2657         stp x7, x8, [x10], #-520
   2658 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2659 // CHECK-ERROR-NEXT:         ldp x2, x5, [sp], #4
   2660 // CHECK-ERROR-NEXT:                           ^
   2661 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2662 // CHECK-ERROR-NEXT:         ldp x5, x6, [x9], #512
   2663 // CHECK-ERROR-NEXT:                           ^
   2664 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2665 // CHECK-ERROR-NEXT:         stp x7, x8, [x10], #-520
   2666 // CHECK-ERROR-NEXT:                            ^
   2667 
   2668         ldp sp, x3, [x10], #0
   2669         stp x3, sp, [x9], #0
   2670 // CHECK-ERROR: error: invalid operand for instruction
   2671 // CHECK-ERROR-NEXT:         ldp sp, x3, [x10], #0
   2672 // CHECK-ERROR-NEXT:             ^
   2673 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2674 // CHECK-ERROR-NEXT:         stp x3, sp, [x9], #0
   2675 // CHECK-ERROR-NEXT:                 ^
   2676 
   2677         stp s3, s5, [sp], #-2
   2678         ldp s6, s26, [x4], #-260
   2679         stp s13, s19, [x5], #256
   2680 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2681 // CHECK-ERROR-NEXT:         stp s3, s5, [sp], #-2
   2682 // CHECK-ERROR-NEXT:                     ^
   2683 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2684 // CHECK-ERROR-NEXT:         ldp s6, s26, [x4], #-260
   2685 // CHECK-ERROR-NEXT:                      ^
   2686 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2687 // CHECK-ERROR-NEXT:         stp s13, s19, [x5], #256
   2688 // CHECK-ERROR-NEXT:                       ^
   2689 
   2690         ldp d3, d4, [xzr], #0
   2691         ldp d5, d6, [x0], #512
   2692         stp d7, d8, [x0], #-520
   2693 // CHECK-ERROR: error: invalid operand for instruction
   2694 // CHECK-ERROR-NEXT:         ldp d3, d4, [xzr], #0
   2695 // CHECK-ERROR-NEXT:                      ^
   2696 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2697 // CHECK-ERROR-NEXT:         ldp d5, d6, [x0], #512
   2698 // CHECK-ERROR-NEXT:                     ^
   2699 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2700 // CHECK-ERROR-NEXT:         stp d7, d8, [x0], #-520
   2701 // CHECK-ERROR-NEXT:                     ^
   2702 
   2703         ldp d3, q2, [sp], #0
   2704         ldp q3, q5, [sp], #8
   2705         stp q20, q25, [x5], #1024
   2706         ldp q30, q15, [x23], #-1040
   2707 // CHECK-ERROR: error: invalid operand for instruction
   2708 // CHECK-ERROR-NEXT:         ldp d3, q2, [sp], #0
   2709 // CHECK-ERROR-NEXT:                 ^
   2710 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2711 // CHECK-ERROR-NEXT:         ldp q3, q5, [sp], #8
   2712 // CHECK-ERROR-NEXT:                     ^
   2713 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2714 // CHECK-ERROR-NEXT:         stp q20, q25, [x5], #1024
   2715 // CHECK-ERROR-NEXT:                       ^
   2716 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2717 // CHECK-ERROR-NEXT:         ldp q30, q15, [x23], #-1040
   2718 // CHECK-ERROR-NEXT:                       ^
   2719 
   2720 //------------------------------------------------------------------------------
   2721 // Load/store register pair (pre-indexed)
   2722 //------------------------------------------------------------------------------
   2723 
   2724         ldp w3, w2, [x4, #1]!
   2725         stp w1, w2, [x3, #253]!
   2726         stp w9, w10, [x5, #256]!
   2727         ldp w11, w12, [x9, #-260]!
   2728         stp wsp, w9, [sp, #0]!
   2729 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2730 // CHECK-ERROR-NEXT:         ldp w3, w2, [x4, #1]!
   2731 // CHECK-ERROR-NEXT:                           ^
   2732 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2733 // CHECK-ERROR-NEXT:         stp w1, w2, [x3, #253]!
   2734 // CHECK-ERROR-NEXT:                     ^
   2735 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2736 // CHECK-ERROR-NEXT:         stp w9, w10, [x5, #256]!
   2737 // CHECK-ERROR-NEXT:                      ^
   2738 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2739 // CHECK-ERROR-NEXT:         ldp w11, w12, [x9, #-260]!
   2740 // CHECK-ERROR-NEXT:                       ^
   2741 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2742 // CHECK-ERROR-NEXT:         stp wsp, w9, [sp, #0]!
   2743 // CHECK-ERROR-NEXT:             ^
   2744 
   2745         ldpsw x9, x2, [sp, #2]!
   2746         ldpsw x1, x2, [x10, #256]!
   2747         ldpsw x3, x4, [x11, #-260]!
   2748 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2749 // CHECK-ERROR-NEXT:         ldpsw x9, x2, [sp, #2]!
   2750 // CHECK-ERROR-NEXT:                       ^
   2751 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2752 // CHECK-ERROR-NEXT:         ldpsw x1, x2, [x10, #256]!
   2753 // CHECK-ERROR-NEXT:                       ^
   2754 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2755 // CHECK-ERROR-NEXT:         ldpsw x3, x4, [x11, #-260]!
   2756 // CHECK-ERROR-NEXT:                       ^
   2757 
   2758         ldp x2, x5, [sp, #4]!
   2759         ldp x5, x6, [x9, #512]!
   2760         stp x7, x8, [x10, #-520]!
   2761 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2762 // CHECK-ERROR-NEXT:         ldp x2, x5, [sp, #4]!
   2763 // CHECK-ERROR-NEXT:                     ^
   2764 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2765 // CHECK-ERROR-NEXT:         ldp x5, x6, [x9, #512]!
   2766 // CHECK-ERROR-NEXT:                     ^
   2767 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2768 // CHECK-ERROR-NEXT:         stp x7, x8, [x10, #-520]!
   2769 // CHECK-ERROR-NEXT:                     ^
   2770 
   2771         ldp sp, x3, [x10, #0]!
   2772         stp x3, sp, [x9, #0]!
   2773 // CHECK-ERROR: error: invalid operand for instruction
   2774 // CHECK-ERROR-NEXT:         ldp sp, x3, [x10, #0]!
   2775 // CHECK-ERROR-NEXT:             ^
   2776 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2777 // CHECK-ERROR-NEXT:         stp x3, sp, [x9, #0]!
   2778 // CHECK-ERROR-NEXT:                 ^
   2779 
   2780         stp s3, s5, [sp, #-2]!
   2781         ldp s6, s26, [x4, #-260]!
   2782         stp s13, s19, [x5, #256]!
   2783 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2784 // CHECK-ERROR-NEXT:         stp s3, s5, [sp, #-2]!
   2785 // CHECK-ERROR-NEXT:                     ^
   2786 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2787 // CHECK-ERROR-NEXT:         ldp s6, s26, [x4, #-260]!
   2788 // CHECK-ERROR-NEXT:                      ^
   2789 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2790 // CHECK-ERROR-NEXT:         stp s13, s19, [x5, #256]!
   2791 // CHECK-ERROR-NEXT:                       ^
   2792 
   2793         ldp d3, d4, [xzr, #0]!
   2794         ldp d5, d6, [x0, #512]!
   2795         stp d7, d8, [x0, #-520]!
   2796 // CHECK-ERROR: error: invalid operand for instruction
   2797 // CHECK-ERROR-NEXT:         ldp d3, d4, [xzr, #0]!
   2798 // CHECK-ERROR-NEXT:                      ^
   2799 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2800 // CHECK-ERROR-NEXT:         ldp d5, d6, [x0, #512]!
   2801 // CHECK-ERROR-NEXT:                     ^
   2802 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2803 // CHECK-ERROR-NEXT:         stp d7, d8, [x0, #-520]!
   2804 // CHECK-ERROR-NEXT:                     ^
   2805 
   2806         ldp d3, q2, [sp, #0]!
   2807         ldp q3, q5, [sp, #8]!
   2808         stp q20, q25, [x5, #1024]!
   2809         ldp q30, q15, [x23, #-1040]!
   2810 // CHECK-ERROR: error: invalid operand for instruction
   2811 // CHECK-ERROR-NEXT:         ldp d3, q2, [sp, #0]!
   2812 // CHECK-ERROR-NEXT:                 ^
   2813 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2814 // CHECK-ERROR-NEXT:         ldp q3, q5, [sp, #8]!
   2815 // CHECK-ERROR-NEXT:                     ^
   2816 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2817 // CHECK-ERROR-NEXT:         stp q20, q25, [x5, #1024]!
   2818 // CHECK-ERROR-NEXT:                       ^
   2819 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2820 // CHECK-ERROR-NEXT:         ldp q30, q15, [x23, #-1040]!
   2821 // CHECK-ERROR-NEXT:                       ^
   2822 
   2823 //------------------------------------------------------------------------------
   2824 // Load/store register pair (offset)
   2825 //------------------------------------------------------------------------------
   2826         ldnp w3, w2, [x4, #1]
   2827         stnp w1, w2, [x3, #253]
   2828         stnp w9, w10, [x5, #256]
   2829         ldnp w11, w12, [x9, #-260]
   2830         stnp wsp, w9, [sp]
   2831 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2832 // CHECK-ERROR-NEXT:         ldnp w3, w2, [x4, #1]
   2833 // CHECK-ERROR-NEXT:                           ^
   2834 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2835 // CHECK-ERROR-NEXT:         stnp w1, w2, [x3, #253]
   2836 // CHECK-ERROR-NEXT:                           ^
   2837 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2838 // CHECK-ERROR-NEXT:         stnp w9, w10, [x5, #256]
   2839 // CHECK-ERROR-NEXT:                            ^
   2840 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2841 // CHECK-ERROR-NEXT:         ldnp w11, w12, [x9, #-260]
   2842 // CHECK-ERROR-NEXT:                             ^
   2843 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2844 // CHECK-ERROR-NEXT:         stnp wsp, w9, [sp]
   2845 // CHECK-ERROR-NEXT:              ^
   2846 
   2847         ldnp x2, x5, [sp, #4]
   2848         ldnp x5, x6, [x9, #512]
   2849         stnp x7, x8, [x10, #-520]
   2850 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2851 // CHECK-ERROR-NEXT:         ldnp x2, x5, [sp, #4]
   2852 // CHECK-ERROR-NEXT:                           ^
   2853 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2854 // CHECK-ERROR-NEXT:         ldnp x5, x6, [x9, #512]
   2855 // CHECK-ERROR-NEXT:                           ^
   2856 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2857 // CHECK-ERROR-NEXT:         stnp x7, x8, [x10, #-520]
   2858 // CHECK-ERROR-NEXT:                            ^
   2859 
   2860         ldnp sp, x3, [x10]
   2861         stnp x3, sp, [x9]
   2862 // CHECK-ERROR: error: invalid operand for instruction
   2863 // CHECK-ERROR-NEXT:         ldnp sp, x3, [x10]
   2864 // CHECK-ERROR-NEXT:             ^
   2865 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2866 // CHECK-ERROR-NEXT:         stnp x3, sp, [x9]
   2867 // CHECK-ERROR-NEXT:                 ^
   2868 
   2869         stnp s3, s5, [sp, #-2]
   2870         ldnp s6, s26, [x4, #-260]
   2871         stnp s13, s19, [x5, #256]
   2872 // CHECK-ERROR: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2873 // CHECK-ERROR-NEXT:         stnp s3, s5, [sp, #-2]
   2874 // CHECK-ERROR-NEXT:                     ^
   2875 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2876 // CHECK-ERROR-NEXT:         ldnp s6, s26, [x4, #-260]
   2877 // CHECK-ERROR-NEXT:                      ^
   2878 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 4 in range [-256, 252]
   2879 // CHECK-ERROR-NEXT:         stnp s13, s19, [x5, #256]
   2880 // CHECK-ERROR-NEXT:                       ^
   2881 
   2882         ldnp d3, d4, [xzr]
   2883         ldnp d5, d6, [x0, #512]
   2884         stnp d7, d8, [x0, #-520]
   2885 // CHECK-ERROR: error: invalid operand for instruction
   2886 // CHECK-ERROR-NEXT:         ldnp d3, d4, [xzr]
   2887 // CHECK-ERROR-NEXT:                      ^
   2888 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2889 // CHECK-ERROR-NEXT:         ldnp d5, d6, [x0, #512]
   2890 // CHECK-ERROR-NEXT:                     ^
   2891 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 8 in range [-512, 504]
   2892 // CHECK-ERROR-NEXT:         stnp d7, d8, [x0, #-520]
   2893 // CHECK-ERROR-NEXT:                     ^
   2894 
   2895         ldnp d3, q2, [sp]
   2896         ldnp q3, q5, [sp, #8]
   2897         stnp q20, q25, [x5, #1024]
   2898         ldnp q30, q15, [x23, #-1040]
   2899 // CHECK-ERROR: error: invalid operand for instruction
   2900 // CHECK-ERROR-NEXT:         ldnp d3, q2, [sp]
   2901 // CHECK-ERROR-NEXT:                 ^
   2902 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2903 // CHECK-ERROR-NEXT:         ldnp q3, q5, [sp, #8]
   2904 // CHECK-ERROR-NEXT:                     ^
   2905 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2906 // CHECK-ERROR-NEXT:         stnp q20, q25, [x5, #1024]
   2907 // CHECK-ERROR-NEXT:                       ^
   2908 // CHECK-ERROR-NEXT: error: {{expected integer|index must be a}} multiple of 16 in range [-1024, 1008]
   2909 // CHECK-ERROR-NEXT:         ldnp q30, q15, [x23, #-1040]
   2910 // CHECK-ERROR-NEXT:                       ^
   2911 
   2912 //------------------------------------------------------------------------------
   2913 // Logical (shifted register)
   2914 //------------------------------------------------------------------------------
   2915         orr w0, w1, #0xffffffff
   2916         and x3, x5, #0xffffffffffffffff
   2917 // CHECK-ERROR: error: expected compatible register or logical immediate
   2918 // CHECK-ERROR-NEXT:         orr w0, w1, #0xffffffff
   2919 // CHECK-ERROR-NEXT:                     ^
   2920 // CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
   2921 // CHECK-ERROR-NEXT:         and x3, x5, #0xffffffffffffffff
   2922 // CHECK-ERROR-NEXT:                     ^
   2923 
   2924         ands w3, w9, #0x0
   2925         eor x2, x0, #0x0
   2926 // CHECK-ERROR: error: expected compatible register or logical immediate
   2927 // CHECK-ERROR-NEXT:         ands w3, w9, #0x0
   2928 // CHECK-ERROR-NEXT:                      ^
   2929 // CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
   2930 // CHECK-ERROR-NEXT:         eor x2, x0, #0x0
   2931 // CHECK-ERROR-NEXT:                     ^
   2932 
   2933         eor w3, w5, #0x83
   2934         eor x9, x20, #0x1234
   2935 // CHECK-ERROR: error: expected compatible register or logical immediate
   2936 // CHECK-ERROR-NEXT:         eor w3, w5, #0x83
   2937 // CHECK-ERROR-NEXT:                     ^
   2938 // CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
   2939 // CHECK-ERROR-NEXT:         eor x9, x20, #0x1234
   2940 // CHECK-ERROR-NEXT:                      ^
   2941 
   2942         and wzr, w4, 0xffff0000
   2943         eor xzr, x9, #0xffff0000ffff0000
   2944 // CHECK-ERROR: error: invalid operand for instruction
   2945 // CHECK-ERROR-NEXT:         and wzr, w4, 0xffff0000
   2946 // CHECK-ERROR-NEXT:                      ^
   2947 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2948 // CHECK-ERROR-NEXT:         eor xzr, x9, #0xffff0000ffff0000
   2949 // CHECK-ERROR-NEXT:                      ^
   2950 
   2951         orr w3, wsp, #0xf0f0f0f0
   2952         ands x3, sp, #0xaaaaaaaaaaaaaaaa
   2953 // CHECK-ERROR: error: invalid operand for instruction
   2954 // CHECK-ERROR-NEXT:         orr w3, wsp, #0xf0f0f0f0
   2955 // CHECK-ERROR-NEXT:                 ^
   2956 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   2957 // CHECK-ERROR-NEXT:         ands x3, sp, #0xaaaaaaaaaaaaaaaa
   2958 // CHECK-ERROR-NEXT:                  ^
   2959 
   2960         tst sp, #0xe0e0e0e0e0e0e0e0
   2961 // CHECK-ERROR: error: invalid operand for instruction
   2962 // CHECK-ERROR-NEXT:         tst sp, #0xe0e0e0e0e0e0e0e0
   2963 // CHECK-ERROR-NEXT:             ^
   2964 
   2965         // movi has been removed from the specification. Make sure it's really gone.
   2966         movi wzr, #0x44444444
   2967         movi w3, #0xffff
   2968         movi x9, #0x0000ffff00000000
   2969 // CHECK-ERROR: error: invalid operand for instruction
   2970 // CHECK-ERROR-NEXT:         movi wzr, #0x44444444
   2971 // CHECK-ERROR-NEXT:         ^
   2972 // CHECK-ERROR: error: invalid operand for instruction
   2973 // CHECK-ERROR-NEXT:         movi w3, #0xffff
   2974 // CHECK-ERROR-NEXT:         ^
   2975 // CHECK-ERROR: error: invalid operand for instruction
   2976 // CHECK-ERROR-NEXT:         movi x9, #0x0000ffff00000000
   2977 // CHECK-ERROR-NEXT:         ^
   2978 
   2979 //------------------------------------------------------------------------------
   2980 // Logical (shifted register)
   2981 //------------------------------------------------------------------------------
   2982 
   2983         //// Out of range shifts
   2984         and w2, w24, w6, lsl #-1
   2985         and w4, w6, w12, lsl #32
   2986         and x4, x6, x12, lsl #64
   2987         and x2, x5, x11, asr
   2988 // CHECK-ERROR: error: expected integer shift amount
   2989 // CHECK-ERROR-NEXT:         and w2, w24, w6, lsl #-1
   2990 // CHECK-ERROR-NEXT:                               ^
   2991 // CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
   2992 // CHECK-ERROR-NEXT:         and w4, w6, w12, lsl #32
   2993 // CHECK-ERROR-NEXT:                          ^
   2994 // CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
   2995 // CHECK-ERROR-NEXT:         and x4, x6, x12, lsl #64
   2996 // CHECK-ERROR-NEXT:                          ^
   2997 // CHECK-ERROR-NEXT: error: expected #imm after shift specifier
   2998 // CHECK-ERROR-NEXT:         and x2, x5, x11, asr
   2999 // CHECK-ERROR-NEXT:                             ^
   3000 
   3001         //// sp not allowed
   3002         orn wsp, w3, w5
   3003         bics x20, sp, x9, lsr #0
   3004         orn x2, x6, sp, lsl #3
   3005 // FIXME: the diagnostic we get for 'orn wsp, w3, w5' is from the orn alias,
   3006 // which is a better match than the genuine ORNWri, whereas it would be better
   3007 // to get the ORNWri diagnostic when the alias did not match, i.e. the
   3008 // alias' diagnostics should have a lower priority.
   3009 // CHECK-ERROR: error: expected compatible register or logical immediate
   3010 // CHECK-ERROR-NEXT:         orn wsp, w3, w5
   3011 // CHECK-ERROR-NEXT:                      ^
   3012 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   3013 // CHECK-ERROR-NEXT:         bics x20, sp, x9, lsr #0
   3014 // CHECK-ERROR-NEXT:                   ^
   3015 // CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
   3016 // CHECK-ERROR-NEXT:         orn x2, x6, sp, lsl #3
   3017 // CHECK-ERROR-NEXT:                     ^
   3018 
   3019         //// Mismatched registers
   3020         and x3, w2, w1
   3021         ands w1, x12, w2
   3022         and x4, x5, w6, lsl #12
   3023         orr w2, w5, x7, asr #0
   3024 // CHECK-ERROR: error: invalid operand for instruction
   3025 // CHECK-ERROR-NEXT:         and x3, w2, w1
   3026 // CHECK-ERROR-NEXT:                 ^
   3027 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   3028 // CHECK-ERROR-NEXT:         ands w1, x12, w2
   3029 // CHECK-ERROR-NEXT:                  ^
   3030 // CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
   3031 // CHECK-ERROR-NEXT:         and x4, x5, w6, lsl #12
   3032 // CHECK-ERROR-NEXT:                     ^
   3033 // CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
   3034 // CHECK-ERROR-NEXT:         orr w2, w5, x7, asr #0
   3035 // CHECK-ERROR-NEXT:                     ^
   3036 
   3037         //// Shifts should not be allowed on mov
   3038         mov w3, w7, lsl #13
   3039 // CHECK-ERROR: error: invalid operand for instruction
   3040 // CHECK-ERROR-NEXT:         mov w3, w7, lsl #13
   3041 // CHECK-ERROR-NEXT:                     ^
   3042 
   3043 //------------------------------------------------------------------------------
   3044 // Move wide (immediate)
   3045 //------------------------------------------------------------------------------
   3046 
   3047         movz w3, #65536, lsl #0
   3048         movz w4, #65536
   3049         movn w1, #2, lsl #1
   3050         movk w3, #0, lsl #-1
   3051         movn w2, #-1, lsl #0
   3052         movz x3, #-1
   3053         movk w3, #1, lsl #32
   3054         movn x2, #12, lsl #64
   3055 // CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3056 // CHECK-ERROR-NEXT:         movz w3, #65536, lsl #0
   3057 // CHECK-ERROR-NEXT:                  ^
   3058 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3059 // CHECK-ERROR-NEXT:         movz w4, #65536
   3060 // CHECK-ERROR-NEXT:                  ^
   3061 // CHECK-ERROR-AARCH64-NEXT: error: expected relocated symbol or integer in range [0, 65535]
   3062 // CHECK-ERROR-ARM64-NEXT: error: expected 'lsl' with optional integer 0 or 16
   3063 // CHECK-ERROR-NEXT:         movn w1, #2, lsl #1
   3064 // CHECK-ERROR-NEXT:                  ^
   3065 // CHECK-ERROR-AARCH64-NEXT: error: only 'lsl #+N' valid after immediate
   3066 // CHECK-ERROR-ARM64-NEXT: error: expected integer shift amount
   3067 // CHECK-ERROR-NEXT:         movk w3, #0, lsl #-1
   3068 // CHECK-ERROR-NEXT:                           ^
   3069 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3070 // CHECK-ERROR-NEXT:         movn w2, #-1, lsl #0
   3071 // CHECK-ERROR-NEXT:                  ^
   3072 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3073 // CHECK-ERROR-NEXT:         movz x3, #-1
   3074 // CHECK-ERROR-NEXT:                  ^
   3075 // CHECK-ERROR-AARCH64-NEXT: error: expected relocated symbol or integer in range [0, 65535]
   3076 // CHECK-ERROR-ARM64-NEXT: error: expected 'lsl' with optional integer 0 or 16
   3077 // CHECK-ERROR-NEXT:         movk w3, #1, lsl #32
   3078 // CHECK-ERROR-NEXT:                  ^
   3079 // CHECK-ERROR-AARCH64-NEXT: error: expected relocated symbol or integer in range [0, 65535]
   3080 // CHECK-ERROR-ARM64-NEXT: error: expected 'lsl' with optional integer 0, 16, 32 or 48
   3081 // CHECK-ERROR-NEXT:         movn x2, #12, lsl #64
   3082 // CHECK-ERROR-NEXT:                  ^
   3083 
   3084         movz x12, #:abs_g0:sym, lsl #16
   3085         movz x12, #:abs_g0:sym, lsl #0
   3086         movn x2, #:abs_g0:sym
   3087         movk w3, #:abs_g0:sym
   3088         movz x3, #:abs_g0_nc:sym
   3089         movn x4, #:abs_g0_nc:sym
   3090 // CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3091 // CHECK-ERROR-NEXT:         movz x12, #:abs_g0:sym, lsl #16
   3092 // CHECK-ERROR-NEXT:                                 ^
   3093 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3094 // CHECK-ERROR-NEXT:         movz x12, #:abs_g0:sym, lsl #0
   3095 // CHECK-ERROR-NEXT:                                 ^
   3096 // CHECK-ERROR-AARCH64-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3097 // CHECK-ERROR-AARCH64-NEXT:         movn x2, #:abs_g0: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_g0: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_g0_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_g0_nc:sym
   3107 // CHECK-ERROR-NEXT:                  ^
   3108 
   3109         movn x2, #:abs_g1:sym
   3110         movk w3, #:abs_g1:sym
   3111         movz x3, #:abs_g1_nc:sym
   3112         movn x4, #:abs_g1_nc:sym
   3113 // CHECK-ERROR-AARCH64: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3114 // CHECK-ERROR-AARCH64-NEXT:         movn x2, #:abs_g1:sym
   3115 // CHECK-ERROR-AARCH64-NEXT:                  ^
   3116 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3117 // CHECK-ERROR-NEXT:         movk w3, #:abs_g1:sym
   3118 // CHECK-ERROR-NEXT:                  ^
   3119 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3120 // CHECK-ERROR-NEXT:         movz x3, #:abs_g1_nc:sym
   3121 // CHECK-ERROR-NEXT:                  ^
   3122 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3123 // CHECK-ERROR-NEXT:         movn x4, #:abs_g1_nc:sym
   3124 // CHECK-ERROR-NEXT:                  ^
   3125 
   3126         movz w12, #:abs_g2:sym
   3127         movn x12, #:abs_g2:sym
   3128         movk x13, #:abs_g2:sym
   3129         movk w3, #:abs_g2_nc:sym
   3130         movz x13, #:abs_g2_nc:sym
   3131         movn x24, #:abs_g2_nc:sym
   3132 // CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3133 // CHECK-ERROR-NEXT:         movz w12, #:abs_g2:sym
   3134 // CHECK-ERROR-NEXT:                   ^
   3135 // CHECK-ERROR-AARCH64-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3136 // CHECK-ERROR-AARCH64-NEXT:         movn x12, #:abs_g2:sym
   3137 // CHECK-ERROR-AARCH64-NEXT:                   ^
   3138 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3139 // CHECK-ERROR-NEXT:         movk x13, #:abs_g2:sym
   3140 // CHECK-ERROR-NEXT:                   ^
   3141 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3142 // CHECK-ERROR-NEXT:         movk w3, #:abs_g2_nc:sym
   3143 // CHECK-ERROR-NEXT:                  ^
   3144 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3145 // CHECK-ERROR-NEXT:         movz x13, #:abs_g2_nc:sym
   3146 // CHECK-ERROR-NEXT:                   ^
   3147 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3148 // CHECK-ERROR-NEXT:         movn x24, #:abs_g2_nc:sym
   3149 // CHECK-ERROR-NEXT:                   ^
   3150 
   3151         movn x19, #:abs_g3:sym
   3152         movz w20, #:abs_g3:sym
   3153         movk w21, #:abs_g3:sym
   3154 // CHECK-ERROR-AARCH64: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3155 // CHECK-ERROR-AARCH64-NEXT:         movn x19, #:abs_g3:sym
   3156 // CHECK-ERROR-AARCH64-NEXT:                   ^
   3157 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3158 // CHECK-ERROR-NEXT:         movz w20, #:abs_g3:sym
   3159 // CHECK-ERROR-NEXT:                   ^
   3160 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3161 // CHECK-ERROR-NEXT:         movk w21, #:abs_g3:sym
   3162 // CHECK-ERROR-NEXT:                   ^
   3163 
   3164         movk x19, #:abs_g0_s:sym
   3165         movk w23, #:abs_g0_s:sym
   3166 // CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3167 // CHECK-ERROR-NEXT:         movk x19, #:abs_g0_s:sym
   3168 // CHECK-ERROR-NEXT:                   ^
   3169 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3170 // CHECK-ERROR-NEXT:         movk w23, #:abs_g0_s:sym
   3171 // CHECK-ERROR-NEXT:                   ^
   3172 
   3173         movk x19, #:abs_g1_s:sym
   3174         movk w23, #:abs_g1_s:sym
   3175 // CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3176 // CHECK-ERROR-NEXT:         movk x19, #:abs_g1_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_g1_s:sym
   3180 // CHECK-ERROR-NEXT:                   ^
   3181 
   3182         movz w2, #:abs_g2_s:sym
   3183         movn w29, #:abs_g2_s:sym
   3184         movk x19, #:abs_g2_s:sym
   3185         movk w23, #:abs_g2_s:sym
   3186 // CHECK-ERROR: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3187 // CHECK-ERROR-NEXT:         movz w2, #:abs_g2_s:sym
   3188 // CHECK-ERROR-NEXT:                    ^
   3189 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3190 // CHECK-ERROR-NEXT:         movn w29, #:abs_g2_s:sym
   3191 // CHECK-ERROR-NEXT:                   ^
   3192 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3193 // CHECK-ERROR-NEXT:         movk x19, #:abs_g2_s:sym
   3194 // CHECK-ERROR-NEXT:                   ^
   3195 // CHECK-ERROR-NEXT: error: {{expected relocated symbol or|immediate must be an}} integer in range [0, 65535]
   3196 // CHECK-ERROR-NEXT:         movk w23, #:abs_g2_s:sym
   3197 // CHECK-ERROR-NEXT:                   ^
   3198 
   3199 //------------------------------------------------------------------------------
   3200 // PC-relative addressing
   3201 //------------------------------------------------------------------------------
   3202 
   3203         adr sp, loc             // expects xzr
   3204         adrp x3, #20            // Immediate unaligned
   3205         adrp w2, loc            // 64-bit register needed
   3206 // CHECK-ERROR: error: invalid operand for instruction
   3207 // CHECK-ERROR-NEXT:         adr sp, loc
   3208 // CHECK-ERROR-NEXT:             ^
   3209 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   3210 // CHECK-ERROR-NEXT:         adrp x3, #20
   3211 // CHECK-ERROR-NEXT:                  ^
   3212 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   3213 // CHECK-ERROR-NEXT:         adrp w2, loc
   3214 // CHECK-ERROR-NEXT:              ^
   3215 
   3216         adr x9, #1048576
   3217         adr x2, #-1048577
   3218         adrp x9, #4294967296
   3219         adrp x20, #-4294971392
   3220 // CHECK-ERROR: error: expected label or encodable integer pc offset
   3221 // CHECK-ERROR-NEXT:         adr x9, #1048576
   3222 // CHECK-ERROR-NEXT:                 ^
   3223 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   3224 // CHECK-ERROR-NEXT:         adr x2, #-1048577
   3225 // CHECK-ERROR-NEXT:                  ^
   3226 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   3227 // CHECK-ERROR-NEXT:         adrp x9, #4294967296
   3228 // CHECK-ERROR-NEXT:                  ^
   3229 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   3230 // CHECK-ERROR-NEXT:         adrp x20, #-4294971392
   3231 // CHECK-ERROR-NEXT:                   ^
   3232 
   3233 //------------------------------------------------------------------------------
   3234 // System
   3235 //------------------------------------------------------------------------------
   3236 
   3237         hint #-1
   3238         hint #128
   3239 // CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 127]
   3240 // CHECK-ERROR-NEXT:         hint #-1
   3241 // CHECK-ERROR-NEXT:              ^
   3242 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 127]
   3243 // CHECK-ERROR-NEXT:         hint #128
   3244 // CHECK-ERROR-NEXT:              ^
   3245 
   3246         clrex #-1
   3247         clrex #16
   3248 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   3249 // CHECK-ERROR-NEXT:         clrex #-1
   3250 // CHECK-ERROR-NEXT:               ^
   3251 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   3252 // CHECK-ERROR-NEXT:         clrex #16
   3253 // CHECK-ERROR-NEXT:               ^
   3254 
   3255         dsb #-1
   3256         dsb #16
   3257         dmb #-1
   3258         dmb #16
   3259 // CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
   3260 // CHECK-ERROR-NEXT:         dsb #-1
   3261 // CHECK-ERROR-NEXT:             ^
   3262 // CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
   3263 // CHECK-ERROR-NEXT:         dsb #16
   3264 // CHECK-ERROR-NEXT:             ^
   3265 // CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
   3266 // CHECK-ERROR-NEXT:         dmb #-1
   3267 // CHECK-ERROR-NEXT:             ^
   3268 // CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
   3269 // CHECK-ERROR-NEXT:         dmb #16
   3270 // CHECK-ERROR-NEXT:             ^
   3271 
   3272         isb #-1
   3273         isb #16
   3274 // CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
   3275 // CHECK-ERROR-NEXT:         isb #-1
   3276 // CHECK-ERROR-NEXT:             ^
   3277 // CHECK-ERROR-NEXT: error: {{Invalid immediate for instruction|barrier operand out of range}}
   3278 // CHECK-ERROR-NEXT:         isb #16
   3279 // CHECK-ERROR-NEXT:             ^
   3280 
   3281         msr daifset, x4
   3282         msr spsel, #-1
   3283         msr spsel #-1
   3284         msr daifclr, #16
   3285 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   3286 // CHECK-ERROR-NEXT:         msr daifset, x4
   3287 // CHECK-ERROR-NEXT:                      ^
   3288 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   3289 // CHECK-ERROR-NEXT:         msr spsel, #-1
   3290 // CHECK-ERROR-NEXT:                    ^
   3291 // CHECK-ERROR-NEXT: error: {{expected comma before next operand|unexpected token in argument list}}
   3292 // CHECK-ERROR-NEXT:         msr spsel #-1
   3293 // CHECK-ERROR-NEXT:                   ^
   3294 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 15]
   3295 // CHECK-ERROR-NEXT:         msr daifclr, #16
   3296 // CHECK-ERROR-NEXT:                      ^
   3297 
   3298         sys #8, c1, c2, #7, x9
   3299         sys #3, c16, c2, #3, x10
   3300         sys #2, c11, c16, #5
   3301         sys #4, c9, c8, #8, xzr
   3302         sysl x11, #8, c1, c2, #7
   3303         sysl x13, #3, c16, c2, #3
   3304         sysl x9, #2, c11, c16, #5
   3305         sysl x4, #4, c9, c8, #8
   3306 // CHECK-ERROR-NEXT: error:  {{expected|immediate must be an}} integer in range [0, 7]
   3307 // CHECK-ERROR-NEXT:         sys #8, c1, c2, #7, x9
   3308 // CHECK-ERROR-NEXT:             ^
   3309 // CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
   3310 // CHECK-ERROR-NEXT:         sys #3, c16, c2, #3, x10
   3311 // CHECK-ERROR-NEXT:                 ^
   3312 // CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
   3313 // CHECK-ERROR-NEXT:         sys #2, c11, c16, #5
   3314 // CHECK-ERROR-NEXT:                      ^
   3315 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 7]
   3316 // CHECK-ERROR-NEXT:         sys #4, c9, c8, #8, xzr
   3317 // CHECK-ERROR-NEXT:                         ^
   3318 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 7]
   3319 // CHECK-ERROR-NEXT:         sysl x11, #8, c1, c2, #7
   3320 // CHECK-ERROR-NEXT:                   ^
   3321 // CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
   3322 // CHECK-ERROR-NEXT:         sysl x13, #3, c16, c2, #3
   3323 // CHECK-ERROR-NEXT:                       ^
   3324 // CHECK-ERROR-NEXT: error: Expected cN operand where 0 <= N <= 15
   3325 // CHECK-ERROR-NEXT:         sysl x9, #2, c11, c16, #5
   3326 // CHECK-ERROR-NEXT:                           ^
   3327 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 7]
   3328 // CHECK-ERROR-NEXT:         sysl x4, #4, c9, c8, #8
   3329 // CHECK-ERROR-NEXT:                              ^
   3330 
   3331         ic ialluis, x2
   3332         ic allu, x7
   3333         ic ivau
   3334 // CHECK-ERROR-NEXT: error: specified {{IC|ic}} op does not use a register
   3335 // CHECK-ERROR-NEXT:         ic ialluis, x2
   3336 // CHECK-ERROR-NEXT:                     ^
   3337 // CHECK-ERROR-AARCH64-NEXT: error: operand specifier not recognised
   3338 // CHECK-ERROR-ARM64-NEXT: error: invalid operand for IC instruction
   3339 // CHECK-ERROR-NEXT:         ic allu, x7
   3340 // CHECK-ERROR-NEXT:            ^
   3341 // CHECK-ERROR-NEXT: error: specified {{IC|ic}} op requires a register
   3342 // CHECK-ERROR-NEXT:         ic ivau
   3343 // CHECK-ERROR-NEXT:            ^
   3344 
   3345         tlbi IPAS2E1IS
   3346         tlbi IPAS2LE1IS
   3347         tlbi VMALLE1IS, x12
   3348         tlbi ALLE2IS, x11
   3349         tlbi ALLE3IS, x20
   3350         tlbi VAE1IS
   3351         tlbi VAE2IS
   3352         tlbi VAE3IS
   3353         tlbi ASIDE1IS
   3354         tlbi VAAE1IS
   3355         tlbi ALLE1IS, x0
   3356         tlbi VALE1IS
   3357         tlbi VALE2IS
   3358         tlbi VALE3IS
   3359         tlbi VMALLS12E1IS, xzr
   3360         tlbi VAALE1IS
   3361         tlbi IPAS2E1
   3362         tlbi IPAS2LE1
   3363         tlbi VMALLE1, x9
   3364         tlbi ALLE2, x10
   3365         tlbi ALLE3, x11
   3366         tlbi VAE1
   3367         tlbi VAE2
   3368         tlbi VAE3
   3369         tlbi ASIDE1
   3370         tlbi VAAE1
   3371         tlbi ALLE1, x25
   3372         tlbi VALE1
   3373         tlbi VALE2
   3374         tlbi VALE3
   3375         tlbi VMALLS12E1, x15
   3376         tlbi VAALE1
   3377 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3378 // CHECK-ERROR-NEXT:         tlbi IPAS2E1IS
   3379 // CHECK-ERROR-NEXT:              ^
   3380 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3381 // CHECK-ERROR-NEXT:         tlbi IPAS2LE1IS
   3382 // CHECK-ERROR-NEXT:              ^
   3383 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3384 // CHECK-ERROR-NEXT:         tlbi VMALLE1IS, x12
   3385 // CHECK-ERROR-NEXT:                         ^
   3386 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3387 // CHECK-ERROR-NEXT:         tlbi ALLE2IS, x11
   3388 // CHECK-ERROR-NEXT:                       ^
   3389 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3390 // CHECK-ERROR-NEXT:         tlbi ALLE3IS, x20
   3391 // CHECK-ERROR-NEXT:                       ^
   3392 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3393 // CHECK-ERROR-NEXT:         tlbi VAE1IS
   3394 // CHECK-ERROR-NEXT:              ^
   3395 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3396 // CHECK-ERROR-NEXT:         tlbi VAE2IS
   3397 // CHECK-ERROR-NEXT:              ^
   3398 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3399 // CHECK-ERROR-NEXT:         tlbi VAE3IS
   3400 // CHECK-ERROR-NEXT:              ^
   3401 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3402 // CHECK-ERROR-NEXT:         tlbi ASIDE1IS
   3403 // CHECK-ERROR-NEXT:              ^
   3404 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3405 // CHECK-ERROR-NEXT:         tlbi VAAE1IS
   3406 // CHECK-ERROR-NEXT:              ^
   3407 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3408 // CHECK-ERROR-NEXT:         tlbi ALLE1IS, x0
   3409 // CHECK-ERROR-NEXT:                       ^
   3410 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3411 // CHECK-ERROR-NEXT:         tlbi VALE1IS
   3412 // CHECK-ERROR-NEXT:              ^
   3413 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3414 // CHECK-ERROR-NEXT:         tlbi VALE2IS
   3415 // CHECK-ERROR-NEXT:              ^
   3416 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3417 // CHECK-ERROR-NEXT:         tlbi VALE3IS
   3418 // CHECK-ERROR-NEXT:              ^
   3419 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3420 // CHECK-ERROR-NEXT:         tlbi VMALLS12E1IS, xzr
   3421 // CHECK-ERROR-NEXT:                            ^
   3422 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3423 // CHECK-ERROR-NEXT:         tlbi VAALE1IS
   3424 // CHECK-ERROR-NEXT:              ^
   3425 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3426 // CHECK-ERROR-NEXT:         tlbi IPAS2E1
   3427 // CHECK-ERROR-NEXT:              ^
   3428 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3429 // CHECK-ERROR-NEXT:         tlbi IPAS2LE1
   3430 // CHECK-ERROR-NEXT:              ^
   3431 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3432 // CHECK-ERROR-NEXT:         tlbi VMALLE1, x9
   3433 // CHECK-ERROR-NEXT:                       ^
   3434 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3435 // CHECK-ERROR-NEXT:         tlbi ALLE2, x10
   3436 // CHECK-ERROR-NEXT:                     ^
   3437 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3438 // CHECK-ERROR-NEXT:         tlbi ALLE3, x11
   3439 // CHECK-ERROR-NEXT:                     ^
   3440 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3441 // CHECK-ERROR-NEXT:         tlbi VAE1
   3442 // CHECK-ERROR-NEXT:              ^
   3443 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3444 // CHECK-ERROR-NEXT:         tlbi VAE2
   3445 // CHECK-ERROR-NEXT:              ^
   3446 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3447 // CHECK-ERROR-NEXT:         tlbi VAE3
   3448 // CHECK-ERROR-NEXT:              ^
   3449 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3450 // CHECK-ERROR-NEXT:         tlbi ASIDE1
   3451 // CHECK-ERROR-NEXT:              ^
   3452 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3453 // CHECK-ERROR-NEXT:         tlbi VAAE1
   3454 // CHECK-ERROR-NEXT:              ^
   3455 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3456 // CHECK-ERROR-NEXT:         tlbi ALLE1, x25
   3457 // CHECK-ERROR-NEXT:                     ^
   3458 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3459 // CHECK-ERROR-NEXT:         tlbi VALE1
   3460 // CHECK-ERROR-NEXT:              ^
   3461 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3462 // CHECK-ERROR-NEXT:         tlbi VALE2
   3463 // CHECK-ERROR-NEXT:              ^
   3464 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3465 // CHECK-ERROR-NEXT:         tlbi VALE3
   3466 // CHECK-ERROR-NEXT:              ^
   3467 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op does not use a register
   3468 // CHECK-ERROR-NEXT:         tlbi VMALLS12E1, x15
   3469 // CHECK-ERROR-NEXT:                          ^
   3470 // CHECK-ERROR-NEXT: error: specified {{TLBI|tlbi}} op requires a register
   3471 // CHECK-ERROR-NEXT:         tlbi VAALE1
   3472 // CHECK-ERROR-NEXT:              ^
   3473 
   3474 // For the MSR/MRS instructions, first make sure read-only and
   3475 // write-only registers actually are.
   3476         msr MDCCSR_EL0, x12
   3477         msr DBGDTRRX_EL0, x12
   3478         msr MDRAR_EL1, x12
   3479         msr OSLSR_EL1, x12
   3480         msr DBGAUTHSTATUS_EL1, x12
   3481         msr MIDR_EL1, x12
   3482         msr CCSIDR_EL1, x12
   3483         msr CLIDR_EL1, x12
   3484         msr CTR_EL0, x12
   3485         msr MPIDR_EL1, x12
   3486         msr REVIDR_EL1, x12
   3487         msr AIDR_EL1, x12
   3488         msr DCZID_EL0, x12
   3489         msr ID_PFR0_EL1, x12
   3490         msr ID_PFR1_EL1, x12
   3491         msr ID_DFR0_EL1, x12
   3492         msr ID_AFR0_EL1, x12
   3493         msr ID_MMFR0_EL1, x12
   3494         msr ID_MMFR1_EL1, x12
   3495         msr ID_MMFR2_EL1, x12
   3496         msr ID_MMFR3_EL1, x12
   3497         msr ID_MMFR4_EL1, x12
   3498         msr ID_ISAR0_EL1, x12
   3499         msr ID_ISAR1_EL1, x12
   3500         msr ID_ISAR2_EL1, x12
   3501         msr ID_ISAR3_EL1, x12
   3502         msr ID_ISAR4_EL1, x12
   3503         msr ID_ISAR5_EL1, x12
   3504         msr MVFR0_EL1, x12
   3505         msr MVFR1_EL1, x12
   3506         msr MVFR2_EL1, x12
   3507         msr ID_AA64PFR0_EL1, x12
   3508         msr ID_AA64PFR1_EL1, x12
   3509         msr ID_AA64DFR0_EL1, x12
   3510         msr ID_AA64DFR1_EL1, x12
   3511         msr ID_AA64AFR0_EL1, x12
   3512         msr ID_AA64AFR1_EL1, x12
   3513         msr ID_AA64ISAR0_EL1, x12
   3514         msr ID_AA64ISAR1_EL1, x12
   3515         msr ID_AA64MMFR0_EL1, x12
   3516         msr ID_AA64MMFR1_EL1, x12
   3517         msr PMCEID0_EL0, x12
   3518         msr PMCEID1_EL0, x12
   3519         msr RVBAR_EL1, x12
   3520         msr RVBAR_EL2, x12
   3521         msr RVBAR_EL3, x12
   3522         msr ISR_EL1, x12
   3523         msr CNTPCT_EL0, x12
   3524         msr CNTVCT_EL0, x12
   3525         msr PMEVCNTR31_EL0, x12
   3526         msr PMEVTYPER31_EL0, x12
   3527 // CHECK-ERROR: error: expected writable system register or pstate
   3528 // CHECK-ERROR-NEXT:         msr MDCCSR_EL0, x12
   3529 // CHECK-ERROR-NEXT:             ^
   3530 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3531 // CHECK-ERROR-NEXT:         msr DBGDTRRX_EL0, x12
   3532 // CHECK-ERROR-NEXT:             ^
   3533 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3534 // CHECK-ERROR-NEXT:         msr MDRAR_EL1, x12
   3535 // CHECK-ERROR-NEXT:             ^
   3536 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3537 // CHECK-ERROR-NEXT:         msr OSLSR_EL1, x12
   3538 // CHECK-ERROR-NEXT:             ^
   3539 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3540 // CHECK-ERROR-NEXT:         msr DBGAUTHSTATUS_EL1, x12
   3541 // CHECK-ERROR-NEXT:             ^
   3542 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3543 // CHECK-ERROR-NEXT:         msr MIDR_EL1, x12
   3544 // CHECK-ERROR-NEXT:             ^
   3545 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3546 // CHECK-ERROR-NEXT:         msr CCSIDR_EL1, x12
   3547 // CHECK-ERROR-NEXT:             ^
   3548 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3549 // CHECK-ERROR-NEXT:         msr CLIDR_EL1, x12
   3550 // CHECK-ERROR-NEXT:             ^
   3551 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3552 // CHECK-ERROR-NEXT:         msr CTR_EL0, x12
   3553 // CHECK-ERROR-NEXT:             ^
   3554 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3555 // CHECK-ERROR-NEXT:         msr MPIDR_EL1, x12
   3556 // CHECK-ERROR-NEXT:             ^
   3557 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3558 // CHECK-ERROR-NEXT:         msr REVIDR_EL1, x12
   3559 // CHECK-ERROR-NEXT:             ^
   3560 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3561 // CHECK-ERROR-NEXT:         msr AIDR_EL1, x12
   3562 // CHECK-ERROR-NEXT:             ^
   3563 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3564 // CHECK-ERROR-NEXT:         msr DCZID_EL0, x12
   3565 // CHECK-ERROR-NEXT:             ^
   3566 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3567 // CHECK-ERROR-NEXT:         msr ID_PFR0_EL1, x12
   3568 // CHECK-ERROR-NEXT:             ^
   3569 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3570 // CHECK-ERROR-NEXT:         msr ID_PFR1_EL1, x12
   3571 // CHECK-ERROR-NEXT:             ^
   3572 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3573 // CHECK-ERROR-NEXT:         msr ID_DFR0_EL1, x12
   3574 // CHECK-ERROR-NEXT:             ^
   3575 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3576 // CHECK-ERROR-NEXT:         msr ID_AFR0_EL1, x12
   3577 // CHECK-ERROR-NEXT:             ^
   3578 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3579 // CHECK-ERROR-NEXT:         msr ID_MMFR0_EL1, x12
   3580 // CHECK-ERROR-NEXT:             ^
   3581 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3582 // CHECK-ERROR-NEXT:         msr ID_MMFR1_EL1, x12
   3583 // CHECK-ERROR-NEXT:             ^
   3584 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3585 // CHECK-ERROR-NEXT:         msr ID_MMFR2_EL1, x12
   3586 // CHECK-ERROR-NEXT:             ^
   3587 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3588 // CHECK-ERROR-NEXT:         msr ID_MMFR3_EL1, x12
   3589 // CHECK-ERROR-NEXT:             ^
   3590 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3591 // CHECK-ERROR-NEXT:         msr ID_MMFR4_EL1, x12
   3592 // CHECK-ERROR-NEXT:             ^
   3593 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3594 // CHECK-ERROR-NEXT:         msr ID_ISAR0_EL1, x12
   3595 // CHECK-ERROR-NEXT:             ^
   3596 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3597 // CHECK-ERROR-NEXT:         msr ID_ISAR1_EL1, x12
   3598 // CHECK-ERROR-NEXT:             ^
   3599 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3600 // CHECK-ERROR-NEXT:         msr ID_ISAR2_EL1, x12
   3601 // CHECK-ERROR-NEXT:             ^
   3602 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3603 // CHECK-ERROR-NEXT:         msr ID_ISAR3_EL1, x12
   3604 // CHECK-ERROR-NEXT:             ^
   3605 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3606 // CHECK-ERROR-NEXT:         msr ID_ISAR4_EL1, x12
   3607 // CHECK-ERROR-NEXT:             ^
   3608 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3609 // CHECK-ERROR-NEXT:         msr ID_ISAR5_EL1, x12
   3610 // CHECK-ERROR-NEXT:             ^
   3611 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3612 // CHECK-ERROR-NEXT:         msr MVFR0_EL1, x12
   3613 // CHECK-ERROR-NEXT:             ^
   3614 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3615 // CHECK-ERROR-NEXT:         msr MVFR1_EL1, x12
   3616 // CHECK-ERROR-NEXT:             ^
   3617 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3618 // CHECK-ERROR-NEXT:         msr MVFR2_EL1, x12
   3619 // CHECK-ERROR-NEXT:             ^
   3620 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3621 // CHECK-ERROR-NEXT:         msr ID_AA64PFR0_EL1, x12
   3622 // CHECK-ERROR-NEXT:             ^
   3623 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3624 // CHECK-ERROR-NEXT:         msr ID_AA64PFR1_EL1, x12
   3625 // CHECK-ERROR-NEXT:             ^
   3626 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3627 // CHECK-ERROR-NEXT:         msr ID_AA64DFR0_EL1, x12
   3628 // CHECK-ERROR-NEXT:             ^
   3629 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3630 // CHECK-ERROR-NEXT:         msr ID_AA64DFR1_EL1, x12
   3631 // CHECK-ERROR-NEXT:             ^
   3632 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3633 // CHECK-ERROR-NEXT:         msr ID_AA64AFR0_EL1, x12
   3634 // CHECK-ERROR-NEXT:             ^
   3635 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3636 // CHECK-ERROR-NEXT:         msr ID_AA64AFR1_EL1, x12
   3637 // CHECK-ERROR-NEXT:             ^
   3638 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3639 // CHECK-ERROR-NEXT:         msr ID_AA64ISAR0_EL1, x12
   3640 // CHECK-ERROR-NEXT:             ^
   3641 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3642 // CHECK-ERROR-NEXT:         msr ID_AA64ISAR1_EL1, x12
   3643 // CHECK-ERROR-NEXT:             ^
   3644 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3645 // CHECK-ERROR-NEXT:         msr ID_AA64MMFR0_EL1, x12
   3646 // CHECK-ERROR-NEXT:             ^
   3647 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3648 // CHECK-ERROR-NEXT:         msr ID_AA64MMFR1_EL1, x12
   3649 // CHECK-ERROR-NEXT:             ^
   3650 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3651 // CHECK-ERROR-NEXT:         msr PMCEID0_EL0, x12
   3652 // CHECK-ERROR-NEXT:             ^
   3653 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3654 // CHECK-ERROR-NEXT:         msr PMCEID1_EL0, x12
   3655 // CHECK-ERROR-NEXT:             ^
   3656 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3657 // CHECK-ERROR-NEXT:         msr RVBAR_EL1, x12
   3658 // CHECK-ERROR-NEXT:             ^
   3659 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3660 // CHECK-ERROR-NEXT:         msr RVBAR_EL2, x12
   3661 // CHECK-ERROR-NEXT:             ^
   3662 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3663 // CHECK-ERROR-NEXT:         msr RVBAR_EL3, x12
   3664 // CHECK-ERROR-NEXT:             ^
   3665 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3666 // CHECK-ERROR-NEXT:         msr ISR_EL1, x12
   3667 // CHECK-ERROR-NEXT:             ^
   3668 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3669 // CHECK-ERROR-NEXT:         msr CNTPCT_EL0, x12
   3670 // CHECK-ERROR-NEXT:             ^
   3671 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3672 // CHECK-ERROR-NEXT:         msr CNTVCT_EL0, x12
   3673 // CHECK-ERROR-NEXT:             ^
   3674 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3675 // CHECK-ERROR-NEXT:         msr PMEVCNTR31_EL0, x12
   3676 // CHECK-ERROR-NEXT:             ^
   3677 // CHECK-ERROR-NEXT: error: expected writable system register or pstate
   3678 // CHECK-ERROR-NEXT:         msr PMEVTYPER31_EL0, x12
   3679 // CHECK-ERROR-NEXT:             ^
   3680 
   3681         mrs x9, DBGDTRTX_EL0
   3682         mrs x9, OSLAR_EL1
   3683         mrs x9, PMSWINC_EL0
   3684         mrs x9, PMEVCNTR31_EL0
   3685         mrs x9, PMEVTYPER31_EL0
   3686 // CHECK-ERROR: error: expected readable system register
   3687 // CHECK-ERROR-NEXT:         mrs x9, DBGDTRTX_EL0
   3688 // CHECK-ERROR-NEXT:                 ^
   3689 // CHECK-ERROR-NEXT: error: expected readable system register
   3690 // CHECK-ERROR-NEXT:         mrs x9, OSLAR_EL1
   3691 // CHECK-ERROR-NEXT:                 ^
   3692 // CHECK-ERROR-NEXT: error: expected readable system register
   3693 // CHECK-ERROR-NEXT:         mrs x9, PMSWINC_EL0
   3694 // CHECK-ERROR-NEXT:                 ^
   3695 // CHECK-ERROR-NEXT: error: expected readable system register
   3696 // CHECK-ERROR-NEXT:         mrs x9, PMEVCNTR31_EL0
   3697 // CHECK-ERROR-NEXT:                 ^
   3698 // CHECK-ERROR-NEXT: error: expected readable system register
   3699 // CHECK-ERROR-NEXT:         mrs x9, PMEVTYPER31_EL0
   3700 // CHECK-ERROR-NEXT:                 ^
   3701 
   3702 // Now check some invalid generic names
   3703         mrs x12, s3_8_c11_c13_2
   3704         mrs x19, s3_2_c15_c16_2
   3705         mrs x30, s3_2_c15_c1_8
   3706         mrs x4, s4_7_c15_c15_7
   3707         mrs x14, s3_7_c16_c15_7
   3708 // CHECK-ERROR-NEXT: error: expected readable system register
   3709 // CHECK-ERROR-NEXT:         mrs x12, s3_8_c11_c13_2
   3710 // CHECK-ERROR-NEXT:                  ^
   3711 // CHECK-ERROR-NEXT: error: expected readable system register
   3712 // CHECK-ERROR-NEXT:         mrs x19, s3_2_c15_c16_2
   3713 // CHECK-ERROR-NEXT:                  ^
   3714 // CHECK-ERROR-NEXT: error: expected readable system register
   3715 // CHECK-ERROR-NEXT:         mrs x30, s3_2_c15_c1_8
   3716 // CHECK-ERROR-NEXT:                  ^
   3717 // CHECK-ERROR-NEXT: error: expected readable system register
   3718 // CHECK-ERROR-NEXT:         mrs x4, s4_7_c15_c15_7
   3719 // CHECK-ERROR-NEXT:                 ^
   3720 // CHECK-ERROR-NEXT: error: expected readable system register
   3721 // CHECK-ERROR-NEXT:         mrs x14, s3_7_c16_c15_7
   3722 // CHECK-ERROR-NEXT:                  ^
   3723 
   3724 //------------------------------------------------------------------------------
   3725 // Test and branch (immediate)
   3726 //------------------------------------------------------------------------------
   3727 
   3728         tbz w3, #-1, addr
   3729         tbz w3, #32, nowhere
   3730         tbz x9, #-1, there
   3731         tbz x20, #64, dont
   3732 // CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
   3733 // CHECK-ERROR-NEXT:     tbz w3, #-1, addr
   3734 // CHECK-ERROR-NEXT:             ^
   3735 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   3736 // CHECK-ERROR-NEXT:        tbz w3, #32, nowhere
   3737 // CHECK-ERROR-NEXT:                ^
   3738 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   3739 // CHECK-ERROR-NEXT:        tbz x9, #-1, there
   3740 // CHECK-ERROR-NEXT:                ^
   3741 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   3742 // CHECK-ERROR-NEXT:        tbz x20, #64, dont
   3743 // CHECK-ERROR-NEXT:                 ^
   3744 
   3745         tbnz w3, #-1, addr
   3746         tbnz w3, #32, nowhere
   3747         tbnz x9, #-1, there
   3748         tbnz x20, #64, dont
   3749 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   3750 // CHECK-ERROR-NEXT:        tbnz w3, #-1, addr
   3751 // CHECK-ERROR-NEXT:                 ^
   3752 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
   3753 // CHECK-ERROR-NEXT:        tbnz w3, #32, nowhere
   3754 // CHECK-ERROR-NEXT:                 ^
   3755 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   3756 // CHECK-ERROR-NEXT:        tbnz x9, #-1, there
   3757 // CHECK-ERROR-NEXT:                 ^
   3758 // CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
   3759 // CHECK-ERROR-NEXT:        tbnz x20, #64, dont
   3760 
   3761 //------------------------------------------------------------------------------
   3762 // Unconditional branch (immediate)
   3763 //------------------------------------------------------------------------------
   3764 
   3765         b #134217728
   3766         b #-134217732
   3767         b #1
   3768 // CHECK-ERROR: error: expected label or encodable integer pc offset
   3769 // CHECK-ERROR-NEXT:         b #134217728
   3770 // CHECK-ERROR-NEXT:           ^
   3771 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   3772 // CHECK-ERROR-NEXT:         b #-134217732
   3773 // CHECK-ERROR-NEXT:           ^
   3774 // CHECK-ERROR-NEXT: error: expected label or encodable integer pc offset
   3775 // CHECK-ERROR-NEXT:         b #1
   3776 // CHECK-ERROR-NEXT:           ^
   3777 
   3778 //------------------------------------------------------------------------------
   3779 // Unconditional branch (register)
   3780 //------------------------------------------------------------------------------
   3781 
   3782         br w2
   3783         br sp
   3784 // CHECK-ERROR: error: invalid operand for instruction
   3785 // CHECK-ERROR-NEXT:         br w2
   3786 // CHECK-ERROR-NEXT:            ^
   3787 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   3788 // CHECK-ERROR-NEXT:         br sp
   3789 // CHECK-ERROR-NEXT:            ^
   3790 
   3791         //// These ones shouldn't allow any registers
   3792         eret x2
   3793         drps x2
   3794 // CHECK-ERROR: error: invalid operand for instruction
   3795 // CHECK-ERROR-NEXT:         eret x2
   3796 // CHECK-ERROR-NEXT:              ^
   3797 // CHECK-ERROR-NEXT: error: invalid operand for instruction
   3798 // CHECK-ERROR-NEXT:         drps x2
   3799 // CHECK-ERROR-NEXT:              ^
   3800 
   3801