1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve  2>&1 < %s| FileCheck %s
2
3// --------------------------------------------------------------------------//
4// Invalid immediate (multiple of 4 in range [0, 252]).
5
6ld1rw z0.s, p1/z, [x0, #-4]
7// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 252].
8// CHECK-NEXT: ld1rw z0.s, p1/z, [x0, #-4]
9// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10
11ld1rw z0.s, p1/z, [x0, #-1]
12// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 252].
13// CHECK-NEXT: ld1rw z0.s, p1/z, [x0, #-1]
14// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
15
16ld1rw z0.s, p1/z, [x0, #253]
17// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 252].
18// CHECK-NEXT: ld1rw z0.s, p1/z, [x0, #253]
19// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
20
21ld1rw z0.s, p1/z, [x0, #256]
22// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 252].
23// CHECK-NEXT: ld1rw z0.s, p1/z, [x0, #256]
24// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
25
26ld1rw z0.s, p1/z, [x0, #3]
27// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 252].
28// CHECK-NEXT: ld1rw z0.s, p1/z, [x0, #3]
29// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30
31
32// --------------------------------------------------------------------------//
33// Invalid result vector element size
34
35ld1rw z0.b, p1/z, [x0]
36// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
37// CHECK-NEXT: ld1rw z0.b, p1/z, [x0]
38// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
39
40ld1rw z0.h, p1/z, [x0]
41// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
42// CHECK-NEXT: ld1rw z0.h, p1/z, [x0]
43// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
44
45
46// --------------------------------------------------------------------------//
47// restricted predicate has range [0, 7].
48
49ld1rw z0.s, p8/z, [x0]
50// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
51// CHECK-NEXT: ld1rw z0.s, p8/z, [x0]
52// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53
54
55// --------------------------------------------------------------------------//
56// Negative tests for instructions that are incompatible with movprfx
57
58movprfx z31.d, p7/z, z6.d
59ld1rw   { z31.d }, p7/z, [sp, #252]
60// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
61// CHECK-NEXT: ld1rw   { z31.d }, p7/z, [sp, #252]
62// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63
64movprfx z31, z6
65ld1rw   { z31.d }, p7/z, [sp, #252]
66// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
67// CHECK-NEXT: ld1rw   { z31.d }, p7/z, [sp, #252]
68// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
69