PageRenderTime 63ms CodeModel.GetById 4ms app.highlight 47ms RepoModel.GetById 1ms app.codeStats 1ms

/test/MC/AArch64/basic-a64-diagnostics.s

http://github.com/earl/llvm-mirror
Assembly | 3893 lines | 3879 code | 14 blank | 0 comment | 9 complexity | 7a0d7fb06ab593b2178a9ef085589a76 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1// RUN: not llvm-mc -triple aarch64-none-linux-gnu < %s 2> %t
   2// RUN: FileCheck --check-prefix=CHECK-ERROR --check-prefix=CHECK-ERROR-ARM64 < %t %s
   3
   4//------------------------------------------------------------------------------
   5// Add/sub (extended register)
   6//------------------------------------------------------------------------------
   7
   8        // Mismatched final register and extend
   9        add x2, x3, x5, sxtb
  10        add x2, x4, w2, uxtx
  11        add x2, x4, w2, lsl #3
  12        add w5, w7, x9, sxtx
  13// CHECK-ERROR: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
  14// CHECK-ERROR:         add x2, x3, x5, sxtb
  15// CHECK-ERROR:                         ^
  16// CHECK-ERROR: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
  17// CHECK-ERROR:         add x2, x4, w2, uxtx
  18// CHECK-ERROR:                         ^
  19// CHECK-ERROR: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
  20// CHECK-ERROR:         add x2, x4, w2, lsl #3
  21// CHECK-ERROR:                         ^
  22// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
  23// CHECK-ERROR:         add w5, w7, x9, sxtx
  24// CHECK-ERROR:                     ^
  25
  26        // Out of range extends
  27        add x9, x10, w11, uxtb #-1
  28        add x3, x5, w7, uxtb #5
  29        sub x9, x15, x2, uxth #5
  30// CHECK-ERROR: error: expected integer shift amount
  31// CHECK-ERROR:         add x9, x10, w11, uxtb #-1
  32// CHECK-ERROR:                                 ^
  33// CHECK-ERROR: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
  34// CHECK-ERROR:         add x3, x5, w7, uxtb #5
  35// CHECK-ERROR:                         ^
  36// CHECK-ERROR: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
  37// CHECK-ERROR:         sub x9, x15, x2, uxth #5
  38// CHECK-ERROR:                          ^
  39
  40        // Wrong registers on normal variants
  41        add xzr, x3, x5, uxtx
  42        sub x3, xzr, w9, sxth #1
  43        add x1, x2, sp, uxtx
  44// CHECK-ERROR: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
  45// CHECK-ERROR:         add xzr, x3, x5, uxtx
  46// CHECK-ERROR:                          ^
  47// CHECK-ERROR: error: invalid operand for instruction
  48// CHECK-ERROR:         sub x3, xzr, w9, sxth #1
  49// CHECK-ERROR:                 ^
  50// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
  51// CHECK-ERROR:         add x1, x2, sp, uxtx
  52// CHECK-ERROR:                     ^
  53
  54        // Wrong registers on flag-setting variants
  55        adds sp, x3, w2, uxtb
  56        adds x3, xzr, x9, uxtx
  57        subs x2, x1, sp, uxtx
  58        adds x2, x1, sp, uxtb #2
  59// CHECK-ERROR: error: invalid operand for instruction
  60// CHECK-ERROR:         adds sp, x3, w2, uxtb
  61// CHECK-ERROR:              ^
  62// CHECK-ERROR: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
  63// CHECK-ERROR:         adds x3, xzr, x9, uxtx
  64// CHECK-ERROR:                           ^
  65// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
  66// CHECK-ERROR:         subs x2, x1, sp, uxtx
  67// CHECK-ERROR:                      ^
  68// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
  69// CHECK-ERROR:         adds x2, x1, sp, uxtb #2
  70// CHECK-ERROR:                      ^
  71
  72        // Amount not optional if lsl valid and used
  73        add sp, x5, x7, lsl
  74// CHECK-ERROR: error: expected #imm after shift specifier
  75// CHECK-ERROR:         add sp, x5, x7, lsl
  76// CHECK-ERROR:                             ^
  77
  78//------------------------------------------------------------------------------
  79// Add/sub (immediate)
  80//------------------------------------------------------------------------------
  81
  82// Out of range immediates: more than 12 bits
  83        add w4, w5, #-4097
  84        add w5, w6, #0x1000
  85        add w4, w5, #-4096, lsl #12
  86        add w5, w6, #0x1000, lsl #12
  87// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
  88// CHECK-ERROR-NEXT:         add w4, w5, #-4097
  89// CHECK-ERROR-NEXT:                     ^
  90// CHECK-ERROR-AARCH64-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
  91// CHECK-ERROR-AARCH64-NEXT:         add w5, w6, #0x1000
  92// CHECK-ERROR-AARCH64-NEXT:                     ^
  93// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
  94// CHECK-ERROR-NEXT:         add w4, w5, #-4096, lsl #12
  95// CHECK-ERROR-NEXT:                     ^
  96// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
  97// CHECK-ERROR-NEXT:         add w5, w6, #0x1000, lsl #12
  98// CHECK-ERROR-NEXT:                     ^
  99
 100// Only lsl #0 and lsl #12 are allowed
 101        add w2, w3, #0x1, lsl #1
 102        add w5, w17, #0xfff, lsl #13
 103        add w17, w20, #0x1000, lsl #12
 104        sub xsp, x34, #0x100, lsl #-1
 105// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
 106// CHECK-ERROR-NEXT:         add w2, w3, #0x1, lsl #1
 107// CHECK-ERROR-NEXT:                                ^
 108// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
 109// CHECK-ERROR-NEXT:         add w5, w17, #0xfff, lsl #13
 110// CHECK-ERROR-NEXT:                                   ^
 111// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
 112// CHECK-ERROR-NEXT:         add w17, w20, #0x1000, lsl #12
 113// CHECK-ERROR-NEXT:                       ^
 114// CHECK-ERROR-NEXT: error: only 'lsl #+N' valid after immediate
 115// CHECK-ERROR-NEXT:         sub xsp, x34, #0x100, lsl #-1
 116// CHECK-ERROR-NEXT:                                    ^
 117
 118// Incorrect registers (w31 doesn't exist at all, and 31 decodes to sp for these).
 119        add w31, w20, #1234
 120        add wzr, w20, #0x123
 121        add w20, wzr, #0x321
 122        add wzr, wzr, #0xfff
 123// CHECK-ERROR: error: invalid operand for instruction
 124// CHECK-ERROR-NEXT:         add w31, w20, #1234
 125// CHECK-ERROR-NEXT:             ^
 126// CHECK-ERROR-NEXT: error: invalid operand for instruction
 127// CHECK-ERROR-NEXT:         add wzr, w20, #0x123
 128// CHECK-ERROR-NEXT:             ^
 129// CHECK-ERROR-NEXT: error: invalid operand for instruction
 130// CHECK-ERROR-NEXT:         add w20, wzr, #0x321
 131// CHECK-ERROR-NEXT:                  ^
 132// CHECK-ERROR-NEXT: error: invalid operand for instruction
 133// CHECK-ERROR-NEXT:         add wzr, wzr, #0xfff
 134// CHECK-ERROR-NEXT:             ^
 135
 136// Mixed register classes
 137        add xsp, w2, #123
 138        sub w2, x30, #32
 139// CHECK-ERROR: error: invalid operand for instruction
 140// CHECK-ERROR-NEXT:         add xsp, w2, #123
 141// CHECK-ERROR-NEXT:             ^
 142// CHECK-ERROR-NEXT: error: invalid operand for instruction
 143// CHECK-ERROR-NEXT:         sub w2, x30, #32
 144// CHECK-ERROR-NEXT:                 ^
 145
 146// Out of range immediate
 147        adds w0, w5, #0x10000
 148// CHECK-ERROR-AARCH64: error: expected compatible register, symbol or integer in range [0, 4095]
 149// CHECK-ERROR-AARCH64-NEXT:         adds w0, w5, #0x10000
 150// CHECK-ERROR-AARCH64-NEXT:                      ^
 151
 152// Wn|WSP should be in second place
 153        adds w4, wzr, #0x123
 154// ...but wzr is the 31 destination
 155        subs wsp, w5, #123
 156        subs x5, xzr, #0x456, lsl #12
 157// CHECK-ERROR: error: invalid operand for instruction
 158// CHECK-ERROR-NEXT:         adds w4, wzr, #0x123
 159// CHECK-ERROR-NEXT:                  ^
 160// CHECK-ERROR-NEXT: error: invalid operand for instruction
 161// CHECK-ERROR-NEXT:         subs wsp, w5, #123
 162// CHECK-ERROR-NEXT:              ^
 163// CHECK-ERROR-NEXT: error: invalid operand for instruction
 164// CHECK-ERROR-NEXT:         subs x5, xzr, #0x456, lsl #12
 165// CHECK-ERROR-NEXT:                  ^
 166
 167        // MOV alias should not accept any fiddling
 168        mov x2, xsp, #123
 169        mov wsp, w27, #0xfff, lsl #12
 170// CHECK-ERROR: error: expected compatible register or logical immediate
 171// CHECK-ERROR-NEXT:         mov x2, xsp, #123
 172// CHECK-ERROR-NEXT:                 ^
 173// CHECK-ERROR-NEXT: error: invalid operand for instruction
 174// CHECK-ERROR-NEXT:         mov wsp, w27, #0xfff, lsl #12
 175// CHECK-ERROR-NEXT:                       ^
 176
 177        // A relocation should be provided for symbols
 178        add x3, x9, #variable
 179        add x3, x9, #variable-16
 180// CHECK-ERROR: error: expected compatible register, symbol or integer in range [0, 4095]
 181// CHECK-ERROR-NEXT:         add x3, x9, #variable
 182// CHECK-ERROR-NEXT:                      ^
 183// CHECK-ERROR-NEXT: error: expected compatible register, symbol or integer in range [0, 4095]
 184// CHECK-ERROR-NEXT:         add x3, x9, #variable-16
 185// CHECK-ERROR-NEXT:                 ^
 186
 187        // Relocation on a sub
 188        sub x1, x0, :lo12:loc
 189// CHECK-ERROR: error: invalid immediate expression
 190// CHECK-ERROR:         sub x1, x0, :lo12:loc
 191// CHECK-ERROR:                     ^
 192
 193
 194//------------------------------------------------------------------------------
 195// Add-subtract (shifted register)
 196//------------------------------------------------------------------------------
 197
 198        add wsp, w1, w2, lsr #3
 199        add x4, sp, x9, asr #5
 200        add x9, x10, x5, ror #3
 201// CHECK-ERROR: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 202// CHECK-ERROR-NEXT:         add wsp, w1, w2, lsr #3
 203// CHECK-ERROR-NEXT:                          ^
 204// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 205// CHECK-ERROR-NEXT:         add x4, sp, x9, asr #5
 206// CHECK-ERROR-NEXT:                         ^
 207// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 208// CHECK-ERROR-NEXT:         add x9, x10, x5, ror #3
 209// CHECK-ERROR-NEXT:                          ^
 210
 211        add w1, w2, w3, lsl #-1
 212        add w1, w2, w3, lsl #32
 213        add w1, w2, w3, lsr #-1
 214        add w1, w2, w3, lsr #32
 215        add w1, w2, w3, asr #-1
 216        add w1, w2, w3, asr #32
 217        add x1, x2, x3, lsl #-1
 218        add x1, x2, x3, lsl #64
 219        add x1, x2, x3, lsr #-1
 220        add x1, x2, x3, lsr #64
 221        add x1, x2, x3, asr #-1
 222        add x1, x2, x3, asr #64
 223// CHECK-ERROR: error: expected integer shift amount
 224// CHECK-ERROR-NEXT:         add w1, w2, w3, lsl #-1
 225// CHECK-ERROR-NEXT:                              ^
 226// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 227// CHECK-ERROR-NEXT:         add w1, w2, w3, lsl #32
 228// CHECK-ERROR-NEXT:                         ^
 229// CHECK-ERROR-NEXT: error: expected integer shift amount
 230// CHECK-ERROR-NEXT:         add w1, w2, w3, lsr #-1
 231// CHECK-ERROR-NEXT:                              ^
 232// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 233// CHECK-ERROR-NEXT:         add w1, w2, w3, lsr #32
 234// CHECK-ERROR-NEXT:                         ^
 235// CHECK-ERROR-NEXT: error: expected integer shift amount
 236// CHECK-ERROR-NEXT:         add w1, w2, w3, asr #-1
 237// CHECK-ERROR-NEXT:                              ^
 238// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 239// CHECK-ERROR-NEXT:         add w1, w2, w3, asr #32
 240// CHECK-ERROR-NEXT:                         ^
 241// CHECK-ERROR-NEXT: error: expected integer shift amount
 242// CHECK-ERROR-NEXT:         add x1, x2, x3, lsl #-1
 243// CHECK-ERROR-NEXT:                              ^
 244// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 245// CHECK-ERROR-NEXT:         add x1, x2, x3, lsl #64
 246// CHECK-ERROR-NEXT:                         ^
 247// CHECK-ERROR-NEXT: error: expected integer shift amount
 248// CHECK-ERROR-NEXT:         add x1, x2, x3, lsr #-1
 249// CHECK-ERROR-NEXT:                              ^
 250// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 251// CHECK-ERROR-NEXT:         add x1, x2, x3, lsr #64
 252// CHECK-ERROR-NEXT:                         ^
 253// CHECK-ERROR-NEXT: error: expected integer shift amount
 254// CHECK-ERROR-NEXT:         add x1, x2, x3, asr #-1
 255// CHECK-ERROR-NEXT:                              ^
 256// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 257// CHECK-ERROR-NEXT:         add x1, x2, x3, asr #64
 258// CHECK-ERROR-NEXT:                         ^
 259
 260        adds w1, w2, w3, lsl #-1
 261        adds w1, w2, w3, lsl #32
 262        adds w1, w2, w3, lsr #-1
 263        adds w1, w2, w3, lsr #32
 264        adds w1, w2, w3, asr #-1
 265        adds w1, w2, w3, asr #32
 266        adds x1, x2, x3, lsl #-1
 267        adds x1, x2, x3, lsl #64
 268        adds x1, x2, x3, lsr #-1
 269        adds x1, x2, x3, lsr #64
 270        adds x1, x2, x3, asr #-1
 271        adds x1, x2, x3, asr #64
 272// CHECK-ERROR: error: expected integer shift amount
 273// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsl #-1
 274// CHECK-ERROR-NEXT:                               ^
 275// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 276// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsl #32
 277// CHECK-ERROR-NEXT:                          ^
 278// CHECK-ERROR-NEXT: error: expected integer shift amount
 279// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsr #-1
 280// CHECK-ERROR-NEXT:                               ^
 281// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 282// CHECK-ERROR-NEXT:         adds w1, w2, w3, lsr #32
 283// CHECK-ERROR-NEXT:                          ^
 284// CHECK-ERROR-NEXT: error: expected integer shift amount
 285// CHECK-ERROR-NEXT:         adds w1, w2, w3, asr #-1
 286// CHECK-ERROR-NEXT:                               ^
 287// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 288// CHECK-ERROR-NEXT:         adds w1, w2, w3, asr #32
 289// CHECK-ERROR-NEXT:                          ^
 290// CHECK-ERROR-NEXT: error: expected integer shift amount
 291// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsl #-1
 292// CHECK-ERROR-NEXT:                               ^
 293// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 294// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsl #64
 295// CHECK-ERROR-NEXT:                          ^
 296// CHECK-ERROR-NEXT: error: expected integer shift amount
 297// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsr #-1
 298// CHECK-ERROR-NEXT:                               ^
 299// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 300// CHECK-ERROR-NEXT:         adds x1, x2, x3, lsr #64
 301// CHECK-ERROR-NEXT:                          ^
 302// CHECK-ERROR-NEXT: error: expected integer shift amount
 303// CHECK-ERROR-NEXT:         adds x1, x2, x3, asr #-1
 304// CHECK-ERROR-NEXT:                               ^
 305// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 306// CHECK-ERROR-NEXT:         adds x1, x2, x3, asr #64
 307// CHECK-ERROR-NEXT:                          ^
 308
 309        sub w1, w2, w3, lsl #-1
 310        sub w1, w2, w3, lsl #32
 311        sub w1, w2, w3, lsr #-1
 312        sub w1, w2, w3, lsr #32
 313        sub w1, w2, w3, asr #-1
 314        sub w1, w2, w3, asr #32
 315        sub x1, x2, x3, lsl #-1
 316        sub x1, x2, x3, lsl #64
 317        sub x1, x2, x3, lsr #-1
 318        sub x1, x2, x3, lsr #64
 319        sub x1, x2, x3, asr #-1
 320        sub x1, x2, x3, asr #64
 321// CHECK-ERROR: error: expected integer shift amount
 322// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsl #-1
 323// CHECK-ERROR-NEXT:                              ^
 324// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 325// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsl #32
 326// CHECK-ERROR-NEXT:                         ^
 327// CHECK-ERROR-NEXT: error: expected integer shift amount
 328// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsr #-1
 329// CHECK-ERROR-NEXT:                              ^
 330// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 331// CHECK-ERROR-NEXT:         sub w1, w2, w3, lsr #32
 332// CHECK-ERROR-NEXT:                         ^
 333// CHECK-ERROR-NEXT: error: expected integer shift amount
 334// CHECK-ERROR-NEXT:         sub w1, w2, w3, asr #-1
 335// CHECK-ERROR-NEXT:                              ^
 336// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 337// CHECK-ERROR-NEXT:         sub w1, w2, w3, asr #32
 338// CHECK-ERROR-NEXT:                         ^
 339// CHECK-ERROR-NEXT: error: expected integer shift amount
 340// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsl #-1
 341// CHECK-ERROR-NEXT:                              ^
 342// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 343// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsl #64
 344// CHECK-ERROR-NEXT:                         ^
 345// CHECK-ERROR-NEXT: error: expected integer shift amount
 346// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsr #-1
 347// CHECK-ERROR-NEXT:                              ^
 348// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 349// CHECK-ERROR-NEXT:         sub x1, x2, x3, lsr #64
 350// CHECK-ERROR-NEXT:                         ^
 351// CHECK-ERROR-NEXT: error: expected integer shift amount
 352// CHECK-ERROR-NEXT:         sub x1, x2, x3, asr #-1
 353// CHECK-ERROR-NEXT:                              ^
 354// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 355// CHECK-ERROR-NEXT:         sub x1, x2, x3, asr #64
 356// CHECK-ERROR-NEXT:                         ^
 357
 358        subs w1, w2, w3, lsl #-1
 359        subs w1, w2, w3, lsl #32
 360        subs w1, w2, w3, lsr #-1
 361        subs w1, w2, w3, lsr #32
 362        subs w1, w2, w3, asr #-1
 363        subs w1, w2, w3, asr #32
 364        subs x1, x2, x3, lsl #-1
 365        subs x1, x2, x3, lsl #64
 366        subs x1, x2, x3, lsr #-1
 367        subs x1, x2, x3, lsr #64
 368        subs x1, x2, x3, asr #-1
 369        subs x1, x2, x3, asr #64
 370// CHECK-ERROR: error: expected integer shift amount
 371// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsl #-1
 372// CHECK-ERROR-NEXT:                               ^
 373// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 374// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsl #32
 375// CHECK-ERROR-NEXT:                          ^
 376// CHECK-ERROR-NEXT: error: expected integer shift amount
 377// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsr #-1
 378// CHECK-ERROR-NEXT:                               ^
 379// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 380// CHECK-ERROR-NEXT:         subs w1, w2, w3, lsr #32
 381// CHECK-ERROR-NEXT:                          ^
 382// CHECK-ERROR-NEXT: error: expected integer shift amount
 383// CHECK-ERROR-NEXT:         subs w1, w2, w3, asr #-1
 384// CHECK-ERROR-NEXT:                               ^
 385// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 386// CHECK-ERROR-NEXT:         subs w1, w2, w3, asr #32
 387// CHECK-ERROR-NEXT:                          ^
 388// CHECK-ERROR-NEXT: error: expected integer shift amount
 389// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsl #-1
 390// CHECK-ERROR-NEXT:                               ^
 391// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 392// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsl #64
 393// CHECK-ERROR-NEXT:                          ^
 394// CHECK-ERROR-NEXT: error: expected integer shift amount
 395// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsr #-1
 396// CHECK-ERROR-NEXT:                               ^
 397// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 398// CHECK-ERROR-NEXT:         subs x1, x2, x3, lsr #64
 399// CHECK-ERROR-NEXT:                          ^
 400// CHECK-ERROR-NEXT: error: expected integer shift amount
 401// CHECK-ERROR-NEXT:         subs x1, x2, x3, asr #-1
 402// CHECK-ERROR-NEXT:                               ^
 403// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 404// CHECK-ERROR-NEXT:         subs x1, x2, x3, asr #64
 405// CHECK-ERROR-NEXT:                          ^
 406
 407        cmn w9, w10, lsl #-1
 408        cmn w9, w10, lsl #32
 409        cmn w11, w12, lsr #-1
 410        cmn w11, w12, lsr #32
 411        cmn w19, wzr, asr #-1
 412        cmn wzr, wzr, asr #32
 413        cmn x9, x10, lsl #-1
 414        cmn x9, x10, lsl #64
 415        cmn x11, x12, lsr #-1
 416        cmn x11, x12, lsr #64
 417        cmn x19, xzr, asr #-1
 418        cmn xzr, xzr, asr #64
 419// CHECK-ERROR: error: expected integer shift amount
 420// CHECK-ERROR-NEXT:         cmn w9, w10, lsl #-1
 421// CHECK-ERROR-NEXT:                           ^
 422// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 423// CHECK-ERROR-NEXT:         cmn w9, w10, lsl #32
 424// CHECK-ERROR-NEXT:                      ^
 425// CHECK-ERROR-NEXT: error: expected integer shift amount
 426// CHECK-ERROR-NEXT:         cmn w11, w12, lsr #-1
 427// CHECK-ERROR-NEXT:                            ^
 428// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 429// CHECK-ERROR-NEXT:         cmn w11, w12, lsr #32
 430// CHECK-ERROR-NEXT:                       ^
 431// CHECK-ERROR-NEXT: error: expected integer shift amount
 432// CHECK-ERROR-NEXT:         cmn w19, wzr, asr #-1
 433// CHECK-ERROR-NEXT:                            ^
 434// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 435// CHECK-ERROR-NEXT:         cmn wzr, wzr, asr #32
 436// CHECK-ERROR-NEXT:                       ^
 437// CHECK-ERROR-NEXT: error: expected integer shift amount
 438// CHECK-ERROR-NEXT:         cmn x9, x10, lsl #-1
 439// CHECK-ERROR-NEXT:                           ^
 440// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 441// CHECK-ERROR-NEXT:         cmn x9, x10, lsl #64
 442// CHECK-ERROR-NEXT:                      ^
 443// CHECK-ERROR-NEXT: error: expected integer shift amount
 444// CHECK-ERROR-NEXT:         cmn x11, x12, lsr #-1
 445// CHECK-ERROR-NEXT:                            ^
 446// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 447// CHECK-ERROR-NEXT:         cmn x11, x12, lsr #64
 448// CHECK-ERROR-NEXT:                       ^
 449// CHECK-ERROR-NEXT: error: expected integer shift amount
 450// CHECK-ERROR-NEXT:         cmn x19, xzr, asr #-1
 451// CHECK-ERROR-NEXT:                            ^
 452// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 453// CHECK-ERROR-NEXT:         cmn xzr, xzr, asr #64
 454// CHECK-ERROR-NEXT:                       ^
 455
 456        cmp w9, w10, lsl #-1
 457        cmp w9, w10, lsl #32
 458        cmp w11, w12, lsr #-1
 459        cmp w11, w12, lsr #32
 460        cmp w19, wzr, asr #-1
 461        cmp wzr, wzr, asr #32
 462        cmp x9, x10, lsl #-1
 463        cmp x9, x10, lsl #64
 464        cmp x11, x12, lsr #-1
 465        cmp x11, x12, lsr #64
 466        cmp x19, xzr, asr #-1
 467        cmp xzr, xzr, asr #64
 468// CHECK-ERROR: error: expected integer shift amount
 469// CHECK-ERROR-NEXT:         cmp w9, w10, lsl #-1
 470// CHECK-ERROR-NEXT:                           ^
 471// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 472// CHECK-ERROR-NEXT:         cmp w9, w10, lsl #32
 473// CHECK-ERROR-NEXT:                      ^
 474// CHECK-ERROR-NEXT: error: expected integer shift amount
 475// CHECK-ERROR-NEXT:         cmp w11, w12, lsr #-1
 476// CHECK-ERROR-NEXT:                            ^
 477// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 478// CHECK-ERROR-NEXT:         cmp w11, w12, lsr #32
 479// CHECK-ERROR-NEXT:                       ^
 480// CHECK-ERROR-NEXT: error: expected integer shift amount
 481// CHECK-ERROR-NEXT:         cmp w19, wzr, asr #-1
 482// CHECK-ERROR-NEXT:                            ^
 483// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 484// CHECK-ERROR-NEXT:         cmp wzr, wzr, asr #32
 485// CHECK-ERROR-NEXT:                       ^
 486// CHECK-ERROR-NEXT: error: expected integer shift amount
 487// CHECK-ERROR-NEXT:         cmp x9, x10, lsl #-1
 488// CHECK-ERROR-NEXT:                           ^
 489// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 490// CHECK-ERROR-NEXT:         cmp x9, x10, lsl #64
 491// CHECK-ERROR-NEXT:                      ^
 492// CHECK-ERROR-NEXT: error: expected integer shift amount
 493// CHECK-ERROR-NEXT:         cmp x11, x12, lsr #-1
 494// CHECK-ERROR-NEXT:                            ^
 495// CHECK-ERROR-NEXT: error: expected 'sxtx' 'uxtx' or 'lsl' with optional integer in range [0, 4]
 496// CHECK-ERROR-NEXT:         cmp x11, x12, lsr #64
 497// CHECK-ERROR-NEXT:                       ^
 498// CHECK-ERROR-NEXT: error: expected integer shift amount
 499// CHECK-ERROR-NEXT:         cmp x19, xzr, asr #-1
 500// CHECK-ERROR-NEXT:                            ^
 501// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 502// CHECK-ERROR-NEXT:         cmp xzr, xzr, asr #64
 503// CHECK-ERROR-NEXT:                       ^
 504
 505        neg w9, w10, lsl #-1
 506        neg w9, w10, lsl #32
 507        neg w11, w12, lsr #-1
 508        neg w11, w12, lsr #32
 509        neg w19, wzr, asr #-1
 510        neg wzr, wzr, asr #32
 511        neg x9, x10, lsl #-1
 512        neg x9, x10, lsl #64
 513        neg x11, x12, lsr #-1
 514        neg x11, x12, lsr #64
 515        neg x19, xzr, asr #-1
 516        neg xzr, xzr, asr #64
 517// CHECK-ERROR: error: expected integer shift amount
 518// CHECK-ERROR-NEXT:         neg w9, w10, lsl #-1
 519// CHECK-ERROR-NEXT:                           ^
 520// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 521// CHECK-ERROR-NEXT:         neg w9, w10, lsl #32
 522// CHECK-ERROR-NEXT:                      ^
 523// CHECK-ERROR-NEXT: error: expected integer shift amount
 524// CHECK-ERROR-NEXT:         neg w11, w12, lsr #-1
 525// CHECK-ERROR-NEXT:                            ^
 526// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 527// CHECK-ERROR-NEXT:         neg w11, w12, lsr #32
 528// CHECK-ERROR-NEXT:                       ^
 529// CHECK-ERROR-NEXT: error: expected integer shift amount
 530// CHECK-ERROR-NEXT:         neg w19, wzr, asr #-1
 531// CHECK-ERROR-NEXT:                            ^
 532// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 533// CHECK-ERROR-NEXT:         neg wzr, wzr, asr #32
 534// CHECK-ERROR-NEXT:                       ^
 535// CHECK-ERROR-NEXT: error: expected integer shift amount
 536// CHECK-ERROR-NEXT:         neg x9, x10, lsl #-1
 537// CHECK-ERROR-NEXT:                           ^
 538// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 539// CHECK-ERROR-NEXT:         neg x9, x10, lsl #64
 540// CHECK-ERROR-NEXT:                      ^
 541// CHECK-ERROR-NEXT: error: expected integer shift amount
 542// CHECK-ERROR-NEXT:         neg x11, x12, lsr #-1
 543// CHECK-ERROR-NEXT:                            ^
 544// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 545// CHECK-ERROR-NEXT:         neg x11, x12, lsr #64
 546// CHECK-ERROR-NEXT:                       ^
 547// CHECK-ERROR-NEXT: error: expected integer shift amount
 548// CHECK-ERROR-NEXT:         neg x19, xzr, asr #-1
 549// CHECK-ERROR-NEXT:                            ^
 550// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 551// CHECK-ERROR-NEXT:         neg xzr, xzr, asr #64
 552// CHECK-ERROR-NEXT:                       ^
 553
 554        negs w9, w10, lsl #-1
 555        negs w9, w10, lsl #32
 556        negs w11, w12, lsr #-1
 557        negs w11, w12, lsr #32
 558        negs w19, wzr, asr #-1
 559        negs wzr, wzr, asr #32
 560        negs x9, x10, lsl #-1
 561        negs x9, x10, lsl #64
 562        negs x11, x12, lsr #-1
 563        negs x11, x12, lsr #64
 564        negs x19, xzr, asr #-1
 565        negs xzr, xzr, asr #64
 566// CHECK-ERROR: error: expected integer shift amount
 567// CHECK-ERROR-NEXT:         negs w9, w10, lsl #-1
 568// CHECK-ERROR-NEXT:                            ^
 569// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 570// CHECK-ERROR-NEXT:         negs w9, w10, lsl #32
 571// CHECK-ERROR-NEXT:                       ^
 572// CHECK-ERROR-NEXT: error: expected integer shift amount
 573// CHECK-ERROR-NEXT:         negs w11, w12, lsr #-1
 574// CHECK-ERROR-NEXT:                             ^
 575// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 576// CHECK-ERROR-NEXT:         negs w11, w12, lsr #32
 577// CHECK-ERROR-NEXT:                        ^
 578// CHECK-ERROR-NEXT: error: expected integer shift amount
 579// CHECK-ERROR-NEXT:         negs w19, wzr, asr #-1
 580// CHECK-ERROR-NEXT:                             ^
 581// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 31]
 582// CHECK-ERROR-NEXT:         negs wzr, wzr, asr #32
 583// CHECK-ERROR-NEXT:                        ^
 584// CHECK-ERROR-NEXT: error: expected integer shift amount
 585// CHECK-ERROR-NEXT:         negs x9, x10, lsl #-1
 586// CHECK-ERROR-NEXT:                            ^
 587// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 588// CHECK-ERROR-NEXT:         negs x9, x10, lsl #64
 589// CHECK-ERROR-NEXT:                       ^
 590// CHECK-ERROR-NEXT: error: expected integer shift amount
 591// CHECK-ERROR-NEXT:         negs x11, x12, lsr #-1
 592// CHECK-ERROR-NEXT:                             ^
 593// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 594// CHECK-ERROR-NEXT:         negs x11, x12, lsr #64
 595// CHECK-ERROR-NEXT:                        ^
 596// CHECK-ERROR-NEXT: error: expected integer shift amount
 597// CHECK-ERROR-NEXT:         negs x19, xzr, asr #-1
 598// CHECK-ERROR-NEXT:                             ^
 599// CHECK-ERROR-NEXT: error: expected 'lsl', 'lsr' or 'asr' with optional integer in range [0, 63]
 600// CHECK-ERROR-NEXT:         negs xzr, xzr, asr #64
 601// CHECK-ERROR-NEXT:                        ^
 602
 603//------------------------------------------------------------------------------
 604// Add-subtract (shifted register)
 605//------------------------------------------------------------------------------
 606
 607        adc wsp, w3, w5
 608        adc w1, wsp, w2
 609        adc w0, w10, wsp
 610// CHECK-ERROR: error: invalid operand for instruction
 611// CHECK-ERROR-NEXT:        adc wsp, w3, w5
 612// CHECK-ERROR-NEXT:            ^
 613// CHECK-ERROR-NEXT: error: invalid operand for instruction
 614// CHECK-ERROR-NEXT:         adc w1, wsp, w2
 615// CHECK-ERROR-NEXT:                 ^
 616// CHECK-ERROR-NEXT: error: invalid operand for instruction
 617// CHECK-ERROR-NEXT:         adc w0, w10, wsp
 618// CHECK-ERROR-NEXT:                      ^
 619
 620        adc sp, x3, x5
 621        adc x1, sp, x2
 622        adc x0, x10, sp
 623// CHECK-ERROR: error: invalid operand for instruction
 624// CHECK-ERROR-NEXT:         adc sp, x3, x5
 625// CHECK-ERROR-NEXT:             ^
 626// CHECK-ERROR-NEXT: error: invalid operand for instruction
 627// CHECK-ERROR-NEXT:         adc x1, sp, x2
 628// CHECK-ERROR-NEXT:                 ^
 629// CHECK-ERROR-NEXT: error: invalid operand for instruction
 630// CHECK-ERROR-NEXT:         adc x0, x10, sp
 631// CHECK-ERROR-NEXT:                      ^
 632
 633        adcs wsp, w3, w5
 634        adcs w1, wsp, w2
 635        adcs w0, w10, wsp
 636// CHECK-ERROR: error: invalid operand for instruction
 637// CHECK-ERROR-NEXT:         adcs wsp, w3, w5
 638// CHECK-ERROR-NEXT:              ^
 639// CHECK-ERROR-NEXT: error: invalid operand for instruction
 640// CHECK-ERROR-NEXT:         adcs w1, wsp, w2
 641// CHECK-ERROR-NEXT:                  ^
 642// CHECK-ERROR-NEXT: error: invalid operand for instruction
 643// CHECK-ERROR-NEXT:         adcs w0, w10, wsp
 644// CHECK-ERROR-NEXT:                       ^
 645
 646        adcs sp, x3, x5
 647        adcs x1, sp, x2
 648        adcs x0, x10, sp
 649// CHECK-ERROR: error: invalid operand for instruction
 650// CHECK-ERROR-NEXT:         adcs sp, x3, x5
 651// CHECK-ERROR-NEXT:              ^
 652// CHECK-ERROR-NEXT: error: invalid operand for instruction
 653// CHECK-ERROR-NEXT:         adcs x1, sp, x2
 654// CHECK-ERROR-NEXT:                  ^
 655// CHECK-ERROR-NEXT: error: invalid operand for instruction
 656// CHECK-ERROR-NEXT:         adcs x0, x10, sp
 657// CHECK-ERROR-NEXT:                       ^
 658
 659        sbc wsp, w3, w5
 660        sbc w1, wsp, w2
 661        sbc w0, w10, wsp
 662// CHECK-ERROR: error: invalid operand for instruction
 663// CHECK-ERROR-NEXT:         sbc wsp, w3, w5
 664// CHECK-ERROR-NEXT:             ^
 665// CHECK-ERROR-NEXT: error: invalid operand for instruction
 666// CHECK-ERROR-NEXT:         sbc w1, wsp, w2
 667// CHECK-ERROR-NEXT:                 ^
 668// CHECK-ERROR-NEXT: error: invalid operand for instruction
 669// CHECK-ERROR-NEXT:         sbc w0, w10, wsp
 670// CHECK-ERROR-NEXT:                      ^
 671
 672        sbc sp, x3, x5
 673        sbc x1, sp, x2
 674        sbc x0, x10, sp
 675// CHECK-ERROR: error: invalid operand for instruction
 676// CHECK-ERROR-NEXT:         sbc sp, x3, x5
 677// CHECK-ERROR-NEXT:             ^
 678// CHECK-ERROR-NEXT: error: invalid operand for instruction
 679// CHECK-ERROR-NEXT:         sbc x1, sp, x2
 680// CHECK-ERROR-NEXT:                 ^
 681// CHECK-ERROR-NEXT: error: invalid operand for instruction
 682// CHECK-ERROR-NEXT:         sbc x0, x10, sp
 683// CHECK-ERROR-NEXT:                      ^
 684
 685        sbcs wsp, w3, w5
 686        sbcs w1, wsp, w2
 687        sbcs w0, w10, wsp
 688// CHECK-ERROR: error: invalid operand for instruction
 689// CHECK-ERROR-NEXT:         sbcs wsp, w3, w5
 690// CHECK-ERROR-NEXT:              ^
 691// CHECK-ERROR-NEXT: error: invalid operand for instruction
 692// CHECK-ERROR-NEXT:         sbcs w1, wsp, w2
 693// CHECK-ERROR-NEXT:                  ^
 694// CHECK-ERROR-NEXT: error: invalid operand for instruction
 695// CHECK-ERROR-NEXT:         sbcs w0, w10, wsp
 696// CHECK-ERROR-NEXT:                       ^
 697
 698        sbcs sp, x3, x5
 699        sbcs x1, sp, x2
 700        sbcs x0, x10, sp
 701// CHECK-ERROR: error: invalid operand for instruction
 702// CHECK-ERROR-NEXT:         sbcs sp, x3, x5
 703// CHECK-ERROR-NEXT:              ^
 704// CHECK-ERROR-NEXT: error: invalid operand for instruction
 705// CHECK-ERROR-NEXT:         sbcs x1, sp, x2
 706// CHECK-ERROR-NEXT:                  ^
 707// CHECK-ERROR-NEXT: error: invalid operand for instruction
 708// CHECK-ERROR-NEXT:         sbcs x0, x10, sp
 709// CHECK-ERROR-NEXT:                       ^
 710
 711        ngc wsp, w3
 712        ngc w9, wsp
 713        ngc sp, x9
 714        ngc x2, sp
 715// CHECK-ERROR: error: invalid operand for instruction
 716// CHECK-ERROR-NEXT:         ngc wsp, w3
 717// CHECK-ERROR-NEXT:             ^
 718// CHECK-ERROR-NEXT: error: invalid operand for instruction
 719// CHECK-ERROR-NEXT:         ngc w9, wsp
 720// CHECK-ERROR-NEXT:                 ^
 721// CHECK-ERROR-NEXT: error: invalid operand for instruction
 722// CHECK-ERROR-NEXT:         ngc sp, x9
 723// CHECK-ERROR-NEXT:             ^
 724// CHECK-ERROR-NEXT: error: invalid operand for instruction
 725// CHECK-ERROR-NEXT:         ngc x2, sp
 726// CHECK-ERROR-NEXT:                 ^
 727
 728        ngcs wsp, w3
 729        ngcs w9, wsp
 730        ngcs sp, x9
 731        ngcs x2, sp
 732// CHECK-ERROR: error: invalid operand for instruction
 733// CHECK-ERROR-NEXT:         ngcs wsp, w3
 734// CHECK-ERROR-NEXT:              ^
 735// CHECK-ERROR-NEXT: error: invalid operand for instruction
 736// CHECK-ERROR-NEXT:         ngcs w9, wsp
 737// CHECK-ERROR-NEXT:                  ^
 738// CHECK-ERROR-NEXT: error: invalid operand for instruction
 739// CHECK-ERROR-NEXT:         ngcs sp, x9
 740// CHECK-ERROR-NEXT:              ^
 741// CHECK-ERROR-NEXT: error: invalid operand for instruction
 742// CHECK-ERROR-NEXT:         ngcs x2, sp
 743// CHECK-ERROR-NEXT:                  ^
 744
 745//------------------------------------------------------------------------------
 746// Logical (immediates)
 747//------------------------------------------------------------------------------
 748
 749        and w2, w3, #4294967296
 750        eor w2, w3, #4294967296
 751        orr w2, w3, #4294967296
 752        ands w2, w3, #4294967296
 753// CHECK-ERROR: error: expected compatible register or logical immediate
 754// CHECK-ERROR-NEXT:         and w2, w3, #4294967296
 755// CHECK-ERROR-NEXT:                     ^
 756// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
 757// CHECK-ERROR-NEXT:         eor w2, w3, #4294967296
 758// CHECK-ERROR-NEXT:                     ^
 759// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
 760// CHECK-ERROR-NEXT:         orr w2, w3, #4294967296
 761// CHECK-ERROR-NEXT:                     ^
 762// CHECK-ERROR-NEXT: error: expected compatible register or logical immediate
 763// CHECK-ERROR-NEXT:         ands w2, w3, #4294967296
 764// CHECK-ERROR-NEXT:                      ^
 765
 766//------------------------------------------------------------------------------
 767// Bitfield
 768//------------------------------------------------------------------------------
 769
 770        sbfm x3, w13, #0, #0
 771        sbfm w12, x9, #0, #0
 772        sbfm sp, x3, #3, #5
 773        sbfm w3, wsp, #1, #9
 774        sbfm x9, x5, #-1, #0
 775        sbfm x9, x5, #0, #-1
 776// CHECK-ERROR: error: invalid operand for instruction
 777// CHECK-ERROR-NEXT:         sbfm x3, w13, #0, #0
 778// CHECK-ERROR-NEXT:                  ^
 779// CHECK-ERROR-NEXT: error: invalid operand for instruction
 780// CHECK-ERROR-NEXT:         sbfm w12, x9, #0, #0
 781// CHECK-ERROR-NEXT:                   ^
 782// CHECK-ERROR-NEXT: error: invalid operand for instruction
 783// CHECK-ERROR-NEXT:         sbfm sp, x3, #3, #5
 784// CHECK-ERROR-NEXT:              ^
 785// CHECK-ERROR-NEXT: error: invalid operand for instruction
 786// CHECK-ERROR-NEXT:         sbfm w3, wsp, #1, #9
 787// CHECK-ERROR-NEXT:                  ^
 788// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 789// CHECK-ERROR-NEXT:         sbfm x9, x5, #-1, #0
 790// CHECK-ERROR-NEXT:                      ^
 791// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 792// CHECK-ERROR-NEXT:         sbfm x9, x5, #0, #-1
 793// CHECK-ERROR-NEXT:                          ^
 794
 795        sbfm w3, w5, #32, #1
 796        sbfm w7, w11, #19, #32
 797        sbfm x29, x30, #64, #0
 798        sbfm x10, x20, #63, #64
 799// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
 800// CHECK-ERROR-NEXT:         sbfm w3, w5, #32, #1
 801// CHECK-ERROR-NEXT:                      ^
 802// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 803// CHECK-ERROR-NEXT:         sbfm w7, w11, #19, #32
 804// CHECK-ERROR-NEXT:                            ^
 805// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 806// CHECK-ERROR-NEXT:         sbfm x29, x30, #64, #0
 807// CHECK-ERROR-NEXT:                        ^
 808// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 809// CHECK-ERROR-NEXT:         sbfm x10, x20, #63, #64
 810// CHECK-ERROR-NEXT:                             ^
 811
 812        ubfm w3, w5, #32, #1
 813        ubfm w7, w11, #19, #32
 814        ubfm x29, x30, #64, #0
 815        ubfm x10, x20, #63, #64
 816// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
 817// CHECK-ERROR-NEXT:         ubfm w3, w5, #32, #1
 818// CHECK-ERROR-NEXT:                      ^
 819// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 820// CHECK-ERROR-NEXT:         ubfm w7, w11, #19, #32
 821// CHECK-ERROR-NEXT:                            ^
 822// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 823// CHECK-ERROR-NEXT:         ubfm x29, x30, #64, #0
 824// CHECK-ERROR-NEXT:                        ^
 825// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 826// CHECK-ERROR-NEXT:         ubfm x10, x20, #63, #64
 827// CHECK-ERROR-NEXT:                             ^
 828
 829        bfm w3, w5, #32, #1
 830        bfm w7, w11, #19, #32
 831        bfm x29, x30, #64, #0
 832        bfm x10, x20, #63, #64
 833// CHECK-ERROR: error: {{expected|immediate must be an}} integer in range [0, 31]
 834// CHECK-ERROR-NEXT:         bfm w3, w5, #32, #1
 835// CHECK-ERROR-NEXT:                      ^
 836// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 837// CHECK-ERROR-NEXT:         bfm w7, w11, #19, #32
 838// CHECK-ERROR-NEXT:                            ^
 839// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 840// CHECK-ERROR-NEXT:         bfm x29, x30, #64, #0
 841// CHECK-ERROR-NEXT:                        ^
 842// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 843// CHECK-ERROR-NEXT:         bfm x10, x20, #63, #64
 844// CHECK-ERROR-NEXT:                             ^
 845
 846        sxtb x3, x2
 847        sxth xzr, xzr
 848        sxtw x3, x5
 849// CHECK-ERROR-AARCH64: error: invalid operand for instruction
 850// CHECK-ERROR-AARCH64-NEXT:         sxtb x3, x2
 851// CHECK-ERROR-AARCH64-NEXT:                  ^
 852// CHECK-ERROR-AARCH64-NEXT: error: invalid operand for instruction
 853// CHECK-ERROR-AARCH64-NEXT:         sxth xzr, xzr
 854// CHECK-ERROR-AARCH64-NEXT:                   ^
 855// CHECK-ERROR-AARCH64-NEXT: error: invalid operand for instruction
 856// CHECK-ERROR-AARCH64-NEXT:         sxtw x3, x5
 857// CHECK-ERROR-AARCH64-NEXT:                  ^
 858
 859        uxtb x3, x12
 860        uxth x5, x9
 861        uxtw x3, x5
 862        uxtb x2, sp
 863        uxtb sp, xzr
 864// CHECK-ERROR: error: invalid operand for instruction
 865// CHECK-ERROR-NEXT:         uxtb x3, x12
 866// CHECK-ERROR-NEXT:                  ^
 867// CHECK-ERROR-NEXT: error: invalid operand for instruction
 868// CHECK-ERROR-NEXT:         uxth x5, x9
 869// CHECK-ERROR-NEXT:                  ^
 870// CHECK-ERROR-AARCH64-NEXT: error: invalid instruction
 871// CHECK-ERROR-AARCH64-NEXT:         uxtw x3, x5
 872// CHECK-ERROR-AARCH64-NEXT:         ^
 873// CHECK-ERROR-NEXT: error: invalid operand for instruction
 874// CHECK-ERROR-NEXT:         uxtb x2, sp
 875// CHECK-ERROR-NEXT:                  ^
 876// CHECK-ERROR-NEXT: error: invalid operand for instruction
 877// CHECK-ERROR-NEXT:         uxtb sp, xzr
 878// CHECK-ERROR-NEXT:              ^
 879
 880        asr x3, w2, #1
 881        asr sp, x2, #1
 882        asr x25, x26, #-1
 883        asr x25, x26, #64
 884        asr w9, w8, #32
 885// CHECK-ERROR: error: invalid operand for instruction
 886// CHECK-ERROR-NEXT:         asr x3, w2, #1
 887// CHECK-ERROR-NEXT:                 ^
 888// CHECK-ERROR-NEXT: error: invalid operand for instruction
 889// CHECK-ERROR-NEXT:         asr sp, x2, #1
 890// CHECK-ERROR-NEXT:             ^
 891// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 892// CHECK-ERROR-NEXT:         asr x25, x26, #-1
 893// CHECK-ERROR-NEXT:                       ^
 894// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 63]
 895// CHECK-ERROR-NEXT:         asr x25, x26, #64
 896// CHECK-ERROR-NEXT:                       ^
 897// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 898// CHECK-ERROR-NEXT:         asr w9, w8, #32
 899// CHECK-ERROR-NEXT:                     ^
 900
 901        sbfiz w1, w2, #0, #0
 902        sbfiz wsp, w9, #0, #1
 903        sbfiz w9, w10, #32, #1
 904        sbfiz w11, w12, #32, #0
 905        sbfiz w9, w10, #10, #23
 906        sbfiz x3, x5, #12, #53
 907        sbfiz sp, x3, #7, #6
 908        sbfiz w3, wsp, #10, #8
 909// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
 910// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
 911// CHECK-ERROR-NEXT:         sbfiz w1, w2, #0, #0
 912// CHECK-ERROR-NEXT:                           ^
 913// CHECK-ERROR-NEXT: error: invalid operand for instruction
 914// CHECK-ERROR-NEXT:         sbfiz wsp, w9, #0, #1
 915// CHECK-ERROR-NEXT:               ^
 916// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 917// CHECK-ERROR-NEXT:         sbfiz w9, w10, #32, #1
 918// CHECK-ERROR-NEXT:                        ^
 919// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 920// CHECK-ERROR-NEXT:         sbfiz w11, w12, #32, #0
 921// CHECK-ERROR-NEXT:                         ^
 922// CHECK-ERROR-NEXT: error: requested insert overflows register
 923// CHECK-ERROR-NEXT:         sbfiz w9, w10, #10, #23
 924// CHECK-ERROR-NEXT:                             ^
 925// CHECK-ERROR-NEXT: error: requested insert overflows register
 926// CHECK-ERROR-NEXT:         sbfiz x3, x5, #12, #53
 927// CHECK-ERROR-NEXT:                            ^
 928// CHECK-ERROR-NEXT: error: invalid operand for instruction
 929// CHECK-ERROR-NEXT:         sbfiz sp, x3, #7, #6
 930// CHECK-ERROR-NEXT:               ^
 931// CHECK-ERROR-NEXT: error: invalid operand for instruction
 932// CHECK-ERROR-NEXT:         sbfiz w3, wsp, #10, #8
 933// CHECK-ERROR-NEXT:                   ^
 934
 935        sbfx w1, w2, #0, #0
 936        sbfx wsp, w9, #0, #1
 937        sbfx w9, w10, #32, #1
 938        sbfx w11, w12, #32, #0
 939        sbfx w9, w10, #10, #23
 940        sbfx x3, x5, #12, #53
 941        sbfx sp, x3, #7, #6
 942        sbfx w3, wsp, #10, #8
 943// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
 944// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
 945// CHECK-ERROR-NEXT:         sbfx w1, w2, #0, #0
 946// CHECK-ERROR-NEXT:                          ^
 947// CHECK-ERROR-NEXT: error: invalid operand for instruction
 948// CHECK-ERROR-NEXT:         sbfx wsp, w9, #0, #1
 949// CHECK-ERROR-NEXT:              ^
 950// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 951// CHECK-ERROR-NEXT:         sbfx w9, w10, #32, #1
 952// CHECK-ERROR-NEXT:                       ^
 953// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 954// CHECK-ERROR-NEXT:         sbfx w11, w12, #32, #0
 955// CHECK-ERROR-NEXT:                        ^
 956// CHECK-ERROR-NEXT: error: requested extract overflows register
 957// CHECK-ERROR-NEXT:         sbfx w9, w10, #10, #23
 958// CHECK-ERROR-NEXT:                            ^
 959// CHECK-ERROR-NEXT: error: requested extract overflows register
 960// CHECK-ERROR-NEXT:         sbfx x3, x5, #12, #53
 961// CHECK-ERROR-NEXT:                           ^
 962// CHECK-ERROR-NEXT: error: invalid operand for instruction
 963// CHECK-ERROR-NEXT:         sbfx sp, x3, #7, #6
 964// CHECK-ERROR-NEXT:              ^
 965// CHECK-ERROR-NEXT: error: invalid operand for instruction
 966// CHECK-ERROR-NEXT:         sbfx w3, wsp, #10, #8
 967// CHECK-ERROR-NEXT:                  ^
 968
 969        bfi w1, w2, #0, #0
 970        bfi wsp, w9, #0, #1
 971        bfi w9, w10, #32, #1
 972        bfi w11, w12, #32, #0
 973        bfi w9, w10, #10, #23
 974        bfi x3, x5, #12, #53
 975        bfi sp, x3, #7, #6
 976        bfi w3, wsp, #10, #8
 977// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
 978// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
 979// CHECK-ERROR-NEXT:         bfi w1, w2, #0, #0
 980// CHECK-ERROR-NEXT:                         ^
 981// CHECK-ERROR-NEXT: error: invalid operand for instruction
 982// CHECK-ERROR-NEXT:         bfi wsp, w9, #0, #1
 983// CHECK-ERROR-NEXT:             ^
 984// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 985// CHECK-ERROR-NEXT:         bfi w9, w10, #32, #1
 986// CHECK-ERROR-NEXT:                      ^
 987// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
 988// CHECK-ERROR-NEXT:         bfi w11, w12, #32, #0
 989// CHECK-ERROR-NEXT:                       ^
 990// CHECK-ERROR-NEXT: error: requested insert overflows register
 991// CHECK-ERROR-NEXT:         bfi w9, w10, #10, #23
 992// CHECK-ERROR-NEXT:                           ^
 993// CHECK-ERROR-NEXT: error: requested insert overflows register
 994// CHECK-ERROR-NEXT:         bfi x3, x5, #12, #53
 995// CHECK-ERROR-NEXT:                          ^
 996// CHECK-ERROR-NEXT: error: invalid operand for instruction
 997// CHECK-ERROR-NEXT:         bfi sp, x3, #7, #6
 998// CHECK-ERROR-NEXT:             ^
 999// CHECK-ERROR-NEXT: error: invalid operand for instruction
