1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve  2>&1 < %s| FileCheck %s
2
3
4// ------------------------------------------------------------------------- //
5// Invalid predicate
6
7clasta   w0, p8, w0, z31.b
8// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
9// CHECK-NEXT: clasta   w0, p8, w0, z31.b
10// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11
12clasta   w0, p7.b, w0, z31.b
13// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
14// CHECK-NEXT: clasta   w0, p7.b, w0, z31.b
15// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
16
17clasta   w0, p7.q, w0, z31.b
18// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
19// CHECK-NEXT: clasta   w0, p7.q, w0, z31.b
20// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
21
22
23// ------------------------------------------------------------------------- //
24// Invalid element width
25
26clasta   w0, p7, x0, z31.b
27// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
28// CHECK-NEXT: clasta   w0, p7, x0, z31.b
29// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
30
31clasta   x0, p7, x0, z31.b
32// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
33// CHECK-NEXT: clasta   x0, p7, x0, z31.b
34// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
35
36clasta   x0, p7, x0, z31.h
37// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
38// CHECK-NEXT: clasta   x0, p7, x0, z31.h
39// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
40
41clasta   x0, p7, x0, z31.s
42// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
43// CHECK-NEXT: clasta   x0, p7, x0, z31.s
44// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
45
46clasta   w0, p7, w0, z31.d
47// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
48// CHECK-NEXT: clasta   w0, p7, w0, z31.d
49// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
50
51clasta   b0, p7, b0, z31.h
52// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
53// CHECK-NEXT: clasta   b0, p7, b0, z31.h
54// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
55
56clasta   h0, p7, h0, z31.s
57// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
58// CHECK-NEXT: clasta   h0, p7, h0, z31.s
59// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
60
61clasta   s0, p7, s0, z31.d
62// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
63// CHECK-NEXT: clasta   s0, p7, s0, z31.d
64// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
65
66clasta   d0, p7, d0, z31.b
67// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
68// CHECK-NEXT: clasta   d0, p7, d0, z31.b
69// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
70
71clasta   z0.b, p7, z0.b, z31.h
72// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
73// CHECK-NEXT: clasta   z0.b, p7, z0.b, z31.h
74// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
75
76clasta   z0.h, p7, z0.h, z31.s
77// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
78// CHECK-NEXT: clasta   z0.h, p7, z0.h, z31.s
79// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
80
81clasta   z0.s, p7, z0.s, z31.d
82// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
83// CHECK-NEXT: clasta   z0.s, p7, z0.s, z31.d
84// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
85
86clasta   z0.d, p7, z0.d, z31.b
87// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
88// CHECK-NEXT: clasta   z0.d, p7, z0.d, z31.b
89// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
90
91
92// --------------------------------------------------------------------------//
93// Negative tests for instructions that are incompatible with movprfx
94
95movprfx z31.d, p7/z, z6.d
96clasta   x0, p7, x0, z31.d
97// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
98// CHECK-NEXT: clasta   x0, p7, x0, z31.d
99// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
100
101movprfx z31, z6
102clasta   x0, p7, x0, z31.d
103// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
104// CHECK-NEXT: clasta   x0, p7, x0, z31.d
105// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
106
107movprfx z31.d, p7/z, z6.d
108clasta   d0, p7, d0, z31.d
109// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
110// CHECK-NEXT: clasta   d0, p7, d0, z31.d
111// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
112
113movprfx z31, z6
114clasta   d0, p7, d0, z31.d
115// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
116// CHECK-NEXT: clasta   d0, p7, d0, z31.d
117// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
118
119movprfx z0.d, p7/z, z7.d
120clasta   z0.d, p7, z0.d, z31.d
121// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx
122// CHECK-NEXT: clasta   z0.d, p7, z0.d, z31.d
123// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
124