1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
2// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve < %s \
4// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
5// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
6// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
8// RUN:        | llvm-objdump -d --mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
9// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
10// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11
12// --------------------------------------------------------------------------//
13// Index (immediate, immediate)
14
15index   z0.b, #0, #0
16// CHECK-INST: index   z0.b, #0, #0
17// CHECK-ENCODING: [0x00,0x40,0x20,0x04]
18// CHECK-ERROR: instruction requires: streaming-sve or sve
19// CHECK-UNKNOWN: 00 40 20 04 <unknown>
20
21index   z31.b, #-1, #-1
22// CHECK-INST: index   z31.b, #-1, #-1
23// CHECK-ENCODING: [0xff,0x43,0x3f,0x04]
24// CHECK-ERROR: instruction requires: streaming-sve or sve
25// CHECK-UNKNOWN: ff 43 3f 04 <unknown>
26
27index   z0.h, #0, #0
28// CHECK-INST: index   z0.h, #0, #0
29// CHECK-ENCODING: [0x00,0x40,0x60,0x04]
30// CHECK-ERROR: instruction requires: streaming-sve or sve
31// CHECK-UNKNOWN: 00 40 60 04 <unknown>
32
33index   z31.h, #-1, #-1
34// CHECK-INST: index   z31.h, #-1, #-1
35// CHECK-ENCODING: [0xff,0x43,0x7f,0x04]
36// CHECK-ERROR: instruction requires: streaming-sve or sve
37// CHECK-UNKNOWN: ff 43 7f 04 <unknown>
38
39index   z0.s, #0, #0
40// CHECK-INST: index   z0.s, #0, #0
41// CHECK-ENCODING: [0x00,0x40,0xa0,0x04]
42// CHECK-ERROR: instruction requires: streaming-sve or sve
43// CHECK-UNKNOWN: 00 40 a0 04 <unknown>
44
45index   z31.s, #-1, #-1
46// CHECK-INST: index   z31.s, #-1, #-1
47// CHECK-ENCODING: [0xff,0x43,0xbf,0x04]
48// CHECK-ERROR: instruction requires: streaming-sve or sve
49// CHECK-UNKNOWN: ff 43 bf 04 <unknown>
50
51index   z0.d, #0, #0
52// CHECK-INST: index   z0.d, #0, #0
53// CHECK-ENCODING: [0x00,0x40,0xe0,0x04]
54// CHECK-ERROR: instruction requires: streaming-sve or sve
55// CHECK-UNKNOWN: 00 40 e0 04 <unknown>
56
57index   z31.d, #-1, #-1
58// CHECK-INST: index   z31.d, #-1, #-1
59// CHECK-ENCODING: [0xff,0x43,0xff,0x04]
60// CHECK-ERROR: instruction requires: streaming-sve or sve
61// CHECK-UNKNOWN: ff 43 ff 04 <unknown>
62
63// --------------------------------------------------------------------------//
64// Index (immediate, scalar)
65
66index   z31.b, #-1, wzr
67// CHECK-INST: index   z31.b, #-1, wzr
68// CHECK-ENCODING: [0xff,0x4b,0x3f,0x04]
69// CHECK-ERROR: instruction requires: streaming-sve or sve
70// CHECK-UNKNOWN: ff 4b 3f 04 <unknown>
71
72index   z23.b, #13, w8
73// CHECK-INST: index   z23.b, #13, w8
74// CHECK-ENCODING: [0xb7,0x49,0x28,0x04]
75// CHECK-ERROR: instruction requires: streaming-sve or sve
76// CHECK-UNKNOWN: b7 49 28 04 <unknown>
77
78index   z31.h, #-1, wzr
79// CHECK-INST: index   z31.h, #-1, wzr
80// CHECK-ENCODING: [0xff,0x4b,0x7f,0x04]
81// CHECK-ERROR: instruction requires: streaming-sve or sve
82// CHECK-UNKNOWN: ff 4b 7f 04 <unknown>
83
84index   z23.h, #13, w8
85// CHECK-INST: index   z23.h, #13, w8
86// CHECK-ENCODING: [0xb7,0x49,0x68,0x04]
87// CHECK-ERROR: instruction requires: streaming-sve or sve
88// CHECK-UNKNOWN: b7 49 68 04 <unknown>
89
90index   z31.s, #-1, wzr
91// CHECK-INST: index   z31.s, #-1, wzr
92// CHECK-ENCODING: [0xff,0x4b,0xbf,0x04]
93// CHECK-ERROR: instruction requires: streaming-sve or sve
94// CHECK-UNKNOWN: ff 4b bf 04 <unknown>
95
96index   z23.s, #13, w8
97// CHECK-INST: index   z23.s, #13, w8
98// CHECK-ENCODING: [0xb7,0x49,0xa8,0x04]
99// CHECK-ERROR: instruction requires: streaming-sve or sve
100// CHECK-UNKNOWN: b7 49 a8 04 <unknown>
101
102index   z31.d, #-1, xzr
103// CHECK-INST: index   z31.d, #-1, xzr
104// CHECK-ENCODING: [0xff,0x4b,0xff,0x04]
105// CHECK-ERROR: instruction requires: streaming-sve or sve
106// CHECK-UNKNOWN: ff 4b ff 04 <unknown>
107
108index   z23.d, #13, x8
109// CHECK-INST: index   z23.d, #13, x8
110// CHECK-ENCODING: [0xb7,0x49,0xe8,0x04]
111// CHECK-ERROR: instruction requires: streaming-sve or sve
112// CHECK-UNKNOWN: b7 49 e8 04 <unknown>
113
114
115// --------------------------------------------------------------------------//
116// Index (scalar, immediate)
117
118index   z31.b, wzr, #-1
119// CHECK-INST: index   z31.b, wzr, #-1
120// CHECK-ENCODING: [0xff,0x47,0x3f,0x04]
121// CHECK-ERROR: instruction requires: streaming-sve or sve
122// CHECK-UNKNOWN: ff 47 3f 04 <unknown>
123
124index   z23.b, w13, #8
125// CHECK-INST: index   z23.b, w13, #8
126// CHECK-ENCODING: [0xb7,0x45,0x28,0x04]
127// CHECK-ERROR: instruction requires: streaming-sve or sve
128// CHECK-UNKNOWN: b7 45 28 04 <unknown>
129
130index   z31.h, wzr, #-1
131// CHECK-INST: index   z31.h, wzr, #-1
132// CHECK-ENCODING: [0xff,0x47,0x7f,0x04]
133// CHECK-ERROR: instruction requires: streaming-sve or sve
134// CHECK-UNKNOWN: ff 47 7f 04 <unknown>
135
136index   z23.h, w13, #8
137// CHECK-INST: index   z23.h, w13, #8
138// CHECK-ENCODING: [0xb7,0x45,0x68,0x04]
139// CHECK-ERROR: instruction requires: streaming-sve or sve
140// CHECK-UNKNOWN: b7 45 68 04 <unknown>
141
142index   z31.s, wzr, #-1
143// CHECK-INST: index   z31.s, wzr, #-1
144// CHECK-ENCODING: [0xff,0x47,0xbf,0x04]
145// CHECK-ERROR: instruction requires: streaming-sve or sve
146// CHECK-UNKNOWN: ff 47 bf 04 <unknown>
147
148index   z23.s, w13, #8
149// CHECK-INST: index   z23.s, w13, #8
150// CHECK-ENCODING: [0xb7,0x45,0xa8,0x04]
151// CHECK-ERROR: instruction requires: streaming-sve or sve
152// CHECK-UNKNOWN: b7 45 a8 04 <unknown>
153
154index   z31.d, xzr, #-1
155// CHECK-INST: index   z31.d, xzr, #-1
156// CHECK-ENCODING: [0xff,0x47,0xff,0x04]
157// CHECK-ERROR: instruction requires: streaming-sve or sve
158// CHECK-UNKNOWN: ff 47 ff 04 <unknown>
159
160index   z23.d, x13, #8
161// CHECK-INST: index   z23.d, x13, #8
162// CHECK-ENCODING: [0xb7,0x45,0xe8,0x04]
163// CHECK-ERROR: instruction requires: streaming-sve or sve
164// CHECK-UNKNOWN: b7 45 e8 04 <unknown>
165
166
167// --------------------------------------------------------------------------//
168// Index (scalar, scalar)
169
170index   z31.b, wzr, wzr
171// CHECK-INST: index   z31.b, wzr, wzr
172// CHECK-ENCODING: [0xff,0x4f,0x3f,0x04]
173// CHECK-ERROR: instruction requires: streaming-sve or sve
174// CHECK-UNKNOWN: ff 4f 3f 04 <unknown>
175
176index   z21.b, w10, w21
177// CHECK-INST: index   z21.b, w10, w21
178// CHECK-ENCODING: [0x55,0x4d,0x35,0x04]
179// CHECK-ERROR: instruction requires: streaming-sve or sve
180// CHECK-UNKNOWN: 55 4d 35 04 <unknown>
181
182index   z31.h, wzr, wzr
183// check-inst: index   z31.h, wzr, wzr
184// check-encoding: [0xff,0x4f,0x7f,0x04]
185// check-error: instruction requires: streaming-sve or sve
186// check-unknown: ff 4f 7f 04 <unknown>
187
188index   z0.h, w0, w0
189// check-inst: index   z0.h, w0, w0
190// check-encoding: [0x00,0x4c,0x60,0x04]
191// check-error: instruction requires: streaming-sve or sve
192// check-unknown: 00 4c 60 04 <unknown>
193
194index   z31.s, wzr, wzr
195// CHECK-INST: index   z31.s, wzr, wzr
196// CHECK-ENCODING: [0xff,0x4f,0xbf,0x04]
197// CHECK-ERROR: instruction requires: streaming-sve or sve
198// CHECK-UNKNOWN: ff 4f bf 04 <unknown>
199
200index   z21.s, w10, w21
201// CHECK-INST: index   z21.s, w10, w21
202// CHECK-ENCODING: [0x55,0x4d,0xb5,0x04]
203// CHECK-ERROR: instruction requires: streaming-sve or sve
204// CHECK-UNKNOWN: 55 4d b5 04 <unknown>
205
206index   z31.d, xzr, xzr
207// CHECK-INST: index   z31.d, xzr, xzr
208// CHECK-ENCODING: [0xff,0x4f,0xff,0x04]
209// CHECK-ERROR: instruction requires: streaming-sve or sve
210// CHECK-UNKNOWN: ff 4f ff 04 <unknown>
211
212index   z21.d, x10, x21
213// CHECK-INST: index   z21.d, x10, x21
214// CHECK-ENCODING: [0x55,0x4d,0xf5,0x04]
215// CHECK-ERROR: instruction requires: streaming-sve or sve
216// CHECK-UNKNOWN: 55 4d f5 04 <unknown>
217