xref: /llvm-project/llvm/test/MC/AArch64/SVE/ptrues.s (revision 75cdab6dc2453a508157a9c383b93373a93078d6)
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=+sme < %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 --no-print-imm-hex -d --mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
9// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
10// RUN:   | llvm-objdump --no-print-imm-hex -d --mattr=-sve - | FileCheck %s --check-prefix=CHECK-UNKNOWN
11
12// ---------------------------------------------------------------------------//
13// Test all predicate sizes for pow2 pattern
14// ---------------------------------------------------------------------------//
15
16ptrues   p0.b, pow2
17// CHECK-INST: ptrues   p0.b, pow2
18// CHECK-ENCODING: [0x00,0xe0,0x19,0x25]
19// CHECK-ERROR: instruction requires: sve or sme
20// CHECK-UNKNOWN:	2519e000  <unknown>
21
22ptrues   p0.h, pow2
23// CHECK-INST: ptrues   p0.h, pow2
24// CHECK-ENCODING: [0x00,0xe0,0x59,0x25]
25// CHECK-ERROR: instruction requires: sve or sme
26// CHECK-UNKNOWN:	2559e000  <unknown>
27
28ptrues   p0.s, pow2
29// CHECK-INST: ptrues   p0.s, pow2
30// CHECK-ENCODING: [0x00,0xe0,0x99,0x25]
31// CHECK-ERROR: instruction requires: sve or sme
32// CHECK-UNKNOWN:	2599e000  <unknown>
33
34ptrues   p0.d, pow2
35// CHECK-INST: ptrues   p0.d, pow2
36// CHECK-ENCODING: [0x00,0xe0,0xd9,0x25]
37// CHECK-ERROR: instruction requires: sve or sme
38// CHECK-UNKNOWN:	25d9e000  <unknown>
39
40// ---------------------------------------------------------------------------//
41// Test all predicate sizes without explicit pattern
42// ---------------------------------------------------------------------------//
43
44ptrues   p15.b
45// CHECK-INST: ptrues   p15.b
46// CHECK-ENCODING: [0xef,0xe3,0x19,0x25]
47// CHECK-ERROR: instruction requires: sve or sme
48// CHECK-UNKNOWN:	2519e3ef  <unknown>
49
50ptrues   p15.h
51// CHECK-INST: ptrues   p15.h
52// CHECK-ENCODING: [0xef,0xe3,0x59,0x25]
53// CHECK-ERROR: instruction requires: sve or sme
54// CHECK-UNKNOWN:	2559e3ef  <unknown>
55
56ptrues   p15.s
57// CHECK-INST: ptrues   p15.s
58// CHECK-ENCODING: [0xef,0xe3,0x99,0x25]
59// CHECK-ERROR: instruction requires: sve or sme
60// CHECK-UNKNOWN:	2599e3ef  <unknown>
61
62ptrues   p15.d
63// CHECK-INST: ptrues   p15.d
64// CHECK-ENCODING: [0xef,0xe3,0xd9,0x25]
65// CHECK-ERROR: instruction requires: sve or sme
66// CHECK-UNKNOWN:	25d9e3ef  <unknown>
67
68// ---------------------------------------------------------------------------//
69// Test available patterns
70// ---------------------------------------------------------------------------//
71
72ptrues   p7.s, #1
73// CHECK-INST: ptrues   p7.s, vl1
74// CHECK-ENCODING: [0x27,0xe0,0x99,0x25]
75// CHECK-ERROR: instruction requires: sve or sme
76// CHECK-UNKNOWN:	2599e027  <unknown>
77
78ptrues   p7.s, vl1
79// CHECK-INST: ptrues   p7.s, vl1
80// CHECK-ENCODING: [0x27,0xe0,0x99,0x25]
81// CHECK-ERROR: instruction requires: sve or sme
82// CHECK-UNKNOWN:	2599e027  <unknown>
83
84ptrues   p7.s, vl2
85// CHECK-INST: ptrues   p7.s, vl2
86// CHECK-ENCODING: [0x47,0xe0,0x99,0x25]
87// CHECK-ERROR: instruction requires: sve or sme
88// CHECK-UNKNOWN:	2599e047  <unknown>
89
90ptrues   p7.s, vl3
91// CHECK-INST: ptrues   p7.s, vl3
92// CHECK-ENCODING: [0x67,0xe0,0x99,0x25]
93// CHECK-ERROR: instruction requires: sve or sme
94// CHECK-UNKNOWN:	2599e067  <unknown>
95
96ptrues   p7.s, vl4
97// CHECK-INST: ptrues   p7.s, vl4
98// CHECK-ENCODING: [0x87,0xe0,0x99,0x25]
99// CHECK-ERROR: instruction requires: sve or sme
100// CHECK-UNKNOWN:	2599e087  <unknown>
101
102ptrues   p7.s, vl5
103// CHECK-INST: ptrues   p7.s, vl5
104// CHECK-ENCODING: [0xa7,0xe0,0x99,0x25]
105// CHECK-ERROR: instruction requires: sve or sme
106// CHECK-UNKNOWN:	2599e0a7  <unknown>
107
108ptrues   p7.s, vl6
109// CHECK-INST: ptrues   p7.s, vl6
110// CHECK-ENCODING: [0xc7,0xe0,0x99,0x25]
111// CHECK-ERROR: instruction requires: sve or sme
112// CHECK-UNKNOWN:	2599e0c7  <unknown>
113
114ptrues   p7.s, vl7
115// CHECK-INST: ptrues   p7.s, vl7
116// CHECK-ENCODING: [0xe7,0xe0,0x99,0x25]
117// CHECK-ERROR: instruction requires: sve or sme
118// CHECK-UNKNOWN:	2599e0e7  <unknown>
119
120ptrues   p7.s, vl8
121// CHECK-INST: ptrues   p7.s, vl8
122// CHECK-ENCODING: [0x07,0xe1,0x99,0x25]
123// CHECK-ERROR: instruction requires: sve or sme
124// CHECK-UNKNOWN:	2599e107  <unknown>
125
126ptrues   p7.s, vl16
127// CHECK-INST: ptrues   p7.s, vl16
128// CHECK-ENCODING: [0x27,0xe1,0x99,0x25]
129// CHECK-ERROR: instruction requires: sve or sme
130// CHECK-UNKNOWN:	2599e127  <unknown>
131
132ptrues   p7.s, vl32
133// CHECK-INST: ptrues   p7.s, vl32
134// CHECK-ENCODING: [0x47,0xe1,0x99,0x25]
135// CHECK-ERROR: instruction requires: sve or sme
136// CHECK-UNKNOWN:	2599e147  <unknown>
137
138ptrues   p7.s, vl64
139// CHECK-INST: ptrues   p7.s, vl64
140// CHECK-ENCODING: [0x67,0xe1,0x99,0x25]
141// CHECK-ERROR: instruction requires: sve or sme
142// CHECK-UNKNOWN:	2599e167  <unknown>
143
144ptrues   p7.s, vl128
145// CHECK-INST: ptrues   p7.s, vl128
146// CHECK-ENCODING: [0x87,0xe1,0x99,0x25]
147// CHECK-ERROR: instruction requires: sve or sme
148// CHECK-UNKNOWN:	2599e187  <unknown>
149
150ptrues   p7.s, vl256
151// CHECK-INST: ptrues   p7.s, vl256
152// CHECK-ENCODING: [0xa7,0xe1,0x99,0x25]
153// CHECK-ERROR: instruction requires: sve or sme
154// CHECK-UNKNOWN:	2599e1a7  <unknown>
155
156ptrues   p7.s, mul4
157// CHECK-INST: ptrues   p7.s, mul4
158// CHECK-ENCODING: [0xa7,0xe3,0x99,0x25]
159// CHECK-ERROR: instruction requires: sve or sme
160// CHECK-UNKNOWN:	2599e3a7  <unknown>
161
162ptrues   p7.s, mul3
163// CHECK-INST: ptrues   p7.s, mul3
164// CHECK-ENCODING: [0xc7,0xe3,0x99,0x25]
165// CHECK-ERROR: instruction requires: sve or sme
166// CHECK-UNKNOWN:	2599e3c7  <unknown>
167
168ptrues   p7.s, all
169// CHECK-INST: ptrues   p7.s
170// CHECK-ENCODING: [0xe7,0xe3,0x99,0x25]
171// CHECK-ERROR: instruction requires: sve or sme
172// CHECK-UNKNOWN:	2599e3e7  <unknown>
173
174// ---------------------------------------------------------------------------//
175// Test immediate values not corresponding to a named pattern
176// ---------------------------------------------------------------------------//
177
178ptrues   p7.s, #14
179// CHECK-INST: ptrues   p7.s, #14
180// CHECK-ENCODING: [0xc7,0xe1,0x99,0x25]
181// CHECK-ERROR: instruction requires: sve or sme
182// CHECK-UNKNOWN: 2599e1c7 <unknown>
183
184ptrues   p7.s, #15
185// CHECK-INST: ptrues   p7.s, #15
186// CHECK-ENCODING: [0xe7,0xe1,0x99,0x25]
187// CHECK-ERROR: instruction requires: sve or sme
188// CHECK-UNKNOWN: 2599e1e7 <unknown>
189
190ptrues   p7.s, #16
191// CHECK-INST: ptrues   p7.s, #16
192// CHECK-ENCODING: [0x07,0xe2,0x99,0x25]
193// CHECK-ERROR: instruction requires: sve or sme
194// CHECK-UNKNOWN: 2599e207 <unknown>
195
196ptrues   p7.s, #17
197// CHECK-INST: ptrues   p7.s, #17
198// CHECK-ENCODING: [0x27,0xe2,0x99,0x25]
199// CHECK-ERROR: instruction requires: sve or sme
200// CHECK-UNKNOWN: 2599e227 <unknown>
201
202ptrues   p7.s, #18
203// CHECK-INST: ptrues   p7.s, #18
204// CHECK-ENCODING: [0x47,0xe2,0x99,0x25]
205// CHECK-ERROR: instruction requires: sve or sme
206// CHECK-UNKNOWN: 2599e247 <unknown>
207
208ptrues   p7.s, #19
209// CHECK-INST: ptrues   p7.s, #19
210// CHECK-ENCODING: [0x67,0xe2,0x99,0x25]
211// CHECK-ERROR: instruction requires: sve or sme
212// CHECK-UNKNOWN: 2599e267 <unknown>
213
214ptrues   p7.s, #20
215// CHECK-INST: ptrues   p7.s, #20
216// CHECK-ENCODING: [0x87,0xe2,0x99,0x25]
217// CHECK-ERROR: instruction requires: sve or sme
218// CHECK-UNKNOWN: 2599e287 <unknown>
219
220ptrues   p7.s, #21
221// CHECK-INST: ptrues   p7.s, #21
222// CHECK-ENCODING: [0xa7,0xe2,0x99,0x25]
223// CHECK-ERROR: instruction requires: sve or sme
224// CHECK-UNKNOWN: 2599e2a7 <unknown>
225
226ptrues   p7.s, #22
227// CHECK-INST: ptrues   p7.s, #22
228// CHECK-ENCODING: [0xc7,0xe2,0x99,0x25]
229// CHECK-ERROR: instruction requires: sve or sme
230// CHECK-UNKNOWN: 2599e2c7 <unknown>
231
232ptrues   p7.s, #23
233// CHECK-INST: ptrues   p7.s, #23
234// CHECK-ENCODING: [0xe7,0xe2,0x99,0x25]
235// CHECK-ERROR: instruction requires: sve or sme
236// CHECK-UNKNOWN: 2599e2e7 <unknown>
237
238ptrues   p7.s, #24
239// CHECK-INST: ptrues   p7.s, #24
240// CHECK-ENCODING: [0x07,0xe3,0x99,0x25]
241// CHECK-ERROR: instruction requires: sve or sme
242// CHECK-UNKNOWN: 2599e307 <unknown>
243
244ptrues   p7.s, #25
245// CHECK-INST: ptrues   p7.s, #25
246// CHECK-ENCODING: [0x27,0xe3,0x99,0x25]
247// CHECK-ERROR: instruction requires: sve or sme
248// CHECK-UNKNOWN: 2599e327 <unknown>
249
250ptrues   p7.s, #26
251// CHECK-INST: ptrues   p7.s, #26
252// CHECK-ENCODING: [0x47,0xe3,0x99,0x25]
253// CHECK-ERROR: instruction requires: sve or sme
254// CHECK-UNKNOWN: 2599e347 <unknown>
255
256ptrues   p7.s, #27
257// CHECK-INST: ptrues   p7.s, #27
258// CHECK-ENCODING: [0x67,0xe3,0x99,0x25]
259// CHECK-ERROR: instruction requires: sve or sme
260// CHECK-UNKNOWN: 2599e367 <unknown>
261
262ptrues   p7.s, #28
263// CHECK-INST: ptrues   p7.s, #28
264// CHECK-ENCODING: [0x87,0xe3,0x99,0x25]
265// CHECK-ERROR: instruction requires: sve or sme
266// CHECK-UNKNOWN: 2599e387 <unknown>
267