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
10lsr     z0.b, z0.b, #1
11// CHECK-INST: lsr	z0.b, z0.b, #1
12// CHECK-ENCODING: [0x00,0x94,0x2f,0x04]
13// CHECK-ERROR: instruction requires: sve
14// CHECK-UNKNOWN: 00 94 2f 04 <unknown>
15
16lsr     z31.b, z31.b, #8
17// CHECK-INST: lsr	z31.b, z31.b, #8
18// CHECK-ENCODING: [0xff,0x97,0x28,0x04]
19// CHECK-ERROR: instruction requires: sve
20// CHECK-UNKNOWN: ff 97 28 04 <unknown>
21
22lsr     z0.h, z0.h, #1
23// CHECK-INST: lsr	z0.h, z0.h, #1
24// CHECK-ENCODING: [0x00,0x94,0x3f,0x04]
25// CHECK-ERROR: instruction requires: sve
26// CHECK-UNKNOWN: 00 94 3f 04 <unknown>
27
28lsr     z31.h, z31.h, #16
29// CHECK-INST: lsr	z31.h, z31.h, #16
30// CHECK-ENCODING: [0xff,0x97,0x30,0x04]
31// CHECK-ERROR: instruction requires: sve
32// CHECK-UNKNOWN: ff 97 30 04 <unknown>
33
34lsr     z0.s, z0.s, #1
35// CHECK-INST: lsr	z0.s, z0.s, #1
36// CHECK-ENCODING: [0x00,0x94,0x7f,0x04]
37// CHECK-ERROR: instruction requires: sve
38// CHECK-UNKNOWN: 00 94 7f 04 <unknown>
39
40lsr     z31.s, z31.s, #32
41// CHECK-INST: lsr	z31.s, z31.s, #32
42// CHECK-ENCODING: [0xff,0x97,0x60,0x04]
43// CHECK-ERROR: instruction requires: sve
44// CHECK-UNKNOWN: ff 97 60 04 <unknown>
45
46lsr     z0.d, z0.d, #1
47// CHECK-INST: lsr	z0.d, z0.d, #1
48// CHECK-ENCODING: [0x00,0x94,0xff,0x04]
49// CHECK-ERROR: instruction requires: sve
50// CHECK-UNKNOWN: 00 94 ff 04 <unknown>
51
52lsr     z31.d, z31.d, #64
53// CHECK-INST: lsr	z31.d, z31.d, #64
54// CHECK-ENCODING: [0xff,0x97,0xa0,0x04]
55// CHECK-ERROR: instruction requires: sve
56// CHECK-UNKNOWN: ff 97 a0 04 <unknown>
57
58lsr     z0.b, p0/m, z0.b, #1
59// CHECK-INST: lsr	z0.b, p0/m, z0.b, #1
60// CHECK-ENCODING: [0xe0,0x81,0x01,0x04]
61// CHECK-ERROR: instruction requires: sve
62// CHECK-UNKNOWN: e0 81 01 04 <unknown>
63
64lsr     z31.b, p0/m, z31.b, #8
65// CHECK-INST: lsr	z31.b, p0/m, z31.b, #8
66// CHECK-ENCODING: [0x1f,0x81,0x01,0x04]
67// CHECK-ERROR: instruction requires: sve
68// CHECK-UNKNOWN: 1f 81 01 04 <unknown>
69
70lsr     z0.h, p0/m, z0.h, #1
71// CHECK-INST: lsr	z0.h, p0/m, z0.h, #1
72// CHECK-ENCODING: [0xe0,0x83,0x01,0x04]
73// CHECK-ERROR: instruction requires: sve
74// CHECK-UNKNOWN: e0 83 01 04 <unknown>
75
76lsr     z31.h, p0/m, z31.h, #16
77// CHECK-INST: lsr	z31.h, p0/m, z31.h, #16
78// CHECK-ENCODING: [0x1f,0x82,0x01,0x04]
79// CHECK-ERROR: instruction requires: sve
80// CHECK-UNKNOWN: 1f 82 01 04 <unknown>
81
82lsr     z0.s, p0/m, z0.s, #1
83// CHECK-INST: lsr	z0.s, p0/m, z0.s, #1
84// CHECK-ENCODING: [0xe0,0x83,0x41,0x04]
85// CHECK-ERROR: instruction requires: sve
86// CHECK-UNKNOWN: e0 83 41 04 <unknown>
87
88lsr     z31.s, p0/m, z31.s, #32
89// CHECK-INST: lsr	z31.s, p0/m, z31.s, #32
90// CHECK-ENCODING: [0x1f,0x80,0x41,0x04]
91// CHECK-ERROR: instruction requires: sve
92// CHECK-UNKNOWN: 1f 80 41 04 <unknown>
93
94lsr     z0.d, p0/m, z0.d, #1
95// CHECK-INST: lsr	z0.d, p0/m, z0.d, #1
96// CHECK-ENCODING: [0xe0,0x83,0xc1,0x04]
97// CHECK-ERROR: instruction requires: sve
98// CHECK-UNKNOWN: e0 83 c1 04 <unknown>
99
100lsr     z31.d, p0/m, z31.d, #64
101// CHECK-INST: lsr	z31.d, p0/m, z31.d, #64
102// CHECK-ENCODING: [0x1f,0x80,0x81,0x04]
103// CHECK-ERROR: instruction requires: sve
104// CHECK-UNKNOWN: 1f 80 81 04 <unknown>
105
106lsr     z0.b, p0/m, z0.b, z0.b
107// CHECK-INST: lsr	z0.b, p0/m, z0.b, z0.b
108// CHECK-ENCODING: [0x00,0x80,0x11,0x04]
109// CHECK-ERROR: instruction requires: sve
110// CHECK-UNKNOWN: 00 80 11 04 <unknown>
111
112lsr     z0.h, p0/m, z0.h, z0.h
113// CHECK-INST: lsr	z0.h, p0/m, z0.h, z0.h
114// CHECK-ENCODING: [0x00,0x80,0x51,0x04]
115// CHECK-ERROR: instruction requires: sve
116// CHECK-UNKNOWN: 00 80 51 04 <unknown>
117
118lsr     z0.s, p0/m, z0.s, z0.s
119// CHECK-INST: lsr	z0.s, p0/m, z0.s, z0.s
120// CHECK-ENCODING: [0x00,0x80,0x91,0x04]
121// CHECK-ERROR: instruction requires: sve
122// CHECK-UNKNOWN: 00 80 91 04 <unknown>
123
124lsr     z0.d, p0/m, z0.d, z0.d
125// CHECK-INST: lsr	z0.d, p0/m, z0.d, z0.d
126// CHECK-ENCODING: [0x00,0x80,0xd1,0x04]
127// CHECK-ERROR: instruction requires: sve
128// CHECK-UNKNOWN: 00 80 d1 04 <unknown>
129
130lsr     z0.b, p0/m, z0.b, z1.d
131// CHECK-INST: lsr	z0.b, p0/m, z0.b, z1.d
132// CHECK-ENCODING: [0x20,0x80,0x19,0x04]
133// CHECK-ERROR: instruction requires: sve
134// CHECK-UNKNOWN: 20 80 19 04 <unknown>
135
136lsr     z0.h, p0/m, z0.h, z1.d
137// CHECK-INST: lsr	z0.h, p0/m, z0.h, z1.d
138// CHECK-ENCODING: [0x20,0x80,0x59,0x04]
139// CHECK-ERROR: instruction requires: sve
140// CHECK-UNKNOWN: 20 80 59 04 <unknown>
141
142lsr     z0.s, p0/m, z0.s, z1.d
143// CHECK-INST: lsr	z0.s, p0/m, z0.s, z1.d
144// CHECK-ENCODING: [0x20,0x80,0x99,0x04]
145// CHECK-ERROR: instruction requires: sve
146// CHECK-UNKNOWN: 20 80 99 04 <unknown>
147
148lsr     z0.b, z1.b, z2.d
149// CHECK-INST: lsr	z0.b, z1.b, z2.d
150// CHECK-ENCODING: [0x20,0x84,0x22,0x04]
151// CHECK-ERROR: instruction requires: sve
152// CHECK-UNKNOWN: 20 84 22 04 <unknown>
153
154lsr     z0.h, z1.h, z2.d
155// CHECK-INST: lsr	z0.h, z1.h, z2.d
156// CHECK-ENCODING: [0x20,0x84,0x62,0x04]
157// CHECK-ERROR: instruction requires: sve
158// CHECK-UNKNOWN: 20 84 62 04 <unknown>
159
160lsr     z0.s, z1.s, z2.d
161// CHECK-INST: lsr	z0.s, z1.s, z2.d
162// CHECK-ENCODING: [0x20,0x84,0xa2,0x04]
163// CHECK-ERROR: instruction requires: sve
164// CHECK-UNKNOWN: 20 84 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
176lsr     z31.d, p0/m, z31.d, #64
177// CHECK-INST: lsr	z31.d, p0/m, z31.d, #64
178// CHECK-ENCODING: [0x1f,0x80,0x81,0x04]
179// CHECK-ERROR: instruction requires: sve
180// CHECK-UNKNOWN: 1f 80 81 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
188lsr     z31.d, p0/m, z31.d, #64
189// CHECK-INST: lsr	z31.d, p0/m, z31.d, #64
190// CHECK-ENCODING: [0x1f,0x80,0x81,0x04]
191// CHECK-ERROR: instruction requires: sve
192// CHECK-UNKNOWN: 1f 80 81 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
200lsr     z0.s, p0/m, z0.s, z1.d
201// CHECK-INST: lsr	z0.s, p0/m, z0.s, z1.d
202// CHECK-ENCODING: [0x20,0x80,0x99,0x04]
203// CHECK-ERROR: instruction requires: sve
204// CHECK-UNKNOWN: 20 80 99 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
212lsr     z0.s, p0/m, z0.s, z1.d
213// CHECK-INST: lsr	z0.s, p0/m, z0.s, z1.d
214// CHECK-ENCODING: [0x20,0x80,0x99,0x04]
215// CHECK-ERROR: instruction requires: sve
216// CHECK-UNKNOWN: 20 80 99 04 <unknown>
217