Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / AArch64 / SME / mova-diagnostics.s
blobdfb7f98f3c978c15736678516b8f0817c87a2d35
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme 2>&1 < %s| FileCheck %s
3 // ------------------------------------------------------------------------- //
4 // Invalid predicate (expected: p0-p7)
6 mova z0.b, p8/m, za0h.b[w12, 0]
7 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
8 // CHECK-NEXT: mova z0.b, p8/m, za0h.b[w12, 0]
9 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11 // ------------------------------------------------------------------------- //
12 // Invalid tile
14 // tile-to-vector
16 mova z0.b, p0/m, za1h.b[w12, 0]
17 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
18 // CHECK-NEXT: mova z0.b, p0/m, za1h.b[w12, 0]
19 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
21 mova z0.h, p0/m, za2h.h[w12, 0]
22 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
23 // CHECK-NEXT: mova z0.h, p0/m, za2h.h[w12, 0]
24 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
26 mova z0.s, p0/m, za4h.s[w12, 0]
27 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
28 // CHECK-NEXT: mova z0.s, p0/m, za4h.s[w12, 0]
29 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
31 mova z0.d, p0/m, za8h.d[w12, 0]
32 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
33 // CHECK-NEXT: mova z0.d, p0/m, za8h.d[w12, 0]
34 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
36 mova z0.q, p0/m, za16h.q[w12, 0]
37 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
38 // CHECK-NEXT: mova z0.q, p0/m, za16h.q[w12, 0]
39 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
41 // vector-to-tile
43 mova za1h.b[w12, 0], p0/m, z0.b
44 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
45 // CHECK-NEXT: mova za1h.b[w12, 0], p0/m, z0.b
46 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
48 mova za2h.h[w12, 0], p0/m, z0.h
49 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
50 // CHECK-NEXT: mova za2h.h[w12, 0], p0/m, z0.h
51 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53 mova za4h.s[w12, 0], p0/m, z0.s
54 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
55 // CHECK-NEXT: mova za4h.s[w12, 0], p0/m, z0.s
56 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
58 mova za8h.d[w12, 0], p0/m, z0.d
59 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
60 // CHECK-NEXT: mova za8h.d[w12, 0], p0/m, z0.d
61 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63 mova za16h.q[w12, 0], p0/m, z0.q
64 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list
65 // CHECK-NEXT: mova za16h.q[w12, 0], p0/m, z0.q
66 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
68 // ------------------------------------------------------------------------- //
69 // Invalid matrix operand
71 // tile-to-vector
73 mova z0.b, p0/m, za0h.h[w12, 0]
74 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za0h.b or za0v.b
75 // CHECK-NEXT: mova z0.b, p0/m, za0h.h[w12, 0]
76 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
78 mova z0.h, p0/m, za[w12, 0]
79 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-1]h.h or za[0-1]v.h
80 // CHECK-NEXT: mova z0.h, p0/m, za[w12, 0]
81 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
83 mova z0.s, p0/m, za2.s[w12, 0]
84 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3]h.s or za[0-3]v.s
85 // CHECK-NEXT: mova z0.s, p0/m, za2.s[w12, 0]
86 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
88 mova z0.d, p0/m, za2v.s[w12, 0]
89 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-7]h.d or za[0-7]v.d
90 // CHECK-NEXT: mova z0.d, p0/m, za2v.s[w12, 0]
91 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
93 mova z0.q, p0/m, za0h.b[w12, 0]
94 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-15]h.q or za[0-15]v.q
95 // CHECK-NEXT: mova z0.q, p0/m, za0h.b[w12, 0]
96 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
98 // vector-to-tile, only one test here since the intended instruction variant is
99 // ambiguous when failing to match on the first operand.
101 mova za[w12, 0], p0/m, z0.b
102 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-15]h.q or za[0-15]v.q
103 // CHECK-NEXT: mova za[w12, 0], p0/m, z0.b
104 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
106 // ------------------------------------------------------------------------- //
107 // Invalid vector select register (expected: w12-w15)
109 mova z0.h, p0/m, za0h.h[w11, 0]
110 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must be a register in range [w12, w15]
111 // CHECK-NEXT: mova z0.h, p0/m, za0h.h[w11, 0]
112 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
114 mova z0.s, p0/m, za0h.s[w16, 0]
115 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must be a register in range [w12, w15]
116 // CHECK-NEXT: mova z0.s, p0/m, za0h.s[w16, 0]
117 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
119 mova za0h.d[w11, 0], p0/m, z0.d
120 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must be a register in range [w12, w15]
121 // CHECK-NEXT: mova za0h.d[w11, 0], p0/m, z0.d
122 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
124 mova za0h.q[w16, 0], p0/m, z0.q
125 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must be a register in range [w12, w15]
126 // CHECK-NEXT: mova za0h.q[w16, 0], p0/m, z0.q
127 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
129 // ------------------------------------------------------------------------- //
130 // Invalid vector select offset
132 // expected: .b => 0-15, .h => 0-7, .s => 0-3, .d => 0-1, .q => NONE
134 // tile-to-vector
136 mova z0.b, p0/m, za0h.b[w12, 16]
137 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15].
138 // CHECK-NEXT: mova z0.b, p0/m, za0h.b[w12, 16]
139 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
141 mova z0.h, p0/m, za0h.h[w12, 8]
142 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7].
143 // CHECK-NEXT: mova z0.h, p0/m, za0h.h[w12, 8]
144 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
146 mova z0.s, p0/m, za0h.s[w12, 4]
147 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 3].
148 // CHECK-NEXT: mova z0.s, p0/m, za0h.s[w12, 4]
149 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
151 mova z0.d, p0/m, za0h.d[w12, 2]
152 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 1].
153 // CHECK-NEXT: mova z0.d, p0/m, za0h.d[w12, 2]
154 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
156 mova z0.q, p0/m, za0h.q[w12, 1]
157 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be 0.
158 // CHECK-NEXT: mova z0.q, p0/m, za0h.q[w12, 1]
159 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
161 mov z0.b, p0/m, za0h.b[w12, 16]
162 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15].
163 // CHECK-NEXT: mov z0.b, p0/m, za0h.b[w12, 16]
164 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
166 mov z0.h, p0/m, za0h.h[w12, 8]
167 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7].
168 // CHECK-NEXT: mov z0.h, p0/m, za0h.h[w12, 8]
169 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
171 mov z0.s, p0/m, za0h.s[w12, 4]
172 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 3].
173 // CHECK-NEXT: mov z0.s, p0/m, za0h.s[w12, 4]
174 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
176 mov z0.d, p0/m, za0h.d[w12, 2]
177 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 1].
178 // CHECK-NEXT: mov z0.d, p0/m, za0h.d[w12, 2]
179 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
181 mov z0.q, p0/m, za0h.q[w12, 1]
182 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be 0.
183 // CHECK-NEXT: mov z0.q, p0/m, za0h.q[w12, 1]
184 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
186 // vector-to-tile
188 mova za0h.b[w12, 16], p0/m, z0.b
189 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15].
190 // CHECK-NEXT: mova za0h.b[w12, 16], p0/m, z0.b
191 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
193 mova za0h.h[w12, 8], p0/m, z0.h
194 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7].
195 // CHECK-NEXT: mova za0h.h[w12, 8], p0/m, z0.h
196 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
198 mova za0h.s[w12, 4], p0/m, z0.s
199 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 3].
200 // CHECK-NEXT: mova za0h.s[w12, 4], p0/m, z0.s
201 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
203 mova za0h.d[w12, 2], p0/m, z0.d
204 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 1].
205 // CHECK-NEXT: mova za0h.d[w12, 2], p0/m, z0.d
206 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
208 mova za0h.q[w12, 1], p0/m, z0.q
209 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be 0.
210 // CHECK-NEXT: mova za0h.q[w12, 1], p0/m, z0.q
211 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
213 mov za0h.b[w12, 16], p0/m, z0.b
214 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15].
215 // CHECK-NEXT: mov za0h.b[w12, 16], p0/m, z0.b
216 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
218 mov za0h.h[w12, 8], p0/m, z0.h
219 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7].
220 // CHECK-NEXT: mov za0h.h[w12, 8], p0/m, z0.h
221 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
223 mov za0h.s[w12, 4], p0/m, z0.s
224 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 3].
225 // CHECK-NEXT: mov za0h.s[w12, 4], p0/m, z0.s
226 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
228 mov za0h.d[w12, 2], p0/m, z0.d
229 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 1].
230 // CHECK-NEXT: mov za0h.d[w12, 2], p0/m, z0.d
231 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
233 mov za0h.q[w12, 1], p0/m, z0.q
234 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be 0.
235 // CHECK-NEXT: mov za0h.q[w12, 1], p0/m, z0.q
236 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
238 // ------------------------------------------------------------------------- //
239 // Invalid ZPR element width
241 mova za0h.b[w12, 0], p0/m, z0.h
242 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
243 // CHECK-NEXT: mova za0h.b[w12, 0], p0/m, z0.h
244 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
246 mova za0h.h[w12, 0], p0/m, z0.s
247 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
248 // CHECK-NEXT: mova za0h.h[w12, 0], p0/m, z0.s
249 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
251 mova za0h.s[w12, 0], p0/m, z0.d
252 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
253 // CHECK-NEXT: mova za0h.s[w12, 0], p0/m, z0.d
254 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
256 mova za0h.d[w12, 0], p0/m, z0.q
257 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
258 // CHECK-NEXT: mova za0h.d[w12, 0], p0/m, z0.q
259 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
261 mova za0h.q[w12, 0], p0/m, z0.b
262 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
263 // CHECK-NEXT: mova za0h.q[w12, 0], p0/m, z0.b
264 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: