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