1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s 2 3 4// --------------------------------------------------------------------------// 5// Immediate out of lower bound [-24, 21]. 6 7st3w {z12.s, z13.s, z14.s}, p4, [x12, #-27, MUL VL] 8// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 3 in range [-24, 21]. 9// CHECK-NEXT: st3w {z12.s, z13.s, z14.s}, p4, [x12, #-27, MUL VL] 10// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 11 12st3w {z7.s, z8.s, z9.s}, p3, [x1, #24, MUL VL] 13// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 3 in range [-24, 21]. 14// CHECK-NEXT: st3w {z7.s, z8.s, z9.s}, p3, [x1, #24, MUL VL] 15// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 16 17 18// --------------------------------------------------------------------------// 19// Immediate not a multiple of three. 20 21st3w {z12.s, z13.s, z14.s}, p4, [x12, #-7, MUL VL] 22// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 3 in range [-24, 21]. 23// CHECK-NEXT: st3w {z12.s, z13.s, z14.s}, p4, [x12, #-7, MUL VL] 24// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 25 26st3w {z7.s, z8.s, z9.s}, p3, [x1, #5, MUL VL] 27// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 3 in range [-24, 21]. 28// CHECK-NEXT: st3w {z7.s, z8.s, z9.s}, p3, [x1, #5, MUL VL] 29// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 30 31 32// --------------------------------------------------------------------------// 33// Invalid scalar + scalar addressing modes 34 35st3w { z0.s, z1.s, z2.s }, p0, [x0, x0] 36// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2' 37// CHECK-NEXT: st3w { z0.s, z1.s, z2.s }, p0, [x0, x0] 38// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 39 40st3w { z0.s, z1.s, z2.s }, p0, [x0, xzr] 41// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2' 42// CHECK-NEXT: st3w { z0.s, z1.s, z2.s }, p0, [x0, xzr] 43// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 44 45st3w { z0.s, z1.s, z2.s }, p0, [x0, x0, lsl #3] 46// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2' 47// CHECK-NEXT: st3w { z0.s, z1.s, z2.s }, p0, [x0, x0, lsl #3] 48// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 49 50st3w { z0.s, z1.s, z2.s }, p0, [x0, w0] 51// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2' 52// CHECK-NEXT: st3w { z0.s, z1.s, z2.s }, p0, [x0, w0] 53// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 54 55st3w { z0.s, z1.s, z2.s }, p0, [x0, w0, uxtw] 56// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2' 57// CHECK-NEXT: st3w { z0.s, z1.s, z2.s }, p0, [x0, w0, uxtw] 58// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 59 60 61// --------------------------------------------------------------------------// 62// error: restricted predicate has range [0, 7]. 63 64st3w {z2.s, z3.s, z4.s}, p8, [x15, #10, MUL VL] 65// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. 66// CHECK-NEXT: st3w {z2.s, z3.s, z4.s}, p8, [x15, #10, MUL VL] 67// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 68 69 70// --------------------------------------------------------------------------// 71// Invalid vector list. 72 73st3w { }, p0, [x0] 74// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector register expected 75// CHECK-NEXT: st3w { }, p0, [x0] 76// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 77 78st3w { z0.s, z1.s, z2.s, z3.s }, p0, [x0] 79// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand 80// CHECK-NEXT: st3w { z0.s, z1.s, z2.s, z3.s }, p0, [x0] 81// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 82 83st3w { z0.s, z1.s, z2.d }, p0, [x0] 84// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: mismatched register size suffix 85// CHECK-NEXT: st3w { z0.s, z1.s, z2.d }, p0, [x0] 86// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 87 88st3w { z0.s, z1.s, z3.s }, p0, [x0] 89// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: registers must be sequential 90// CHECK-NEXT: st3w { z0.s, z1.s, z3.s }, p0, [x0] 91// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 92 93st3w { v0.4s, v1.4s, v2.4s }, p0, [x0] 94// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand 95// CHECK-NEXT: st3w { v0.4s, v1.4s, v2.4s }, p0, [x0] 96// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 97 98 99// --------------------------------------------------------------------------// 100// Negative tests for instructions that are incompatible with movprfx 101 102movprfx z21.s, p5/z, z28.s 103st3w { z21.s, z22.s, z23.s }, p5, [x10, #15, mul vl] 104// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 105// CHECK-NEXT: st3w { z21.s, z22.s, z23.s }, p5, [x10, #15, mul vl] 106// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 107 108movprfx z21, z28 109st3w { z21.s, z22.s, z23.s }, p5, [x10, #15, mul vl] 110// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 111// CHECK-NEXT: st3w { z21.s, z22.s, z23.s }, p5, [x10, #15, mul vl] 112// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 113