1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s 2 3// --------------------------------------------------------------------------// 4// Invalid operand (.b) 5 6ldff1h z9.b, p7/z, [x0] 7// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 8// CHECK-NEXT: ldff1h z9.b, p7/z, [x0] 9// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 10 11// --------------------------------------------------------------------------// 12// restricted predicate has range [0, 7]. 13 14ldff1h z9.h, p8/z, [x0] 15// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) 16// CHECK-NEXT: ldff1h z9.h, p8/z, [x0] 17// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 18 19ldff1h z12.s, p8/z, [x0] 20// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) 21// CHECK-NEXT: ldff1h z12.s, p8/z, [x0] 22// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 23 24ldff1h z4.d, p8/z, [x0] 25// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) 26// CHECK-NEXT: ldff1h z4.d, p8/z, [x0] 27// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 28 29// --------------------------------------------------------------------------// 30// Invalid scalar + scalar addressing modes 31 32ldff1h z0.h, p0/z, [x0, sp] 33// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1' 34// CHECK-NEXT: ldff1h z0.h, p0/z, [x0, sp] 35// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 36 37ldff1h z0.h, p0/z, [x0, x0, lsl #2] 38// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1' 39// CHECK-NEXT: ldff1h z0.h, p0/z, [x0, x0, lsl #2] 40// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 41 42ldff1h z0.h, p0/z, [x0, w0] 43// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1' 44// CHECK-NEXT: ldff1h z0.h, p0/z, [x0, w0] 45// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 46 47ldff1h z0.h, p0/z, [x0, w0, uxtw] 48// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1' 49// CHECK-NEXT: ldff1h z0.h, p0/z, [x0, w0, uxtw] 50// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 51 52 53// --------------------------------------------------------------------------// 54// Invalid scalar + vector addressing modes 55 56ldff1h z0.d, p0/z, [x0, z0.h] 57// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand 58// CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.h] 59// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 60 61ldff1h z0.d, p0/z, [x0, z0.s] 62// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand 63// CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.s] 64// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 65 66ldff1h z0.s, p0/z, [x0, z0.s] 67// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw)' 68// CHECK-NEXT: ldff1h z0.s, p0/z, [x0, z0.s] 69// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 70 71ldff1h z0.s, p0/z, [x0, z0.s, uxtw #2] 72// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #1' 73// CHECK-NEXT: ldff1h z0.s, p0/z, [x0, z0.s, uxtw #2] 74// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 75 76ldff1h z0.s, p0/z, [x0, z0.s, lsl #1] 77// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #1' 78// CHECK-NEXT: ldff1h z0.s, p0/z, [x0, z0.s, lsl #1] 79// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 80 81ldff1h z0.d, p0/z, [x0, z0.d, lsl #2] 82// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #1' 83// CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.d, lsl #2] 84// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 85 86ldff1h z0.d, p0/z, [x0, z0.d, sxtw #2] 87// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #1' 88// CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.d, sxtw #2] 89// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 90 91 92// --------------------------------------------------------------------------// 93// Invalid vector + immediate addressing modes 94 95ldff1h z0.s, p0/z, [z0.s, #-2] 96// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 97// CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #-2] 98// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 99 100ldff1h z0.s, p0/z, [z0.s, #-1] 101// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 102// CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #-1] 103// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 104 105ldff1h z0.s, p0/z, [z0.s, #63] 106// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 107// CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #63] 108// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 109 110ldff1h z0.s, p0/z, [z0.s, #64] 111// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 112// CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #64] 113// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 114 115ldff1h z0.s, p0/z, [z0.s, #3] 116// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 117// CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #3] 118// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 119 120ldff1h z0.d, p0/z, [z0.d, #-2] 121// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 122// CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #-2] 123// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 124 125ldff1h z0.d, p0/z, [z0.d, #-1] 126// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 127// CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #-1] 128// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 129 130ldff1h z0.d, p0/z, [z0.d, #63] 131// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 132// CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #63] 133// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 134 135ldff1h z0.d, p0/z, [z0.d, #64] 136// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 137// CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #64] 138// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 139 140ldff1h z0.d, p0/z, [z0.d, #3] 141// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62]. 142// CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #3] 143// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 144 145 146// --------------------------------------------------------------------------// 147// Negative tests for instructions that are incompatible with movprfx 148 149movprfx z0.d, p0/z, z7.d 150ldff1h { z0.d }, p0/z, [z0.d] 151// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 152// CHECK-NEXT: ldff1h { z0.d }, p0/z, [z0.d] 153// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 154 155movprfx z0, z7 156ldff1h { z0.d }, p0/z, [z0.d] 157// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 158// CHECK-NEXT: ldff1h { z0.d }, p0/z, [z0.d] 159// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 160