1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \
2// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
4// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
5// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \
6// RUN:        | llvm-objdump -d --mattr=+sme - | FileCheck %s --check-prefix=CHECK-INST
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \
8// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
9// Disassemble encoding and check the re-encoding (-show-encoding) matches.
10// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \
11// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
12// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme -disassemble -show-encoding \
13// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
14
15// --------------------------------------------------------------------------//
16// Horizontal
17
18ld1d    {za0h.d[w12, 0]}, p0/z, [x0, x0, lsl #3]
19// CHECK-INST: ld1d    {za0h.d[w12, 0]}, p0/z, [x0, x0, lsl #3]
20// CHECK-ENCODING: [0x00,0x00,0xc0,0xe0]
21// CHECK-ERROR: instruction requires: sme
22// CHECK-UNKNOWN: 00 00 c0 e0 <unknown>
23
24ld1d    {za2h.d[w14, 1]}, p5/z, [x10, x21, lsl #3]
25// CHECK-INST: ld1d    {za2h.d[w14, 1]}, p5/z, [x10, x21, lsl #3]
26// CHECK-ENCODING: [0x45,0x55,0xd5,0xe0]
27// CHECK-ERROR: instruction requires: sme
28// CHECK-UNKNOWN: 45 55 d5 e0 <unknown>
29
30ld1d    {za3h.d[w15, 1]}, p3/z, [x13, x8, lsl #3]
31// CHECK-INST: ld1d    {za3h.d[w15, 1]}, p3/z, [x13, x8, lsl #3]
32// CHECK-ENCODING: [0xa7,0x6d,0xc8,0xe0]
33// CHECK-ERROR: instruction requires: sme
34// CHECK-UNKNOWN: a7 6d c8 e0 <unknown>
35
36ld1d    {za7h.d[w15, 1]}, p7/z, [sp]
37// CHECK-INST: ld1d    {za7h.d[w15, 1]}, p7/z, [sp]
38// CHECK-ENCODING: [0xef,0x7f,0xdf,0xe0]
39// CHECK-ERROR: instruction requires: sme
40// CHECK-UNKNOWN: ef 7f df e0 <unknown>
41
42ld1d    {za2h.d[w12, 1]}, p3/z, [x17, x16, lsl #3]
43// CHECK-INST: ld1d    {za2h.d[w12, 1]}, p3/z, [x17, x16, lsl #3]
44// CHECK-ENCODING: [0x25,0x0e,0xd0,0xe0]
45// CHECK-ERROR: instruction requires: sme
46// CHECK-UNKNOWN: 25 0e d0 e0 <unknown>
47
48ld1d    {za0h.d[w12, 1]}, p1/z, [x1, x30, lsl #3]
49// CHECK-INST: ld1d    {za0h.d[w12, 1]}, p1/z, [x1, x30, lsl #3]
50// CHECK-ENCODING: [0x21,0x04,0xde,0xe0]
51// CHECK-ERROR: instruction requires: sme
52// CHECK-UNKNOWN: 21 04 de e0 <unknown>
53
54ld1d    {za4h.d[w14, 0]}, p5/z, [x19, x20, lsl #3]
55// CHECK-INST: ld1d    {za4h.d[w14, 0]}, p5/z, [x19, x20, lsl #3]
56// CHECK-ENCODING: [0x68,0x56,0xd4,0xe0]
57// CHECK-ERROR: instruction requires: sme
58// CHECK-UNKNOWN: 68 56 d4 e0 <unknown>
59
60ld1d    {za0h.d[w12, 0]}, p6/z, [x12, x2, lsl #3]
61// CHECK-INST: ld1d    {za0h.d[w12, 0]}, p6/z, [x12, x2, lsl #3]
62// CHECK-ENCODING: [0x80,0x19,0xc2,0xe0]
63// CHECK-ERROR: instruction requires: sme
64// CHECK-UNKNOWN: 80 19 c2 e0 <unknown>
65
66ld1d    {za0h.d[w14, 1]}, p2/z, [x1, x26, lsl #3]
67// CHECK-INST: ld1d    {za0h.d[w14, 1]}, p2/z, [x1, x26, lsl #3]
68// CHECK-ENCODING: [0x21,0x48,0xda,0xe0]
69// CHECK-ERROR: instruction requires: sme
70// CHECK-UNKNOWN: 21 48 da e0 <unknown>
71
72ld1d    {za6h.d[w12, 1]}, p2/z, [x22, x30, lsl #3]
73// CHECK-INST: ld1d    {za6h.d[w12, 1]}, p2/z, [x22, x30, lsl #3]
74// CHECK-ENCODING: [0xcd,0x0a,0xde,0xe0]
75// CHECK-ERROR: instruction requires: sme
76// CHECK-UNKNOWN: cd 0a de e0 <unknown>
77
78ld1d    {za1h.d[w15, 0]}, p5/z, [x9, x1, lsl #3]
79// CHECK-INST: ld1d    {za1h.d[w15, 0]}, p5/z, [x9, x1, lsl #3]
80// CHECK-ENCODING: [0x22,0x75,0xc1,0xe0]
81// CHECK-ERROR: instruction requires: sme
82// CHECK-UNKNOWN: 22 75 c1 e0 <unknown>
83
84ld1d    {za3h.d[w13, 1]}, p2/z, [x12, x11, lsl #3]
85// CHECK-INST: ld1d    {za3h.d[w13, 1]}, p2/z, [x12, x11, lsl #3]
86// CHECK-ENCODING: [0x87,0x29,0xcb,0xe0]
87// CHECK-ERROR: instruction requires: sme
88// CHECK-UNKNOWN: 87 29 cb e0 <unknown>
89
90ld1d    za0h.d[w12, 0], p0/z, [x0, x0, lsl #3]
91// CHECK-INST: ld1d    {za0h.d[w12, 0]}, p0/z, [x0, x0, lsl #3]
92// CHECK-ENCODING: [0x00,0x00,0xc0,0xe0]
93// CHECK-ERROR: instruction requires: sme
94// CHECK-UNKNOWN: 00 00 c0 e0 <unknown>
95
96ld1d    za2h.d[w14, 1], p5/z, [x10, x21, lsl #3]
97// CHECK-INST: ld1d    {za2h.d[w14, 1]}, p5/z, [x10, x21, lsl #3]
98// CHECK-ENCODING: [0x45,0x55,0xd5,0xe0]
99// CHECK-ERROR: instruction requires: sme
100// CHECK-UNKNOWN: 45 55 d5 e0 <unknown>
101
102ld1d    za3h.d[w15, 1], p3/z, [x13, x8, lsl #3]
103// CHECK-INST: ld1d    {za3h.d[w15, 1]}, p3/z, [x13, x8, lsl #3]
104// CHECK-ENCODING: [0xa7,0x6d,0xc8,0xe0]
105// CHECK-ERROR: instruction requires: sme
106// CHECK-UNKNOWN: a7 6d c8 e0 <unknown>
107
108ld1d    za7h.d[w15, 1], p7/z, [sp]
109// CHECK-INST: ld1d    {za7h.d[w15, 1]}, p7/z, [sp]
110// CHECK-ENCODING: [0xef,0x7f,0xdf,0xe0]
111// CHECK-ERROR: instruction requires: sme
112// CHECK-UNKNOWN: ef 7f df e0 <unknown>
113
114ld1d    za2h.d[w12, 1], p3/z, [x17, x16, lsl #3]
115// CHECK-INST: ld1d    {za2h.d[w12, 1]}, p3/z, [x17, x16, lsl #3]
116// CHECK-ENCODING: [0x25,0x0e,0xd0,0xe0]
117// CHECK-ERROR: instruction requires: sme
118// CHECK-UNKNOWN: 25 0e d0 e0 <unknown>
119
120ld1d    za0h.d[w12, 1], p1/z, [x1, x30, lsl #3]
121// CHECK-INST: ld1d    {za0h.d[w12, 1]}, p1/z, [x1, x30, lsl #3]
122// CHECK-ENCODING: [0x21,0x04,0xde,0xe0]
123// CHECK-ERROR: instruction requires: sme
124// CHECK-UNKNOWN: 21 04 de e0 <unknown>
125
126ld1d    za4h.d[w14, 0], p5/z, [x19, x20, lsl #3]
127// CHECK-INST: ld1d    {za4h.d[w14, 0]}, p5/z, [x19, x20, lsl #3]
128// CHECK-ENCODING: [0x68,0x56,0xd4,0xe0]
129// CHECK-ERROR: instruction requires: sme
130// CHECK-UNKNOWN: 68 56 d4 e0 <unknown>
131
132ld1d    za0h.d[w12, 0], p6/z, [x12, x2, lsl #3]
133// CHECK-INST: ld1d    {za0h.d[w12, 0]}, p6/z, [x12, x2, lsl #3]
134// CHECK-ENCODING: [0x80,0x19,0xc2,0xe0]
135// CHECK-ERROR: instruction requires: sme
136// CHECK-UNKNOWN: 80 19 c2 e0 <unknown>
137
138ld1d    za0h.d[w14, 1], p2/z, [x1, x26, lsl #3]
139// CHECK-INST: ld1d    {za0h.d[w14, 1]}, p2/z, [x1, x26, lsl #3]
140// CHECK-ENCODING: [0x21,0x48,0xda,0xe0]
141// CHECK-ERROR: instruction requires: sme
142// CHECK-UNKNOWN: 21 48 da e0 <unknown>
143
144ld1d    za6h.d[w12, 1], p2/z, [x22, x30, lsl #3]
145// CHECK-INST: ld1d    {za6h.d[w12, 1]}, p2/z, [x22, x30, lsl #3]
146// CHECK-ENCODING: [0xcd,0x0a,0xde,0xe0]
147// CHECK-ERROR: instruction requires: sme
148// CHECK-UNKNOWN: cd 0a de e0 <unknown>
149
150ld1d    za1h.d[w15, 0], p5/z, [x9, x1, lsl #3]
151// CHECK-INST: ld1d    {za1h.d[w15, 0]}, p5/z, [x9, x1, lsl #3]
152// CHECK-ENCODING: [0x22,0x75,0xc1,0xe0]
153// CHECK-ERROR: instruction requires: sme
154// CHECK-UNKNOWN: 22 75 c1 e0 <unknown>
155
156ld1d    za3h.d[w13, 1], p2/z, [x12, x11, lsl #3]
157// CHECK-INST: ld1d    {za3h.d[w13, 1]}, p2/z, [x12, x11, lsl #3]
158// CHECK-ENCODING: [0x87,0x29,0xcb,0xe0]
159// CHECK-ERROR: instruction requires: sme
160// CHECK-UNKNOWN: 87 29 cb e0 <unknown>
161
162// --------------------------------------------------------------------------//
163// Vertical
164
165ld1d    {za0v.d[w12, 0]}, p0/z, [x0, x0, lsl #3]
166// CHECK-INST: ld1d    {za0v.d[w12, 0]}, p0/z, [x0, x0, lsl #3]
167// CHECK-ENCODING: [0x00,0x80,0xc0,0xe0]
168// CHECK-ERROR: instruction requires: sme
169// CHECK-UNKNOWN: 00 80 c0 e0 <unknown>
170
171ld1d    {za2v.d[w14, 1]}, p5/z, [x10, x21, lsl #3]
172// CHECK-INST: ld1d    {za2v.d[w14, 1]}, p5/z, [x10, x21, lsl #3]
173// CHECK-ENCODING: [0x45,0xd5,0xd5,0xe0]
174// CHECK-ERROR: instruction requires: sme
175// CHECK-UNKNOWN: 45 d5 d5 e0 <unknown>
176
177ld1d    {za3v.d[w15, 1]}, p3/z, [x13, x8, lsl #3]
178// CHECK-INST: ld1d    {za3v.d[w15, 1]}, p3/z, [x13, x8, lsl #3]
179// CHECK-ENCODING: [0xa7,0xed,0xc8,0xe0]
180// CHECK-ERROR: instruction requires: sme
181// CHECK-UNKNOWN: a7 ed c8 e0 <unknown>
182
183ld1d    {za7v.d[w15, 1]}, p7/z, [sp]
184// CHECK-INST: ld1d    {za7v.d[w15, 1]}, p7/z, [sp]
185// CHECK-ENCODING: [0xef,0xff,0xdf,0xe0]
186// CHECK-ERROR: instruction requires: sme
187// CHECK-UNKNOWN: ef ff df e0 <unknown>
188
189ld1d    {za2v.d[w12, 1]}, p3/z, [x17, x16, lsl #3]
190// CHECK-INST: ld1d    {za2v.d[w12, 1]}, p3/z, [x17, x16, lsl #3]
191// CHECK-ENCODING: [0x25,0x8e,0xd0,0xe0]
192// CHECK-ERROR: instruction requires: sme
193// CHECK-UNKNOWN: 25 8e d0 e0 <unknown>
194
195ld1d    {za0v.d[w12, 1]}, p1/z, [x1, x30, lsl #3]
196// CHECK-INST: ld1d    {za0v.d[w12, 1]}, p1/z, [x1, x30, lsl #3]
197// CHECK-ENCODING: [0x21,0x84,0xde,0xe0]
198// CHECK-ERROR: instruction requires: sme
199// CHECK-UNKNOWN: 21 84 de e0 <unknown>
200
201ld1d    {za4v.d[w14, 0]}, p5/z, [x19, x20, lsl #3]
202// CHECK-INST: ld1d    {za4v.d[w14, 0]}, p5/z, [x19, x20, lsl #3]
203// CHECK-ENCODING: [0x68,0xd6,0xd4,0xe0]
204// CHECK-ERROR: instruction requires: sme
205// CHECK-UNKNOWN: 68 d6 d4 e0 <unknown>
206
207ld1d    {za0v.d[w12, 0]}, p6/z, [x12, x2, lsl #3]
208// CHECK-INST: ld1d    {za0v.d[w12, 0]}, p6/z, [x12, x2, lsl #3]
209// CHECK-ENCODING: [0x80,0x99,0xc2,0xe0]
210// CHECK-ERROR: instruction requires: sme
211// CHECK-UNKNOWN: 80 99 c2 e0 <unknown>
212
213ld1d    {za0v.d[w14, 1]}, p2/z, [x1, x26, lsl #3]
214// CHECK-INST: ld1d    {za0v.d[w14, 1]}, p2/z, [x1, x26, lsl #3]
215// CHECK-ENCODING: [0x21,0xc8,0xda,0xe0]
216// CHECK-ERROR: instruction requires: sme
217// CHECK-UNKNOWN: 21 c8 da e0 <unknown>
218
219ld1d    {za6v.d[w12, 1]}, p2/z, [x22, x30, lsl #3]
220// CHECK-INST: ld1d    {za6v.d[w12, 1]}, p2/z, [x22, x30, lsl #3]
221// CHECK-ENCODING: [0xcd,0x8a,0xde,0xe0]
222// CHECK-ERROR: instruction requires: sme
223// CHECK-UNKNOWN: cd 8a de e0 <unknown>
224
225ld1d    {za1v.d[w15, 0]}, p5/z, [x9, x1, lsl #3]
226// CHECK-INST: ld1d    {za1v.d[w15, 0]}, p5/z, [x9, x1, lsl #3]
227// CHECK-ENCODING: [0x22,0xf5,0xc1,0xe0]
228// CHECK-ERROR: instruction requires: sme
229// CHECK-UNKNOWN: 22 f5 c1 e0 <unknown>
230
231ld1d    {za3v.d[w13, 1]}, p2/z, [x12, x11, lsl #3]
232// CHECK-INST: ld1d    {za3v.d[w13, 1]}, p2/z, [x12, x11, lsl #3]
233// CHECK-ENCODING: [0x87,0xa9,0xcb,0xe0]
234// CHECK-ERROR: instruction requires: sme
235// CHECK-UNKNOWN: 87 a9 cb e0 <unknown>
236
237ld1d    za0v.d[w12, 0], p0/z, [x0, x0, lsl #3]
238// CHECK-INST: ld1d    {za0v.d[w12, 0]}, p0/z, [x0, x0, lsl #3]
239// CHECK-ENCODING: [0x00,0x80,0xc0,0xe0]
240// CHECK-ERROR: instruction requires: sme
241// CHECK-UNKNOWN: 00 80 c0 e0 <unknown>
242
243ld1d    za2v.d[w14, 1], p5/z, [x10, x21, lsl #3]
244// CHECK-INST: ld1d    {za2v.d[w14, 1]}, p5/z, [x10, x21, lsl #3]
245// CHECK-ENCODING: [0x45,0xd5,0xd5,0xe0]
246// CHECK-ERROR: instruction requires: sme
247// CHECK-UNKNOWN: 45 d5 d5 e0 <unknown>
248
249ld1d    za3v.d[w15, 1], p3/z, [x13, x8, lsl #3]
250// CHECK-INST: ld1d    {za3v.d[w15, 1]}, p3/z, [x13, x8, lsl #3]
251// CHECK-ENCODING: [0xa7,0xed,0xc8,0xe0]
252// CHECK-ERROR: instruction requires: sme
253// CHECK-UNKNOWN: a7 ed c8 e0 <unknown>
254
255ld1d    za7v.d[w15, 1], p7/z, [sp]
256// CHECK-INST: ld1d    {za7v.d[w15, 1]}, p7/z, [sp]
257// CHECK-ENCODING: [0xef,0xff,0xdf,0xe0]
258// CHECK-ERROR: instruction requires: sme
259// CHECK-UNKNOWN: ef ff df e0 <unknown>
260
261ld1d    za2v.d[w12, 1], p3/z, [x17, x16, lsl #3]
262// CHECK-INST: ld1d    {za2v.d[w12, 1]}, p3/z, [x17, x16, lsl #3]
263// CHECK-ENCODING: [0x25,0x8e,0xd0,0xe0]
264// CHECK-ERROR: instruction requires: sme
265// CHECK-UNKNOWN: 25 8e d0 e0 <unknown>
266
267ld1d    za0v.d[w12, 1], p1/z, [x1, x30, lsl #3]
268// CHECK-INST: ld1d    {za0v.d[w12, 1]}, p1/z, [x1, x30, lsl #3]
269// CHECK-ENCODING: [0x21,0x84,0xde,0xe0]
270// CHECK-ERROR: instruction requires: sme
271// CHECK-UNKNOWN: 21 84 de e0 <unknown>
272
273ld1d    za4v.d[w14, 0], p5/z, [x19, x20, lsl #3]
274// CHECK-INST: ld1d    {za4v.d[w14, 0]}, p5/z, [x19, x20, lsl #3]
275// CHECK-ENCODING: [0x68,0xd6,0xd4,0xe0]
276// CHECK-ERROR: instruction requires: sme
277// CHECK-UNKNOWN: 68 d6 d4 e0 <unknown>
278
279ld1d    za0v.d[w12, 0], p6/z, [x12, x2, lsl #3]
280// CHECK-INST: ld1d    {za0v.d[w12, 0]}, p6/z, [x12, x2, lsl #3]
281// CHECK-ENCODING: [0x80,0x99,0xc2,0xe0]
282// CHECK-ERROR: instruction requires: sme
283// CHECK-UNKNOWN: 80 99 c2 e0 <unknown>
284
285ld1d    za0v.d[w14, 1], p2/z, [x1, x26, lsl #3]
286// CHECK-INST: ld1d    {za0v.d[w14, 1]}, p2/z, [x1, x26, lsl #3]
287// CHECK-ENCODING: [0x21,0xc8,0xda,0xe0]
288// CHECK-ERROR: instruction requires: sme
289// CHECK-UNKNOWN: 21 c8 da e0 <unknown>
290
291ld1d    za6v.d[w12, 1], p2/z, [x22, x30, lsl #3]
292// CHECK-INST: ld1d    {za6v.d[w12, 1]}, p2/z, [x22, x30, lsl #3]
293// CHECK-ENCODING: [0xcd,0x8a,0xde,0xe0]
294// CHECK-ERROR: instruction requires: sme
295// CHECK-UNKNOWN: cd 8a de e0 <unknown>
296
297ld1d    za1v.d[w15, 0], p5/z, [x9, x1, lsl #3]
298// CHECK-INST: ld1d    {za1v.d[w15, 0]}, p5/z, [x9, x1, lsl #3]
299// CHECK-ENCODING: [0x22,0xf5,0xc1,0xe0]
300// CHECK-ERROR: instruction requires: sme
301// CHECK-UNKNOWN: 22 f5 c1 e0 <unknown>
302
303ld1d    za3v.d[w13, 1], p2/z, [x12, x11, lsl #3]
304// CHECK-INST: ld1d    {za3v.d[w13, 1]}, p2/z, [x12, x11, lsl #3]
305// CHECK-ENCODING: [0x87,0xa9,0xcb,0xe0]
306// CHECK-ERROR: instruction requires: sme
307// CHECK-UNKNOWN: 87 a9 cb e0 <unknown>
308