1000// CHECK-ERROR-NEXT:         bfi w3, wsp, #10, #8
1001// CHECK-ERROR-NEXT:                 ^
1002
1003        bfxil w1, w2, #0, #0
1004        bfxil wsp, w9, #0, #1
1005        bfxil w9, w10, #32, #1
1006        bfxil w11, w12, #32, #0
1007        bfxil w9, w10, #10, #23
1008        bfxil x3, x5, #12, #53
1009        bfxil sp, x3, #7, #6
1010        bfxil w3, wsp, #10, #8
1011// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
1012// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
1013// CHECK-ERROR-NEXT:         bfxil w1, w2, #0, #0
1014// CHECK-ERROR-NEXT:                           ^
1015// CHECK-ERROR-NEXT: error: invalid operand for instruction
1016// CHECK-ERROR-NEXT:         bfxil wsp, w9, #0, #1
1017// CHECK-ERROR-NEXT:               ^
1018// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1019// CHECK-ERROR-NEXT:         bfxil w9, w10, #32, #1
1020// CHECK-ERROR-NEXT:                        ^
1021// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1022// CHECK-ERROR-NEXT:         bfxil w11, w12, #32, #0
1023// CHECK-ERROR-NEXT:                         ^
1024// CHECK-ERROR-NEXT: error: requested extract overflows register
1025// CHECK-ERROR-NEXT:         bfxil w9, w10, #10, #23
1026// CHECK-ERROR-NEXT:                             ^
1027// CHECK-ERROR-NEXT: error: requested extract overflows register
1028// CHECK-ERROR-NEXT:         bfxil x3, x5, #12, #53
1029// CHECK-ERROR-NEXT:                            ^
1030// CHECK-ERROR-NEXT: error: invalid operand for instruction
1031// CHECK-ERROR-NEXT:         bfxil sp, x3, #7, #6
1032// CHECK-ERROR-NEXT:               ^
1033// CHECK-ERROR-NEXT: error: invalid operand for instruction
1034// CHECK-ERROR-NEXT:         bfxil w3, wsp, #10, #8
1035// CHECK-ERROR-NEXT:                   ^
1036
1037        ubfiz w1, w2, #0, #0
1038        ubfiz wsp, w9, #0, #1
1039        ubfiz w9, w10, #32, #1
1040        ubfiz w11, w12, #32, #0
1041        ubfiz w9, w10, #10, #23
1042        ubfiz x3, x5, #12, #53
1043        ubfiz sp, x3, #7, #6
1044        ubfiz w3, wsp, #10, #8
1045// CHECK-ERROR-AARCH64: error: expected integer in range [<lsb>, 31]
1046// CHECK-ERROR-ARM64: error: expected integer in range [1, 32]
1047// CHECK-ERROR-NEXT:         ubfiz w1, w2, #0, #0
1048// CHECK-ERROR-NEXT:                           ^
1049// CHECK-ERROR-NEXT: error: invalid operand for instruction
1050// CHECK-ERROR-NEXT:         ubfiz wsp, w9, #0, #1
1051// CHECK-ERROR-NEXT:               ^
1052// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1053// CHECK-ERROR-NEXT:         ubfiz w9, w10, #32, #1
1054// CHECK-ERROR-NEXT:                        ^
1055// CHECK-ERROR-NEXT: error: {{expected|immediate must be an}} integer in range [0, 31]
1056// CHECK-ERROR-NEXT:         ubfiz w11, w12, #32, #0
1057// CHECK-ERROR-NEXT:                         ^
1058// 

Large files files are truncated, but you can click here to view the full file