1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s 2 3// Register z32 does not exist. 4sqadd z22.h, z10.h, z32.h 5// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand 6// CHECK-NEXT: sqadd z22.h, z10.h, z32.h 7// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 8 9// Invalid element kind. 10sqadd z20.h, z2.h, z31.x 11// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid vector kind qualifier 12// CHECK-NEXT: sqadd z20.h, z2.h, z31.x 13// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 14 15// Element size specifiers should match. 16sqadd z27.h, z11.h, z27.b 17// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 18// CHECK-NEXT: sqadd z27.h, z11.h, z27.b 19// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 20 21 22// --------------------------------------------------------------------------// 23// Invalid immediates 24 25sqadd z0.b, z0.b, #0, lsl #8 // #0, lsl #8 is not valid for .b 26// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0 27// CHECK-NEXT: sqadd z0.b, z0.b, #0, lsl #8 28// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 29 30sqadd z0.b, z0.b, #-1 31// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0 32// CHECK-NEXT: sqadd z0.b, z0.b, #-1 33// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 34 35sqadd z0.b, z0.b, #1, lsl #8 36// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0 37// CHECK-NEXT: sqadd z0.b, z0.b, #1, lsl #8 38// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 39 40sqadd z0.b, z0.b, #256 41// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] with a shift amount of 0 42// CHECK-NEXT: sqadd z0.b, z0.b, #256 43// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 44 45sqadd z0.h, z0.h, #-1 46// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 47// CHECK-NEXT: sqadd z0.h, z0.h, #-1 48// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 49 50sqadd z0.h, z0.h, #256, lsl #8 51// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 52// CHECK-NEXT: sqadd z0.h, z0.h, #256, lsl #8 53// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 54 55sqadd z0.h, z0.h, #65536 56// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 57// CHECK-NEXT: sqadd z0.h, z0.h, #65536 58// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 59 60sqadd z0.s, z0.s, #-1 61// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 62// CHECK-NEXT: sqadd z0.s, z0.s, #-1 63// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 64 65sqadd z0.s, z0.s, #256, lsl #8 66// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 67// CHECK-NEXT: sqadd z0.s, z0.s, #256, lsl #8 68// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 69 70sqadd z0.s, z0.s, #65536 71// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 72// CHECK-NEXT: sqadd z0.s, z0.s, #65536 73// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 74 75sqadd z0.d, z0.d, #-1 76// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 77// CHECK-NEXT: sqadd z0.d, z0.d, #-1 78// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 79 80sqadd z0.d, z0.d, #256, lsl #8 81// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 82// CHECK-NEXT: sqadd z0.d, z0.d, #256, lsl #8 83// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 84 85sqadd z0.d, z0.d, #65536 86// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255] or a multiple of 256 in range [256, 65280] 87// CHECK-NEXT: sqadd z0.d, z0.d, #65536 88// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 89 90 91// --------------------------------------------------------------------------// 92// Negative tests for instructions that are incompatible with movprfx 93 94movprfx z31.d, p0/z, z6.d 95sqadd z31.d, z31.d, #65280 96// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx 97// CHECK-NEXT: sqadd z31.d, z31.d, #65280 98// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 99 100movprfx z0.d, p0/z, z7.d 101sqadd z0.d, z0.d, z0.d 102// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 103// CHECK-NEXT: sqadd z0.d, z0.d, z0.d 104// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 105 106movprfx z0, z7 107sqadd z0.d, z0.d, z0.d 108// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 109// CHECK-NEXT: sqadd z0.d, z0.d, z0.d 110// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 111