1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \
6// RUN:        | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
8// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
9
10lsl     z0.b, z0.b, #0
11// CHECK-INST: lsl	z0.b, z0.b, #0
12// CHECK-ENCODING: [0x00,0x9c,0x28,0x04]
13// CHECK-ERROR: instruction requires: sve
14// CHECK-UNKNOWN: 00 9c 28 04 <unknown>
15
16lsl     z31.b, z31.b, #7
17// CHECK-INST: lsl	z31.b, z31.b, #7
18// CHECK-ENCODING: [0xff,0x9f,0x2f,0x04]
19// CHECK-ERROR: instruction requires: sve
20// CHECK-UNKNOWN: ff 9f 2f 04 <unknown>
21
22lsl     z0.h, z0.h, #0
23// CHECK-INST: lsl	z0.h, z0.h, #0
24// CHECK-ENCODING: [0x00,0x9c,0x30,0x04]
25// CHECK-ERROR: instruction requires: sve
26// CHECK-UNKNOWN: 00 9c 30 04 <unknown>
27
28lsl     z31.h, z31.h, #15
29// CHECK-INST: lsl	z31.h, z31.h, #15
30// CHECK-ENCODING: [0xff,0x9f,0x3f,0x04]
31// CHECK-ERROR: instruction requires: sve
32// CHECK-UNKNOWN: ff 9f 3f 04 <unknown>
33
34lsl     z0.s, z0.s, #0
35// CHECK-INST: lsl	z0.s, z0.s, #0
36// CHECK-ENCODING: [0x00,0x9c,0x60,0x04]
37// CHECK-ERROR: instruction requires: sve
38// CHECK-UNKNOWN: 00 9c 60 04 <unknown>
39
40lsl     z31.s, z31.s, #31
41// CHECK-INST: lsl	z31.s, z31.s, #31
42// CHECK-ENCODING: [0xff,0x9f,0x7f,0x04]
43// CHECK-ERROR: instruction requires: sve
44// CHECK-UNKNOWN: ff 9f 7f 04 <unknown>
45
46lsl     z0.d, z0.d, #0
47// CHECK-INST: lsl	z0.d, z0.d, #0
48// CHECK-ENCODING: [0x00,0x9c,0xa0,0x04]
49// CHECK-ERROR: instruction requires: sve
50// CHECK-UNKNOWN: 00 9c a0 04 <unknown>
51
52lsl     z31.d, z31.d, #63
53// CHECK-INST: lsl	z31.d, z31.d, #63
54// CHECK-ENCODING: [0xff,0x9f,0xff,0x04]
55// CHECK-ERROR: instruction requires: sve
56// CHECK-UNKNOWN: ff 9f ff 04 <unknown>
57
58lsl     z0.b, p0/m, z0.b, #0
59// CHECK-INST: lsl	z0.b, p0/m, z0.b, #0
60// CHECK-ENCODING: [0x00,0x81,0x03,0x04]
61// CHECK-ERROR: instruction requires: sve
62// CHECK-UNKNOWN: 00 81 03 04 <unknown>
63
64lsl     z31.b, p0/m, z31.b, #7
65// CHECK-INST: lsl	z31.b, p0/m, z31.b, #7
66// CHECK-ENCODING: [0xff,0x81,0x03,0x04]
67// CHECK-ERROR: instruction requires: sve
68// CHECK-UNKNOWN: ff 81 03 04 <unknown>
69
70lsl     z0.h, p0/m, z0.h, #0
71// CHECK-INST: lsl	z0.h, p0/m, z0.h, #0
72// CHECK-ENCODING: [0x00,0x82,0x03,0x04]
73// CHECK-ERROR: instruction requires: sve
74// CHECK-UNKNOWN: 00 82 03 04 <unknown>
75
76lsl     z31.h, p0/m, z31.h, #15
77// CHECK-INST: lsl	z31.h, p0/m, z31.h, #15
78// CHECK-ENCODING: [0xff,0x83,0x03,0x04]
79// CHECK-ERROR: instruction requires: sve
80// CHECK-UNKNOWN: ff 83 03 04 <unknown>
81
82lsl     z0.s, p0/m, z0.s, #0
83// CHECK-INST: lsl	z0.s, p0/m, z0.s, #0
84// CHECK-ENCODING: [0x00,0x80,0x43,0x04]
85// CHECK-ERROR: instruction requires: sve
86// CHECK-UNKNOWN: 00 80 43 04 <unknown>
87
88lsl     z31.s, p0/m, z31.s, #31
89// CHECK-INST: lsl	z31.s, p0/m, z31.s, #31
90// CHECK-ENCODING: [0xff,0x83,0x43,0x04]
91// CHECK-ERROR: instruction requires: sve
92// CHECK-UNKNOWN: ff 83 43 04 <unknown>
93
94lsl     z0.d, p0/m, z0.d, #0
95// CHECK-INST: lsl	z0.d, p0/m, z0.d, #0
96// CHECK-ENCODING: [0x00,0x80,0x83,0x04]
97// CHECK-ERROR: instruction requires: sve
98// CHECK-UNKNOWN: 00 80 83 04 <unknown>
99
100lsl     z31.d, p0/m, z31.d, #63
101// CHECK-INST: lsl	z31.d, p0/m, z31.d, #63
102// CHECK-ENCODING: [0xff,0x83,0xc3,0x04]
103// CHECK-ERROR: instruction requires: sve
104// CHECK-UNKNOWN: ff 83 c3 04 <unknown>
105
106lsl     z0.b, p0/m, z0.b, z0.b
107// CHECK-INST: lsl	z0.b, p0/m, z0.b, z0.b
108// CHECK-ENCODING: [0x00,0x80,0x13,0x04]
109// CHECK-ERROR: instruction requires: sve
110// CHECK-UNKNOWN: 00 80 13 04 <unknown>
111
112lsl     z0.h, p0/m, z0.h, z0.h
113// CHECK-INST: lsl	z0.h, p0/m, z0.h, z0.h
114// CHECK-ENCODING: [0x00,0x80,0x53,0x04]
115// CHECK-ERROR: instruction requires: sve
116// CHECK-UNKNOWN: 00 80 53 04 <unknown>
117
118lsl     z0.s, p0/m, z0.s, z0.s
119// CHECK-INST: lsl	z0.s, p0/m, z0.s, z0.s
120// CHECK-ENCODING: [0x00,0x80,0x93,0x04]
121// CHECK-ERROR: instruction requires: sve
122// CHECK-UNKNOWN: 00 80 93 04 <unknown>
123
124lsl     z0.d, p0/m, z0.d, z0.d
125// CHECK-INST: lsl	z0.d, p0/m, z0.d, z0.d
126// CHECK-ENCODING: [0x00,0x80,0xd3,0x04]
127// CHECK-ERROR: instruction requires: sve
128// CHECK-UNKNOWN: 00 80 d3 04 <unknown>
129
130lsl     z0.b, p0/m, z0.b, z1.d
131// CHECK-INST: lsl	z0.b, p0/m, z0.b, z1.d
132// CHECK-ENCODING: [0x20,0x80,0x1b,0x04]
133// CHECK-ERROR: instruction requires: sve
134// CHECK-UNKNOWN: 20 80 1b 04 <unknown>
135
136lsl     z0.h, p0/m, z0.h, z1.d
137// CHECK-INST: lsl	z0.h, p0/m, z0.h, z1.d
138// CHECK-ENCODING: [0x20,0x80,0x5b,0x04]
139// CHECK-ERROR: instruction requires: sve
140// CHECK-UNKNOWN: 20 80 5b 04 <unknown>
141
142lsl     z0.s, p0/m, z0.s, z1.d
143// CHECK-INST: lsl	z0.s, p0/m, z0.s, z1.d
144// CHECK-ENCODING: [0x20,0x80,0x9b,0x04]
145// CHECK-ERROR: instruction requires: sve
146// CHECK-UNKNOWN: 20 80 9b 04 <unknown>
147
148lsl     z0.b, z1.b, z2.d
149// CHECK-INST: lsl	z0.b, z1.b, z2.d
150// CHECK-ENCODING: [0x20,0x8c,0x22,0x04]
151// CHECK-ERROR: instruction requires: sve
152// CHECK-UNKNOWN: 20 8c 22 04 <unknown>
153
154lsl     z0.h, z1.h, z2.d
155// CHECK-INST: lsl	z0.h, z1.h, z2.d
156// CHECK-ENCODING: [0x20,0x8c,0x62,0x04]
157// CHECK-ERROR: instruction requires: sve
158// CHECK-UNKNOWN: 20 8c 62 04 <unknown>
159
160lsl     z0.s, z1.s, z2.d
161// CHECK-INST: lsl	z0.s, z1.s, z2.d
162// CHECK-ENCODING: [0x20,0x8c,0xa2,0x04]
163// CHECK-ERROR: instruction requires: sve
164// CHECK-UNKNOWN: 20 8c a2 04 <unknown>
165
166
167// --------------------------------------------------------------------------//
168// Test compatibility with MOVPRFX instruction.
169
170movprfx z31.d, p0/z, z6.d
171// CHECK-INST: movprfx	z31.d, p0/z, z6.d
172// CHECK-ENCODING: [0xdf,0x20,0xd0,0x04]
173// CHECK-ERROR: instruction requires: sve
174// CHECK-UNKNOWN: df 20 d0 04 <unknown>
175
176lsl     z31.d, p0/m, z31.d, #63
177// CHECK-INST: lsl	z31.d, p0/m, z31.d, #63
178// CHECK-ENCODING: [0xff,0x83,0xc3,0x04]
179// CHECK-ERROR: instruction requires: sve
180// CHECK-UNKNOWN: ff 83 c3 04 <unknown>
181
182movprfx z31, z6
183// CHECK-INST: movprfx	z31, z6
184// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
185// CHECK-ERROR: instruction requires: sve
186// CHECK-UNKNOWN: df bc 20 04 <unknown>
187
188lsl     z31.d, p0/m, z31.d, #63
189// CHECK-INST: lsl	z31.d, p0/m, z31.d, #63
190// CHECK-ENCODING: [0xff,0x83,0xc3,0x04]
191// CHECK-ERROR: instruction requires: sve
192// CHECK-UNKNOWN: ff 83 c3 04 <unknown>
193
194movprfx z0.s, p0/z, z7.s
195// CHECK-INST: movprfx	z0.s, p0/z, z7.s
196// CHECK-ENCODING: [0xe0,0x20,0x90,0x04]
197// CHECK-ERROR: instruction requires: sve
198// CHECK-UNKNOWN: e0 20 90 04 <unknown>
199
200lsl     z0.s, p0/m, z0.s, z1.d
201// CHECK-INST: lsl	z0.s, p0/m, z0.s, z1.d
202// CHECK-ENCODING: [0x20,0x80,0x9b,0x04]
203// CHECK-ERROR: instruction requires: sve
204// CHECK-UNKNOWN: 20 80 9b 04 <unknown>
205
206movprfx z0, z7
207// CHECK-INST: movprfx	z0, z7
208// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04]
209// CHECK-ERROR: instruction requires: sve
210// CHECK-UNKNOWN: e0 bc 20 04 <unknown>
211
212lsl     z0.s, p0/m, z0.s, z1.d
213// CHECK-INST: lsl	z0.s, p0/m, z0.s, z1.d
214// CHECK-ENCODING: [0x20,0x80,0x9b,0x04]
215// CHECK-ERROR: instruction requires: sve
216// CHECK-UNKNOWN: 20 80 9b 04 <unknown>
217