[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AArch64 / SVE / ptrue.s
blob2ee6c77ba650b2e3c32076a843384a7cace2a9aa
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
10 // ---------------------------------------------------------------------------//
11 // Test all predicate sizes for pow2 pattern
12 // ---------------------------------------------------------------------------//
14 ptrue p0.b, pow2
15 // CHECK-INST: ptrue p0.b, pow2
16 // CHECK-ENCODING: [0x00,0xe0,0x18,0x25]
17 // CHECK-ERROR: instruction requires: sve
18 // CHECK-UNKNOWN: 00 e0 18 25 <unknown>
20 ptrue p0.h, pow2
21 // CHECK-INST: ptrue p0.h, pow2
22 // CHECK-ENCODING: [0x00,0xe0,0x58,0x25]
23 // CHECK-ERROR: instruction requires: sve
24 // CHECK-UNKNOWN: 00 e0 58 25 <unknown>
26 ptrue p0.s, pow2
27 // CHECK-INST: ptrue p0.s, pow2
28 // CHECK-ENCODING: [0x00,0xe0,0x98,0x25]
29 // CHECK-ERROR: instruction requires: sve
30 // CHECK-UNKNOWN: 00 e0 98 25 <unknown>
32 ptrue p0.d, pow2
33 // CHECK-INST: ptrue p0.d, pow2
34 // CHECK-ENCODING: [0x00,0xe0,0xd8,0x25]
35 // CHECK-ERROR: instruction requires: sve
36 // CHECK-UNKNOWN: 00 e0 d8 25 <unknown>
38 // ---------------------------------------------------------------------------//
39 // Test all predicate sizes without explicit pattern
40 // ---------------------------------------------------------------------------//
42 ptrue p15.b
43 // CHECK-INST: ptrue p15.b
44 // CHECK-ENCODING: [0xef,0xe3,0x18,0x25]
45 // CHECK-ERROR: instruction requires: sve
46 // CHECK-UNKNOWN: ef e3 18 25 <unknown>
48 ptrue p15.h
49 // CHECK-INST: ptrue p15.h
50 // CHECK-ENCODING: [0xef,0xe3,0x58,0x25]
51 // CHECK-ERROR: instruction requires: sve
52 // CHECK-UNKNOWN: ef e3 58 25 <unknown>
54 ptrue p15.s
55 // CHECK-INST: ptrue p15.s
56 // CHECK-ENCODING: [0xef,0xe3,0x98,0x25]
57 // CHECK-ERROR: instruction requires: sve
58 // CHECK-UNKNOWN: ef e3 98 25 <unknown>
60 ptrue p15.d
61 // CHECK-INST: ptrue p15.d
62 // CHECK-ENCODING: [0xef,0xe3,0xd8,0x25]
63 // CHECK-ERROR: instruction requires: sve
64 // CHECK-UNKNOWN: ef e3 d8 25 <unknown>
66 // ---------------------------------------------------------------------------//
67 // Test available patterns
68 // ---------------------------------------------------------------------------//
70 ptrue p7.s, #1
71 // CHECK-INST: ptrue p7.s, vl1
72 // CHECK-ENCODING: [0x27,0xe0,0x98,0x25]
73 // CHECK-ERROR: instruction requires: sve
74 // CHECK-UNKNOWN: 27 e0 98 25 <unknown>
76 ptrue p7.s, vl1
77 // CHECK-INST: ptrue p7.s, vl1
78 // CHECK-ENCODING: [0x27,0xe0,0x98,0x25]
79 // CHECK-ERROR: instruction requires: sve
80 // CHECK-UNKNOWN: 27 e0 98 25 <unknown>
82 ptrue p7.s, vl2
83 // CHECK-INST: ptrue p7.s, vl2
84 // CHECK-ENCODING: [0x47,0xe0,0x98,0x25]
85 // CHECK-ERROR: instruction requires: sve
86 // CHECK-UNKNOWN: 47 e0 98 25 <unknown>
88 ptrue p7.s, vl3
89 // CHECK-INST: ptrue p7.s, vl3
90 // CHECK-ENCODING: [0x67,0xe0,0x98,0x25]
91 // CHECK-ERROR: instruction requires: sve
92 // CHECK-UNKNOWN: 67 e0 98 25 <unknown>
94 ptrue p7.s, vl4
95 // CHECK-INST: ptrue p7.s, vl4
96 // CHECK-ENCODING: [0x87,0xe0,0x98,0x25]
97 // CHECK-ERROR: instruction requires: sve
98 // CHECK-UNKNOWN: 87 e0 98 25 <unknown>
100 ptrue p7.s, vl5
101 // CHECK-INST: ptrue p7.s, vl5
102 // CHECK-ENCODING: [0xa7,0xe0,0x98,0x25]
103 // CHECK-ERROR: instruction requires: sve
104 // CHECK-UNKNOWN: a7 e0 98 25 <unknown>
106 ptrue p7.s, vl6
107 // CHECK-INST: ptrue p7.s, vl6
108 // CHECK-ENCODING: [0xc7,0xe0,0x98,0x25]
109 // CHECK-ERROR: instruction requires: sve
110 // CHECK-UNKNOWN: c7 e0 98 25 <unknown>
112 ptrue p7.s, vl7
113 // CHECK-INST: ptrue p7.s, vl7
114 // CHECK-ENCODING: [0xe7,0xe0,0x98,0x25]
115 // CHECK-ERROR: instruction requires: sve
116 // CHECK-UNKNOWN: e7 e0 98 25 <unknown>
118 ptrue p7.s, vl8
119 // CHECK-INST: ptrue p7.s, vl8
120 // CHECK-ENCODING: [0x07,0xe1,0x98,0x25]
121 // CHECK-ERROR: instruction requires: sve
122 // CHECK-UNKNOWN: 07 e1 98 25 <unknown>
124 ptrue p7.s, vl16
125 // CHECK-INST: ptrue p7.s, vl16
126 // CHECK-ENCODING: [0x27,0xe1,0x98,0x25]
127 // CHECK-ERROR: instruction requires: sve
128 // CHECK-UNKNOWN: 27 e1 98 25 <unknown>
130 ptrue p7.s, vl32
131 // CHECK-INST: ptrue p7.s, vl32
132 // CHECK-ENCODING: [0x47,0xe1,0x98,0x25]
133 // CHECK-ERROR: instruction requires: sve
134 // CHECK-UNKNOWN: 47 e1 98 25 <unknown>
136 ptrue p7.s, vl64
137 // CHECK-INST: ptrue p7.s, vl64
138 // CHECK-ENCODING: [0x67,0xe1,0x98,0x25]
139 // CHECK-ERROR: instruction requires: sve
140 // CHECK-UNKNOWN: 67 e1 98 25 <unknown>
142 ptrue p7.s, vl128
143 // CHECK-INST: ptrue p7.s, vl128
144 // CHECK-ENCODING: [0x87,0xe1,0x98,0x25]
145 // CHECK-ERROR: instruction requires: sve
146 // CHECK-UNKNOWN: 87 e1 98 25 <unknown>
148 ptrue p7.s, vl256
149 // CHECK-INST: ptrue p7.s, vl256
150 // CHECK-ENCODING: [0xa7,0xe1,0x98,0x25]
151 // CHECK-ERROR: instruction requires: sve
152 // CHECK-UNKNOWN: a7 e1 98 25 <unknown>
154 ptrue p7.s, mul4
155 // CHECK-INST: ptrue p7.s, mul4
156 // CHECK-ENCODING: [0xa7,0xe3,0x98,0x25]
157 // CHECK-ERROR: instruction requires: sve
158 // CHECK-UNKNOWN: a7 e3 98 25 <unknown>
160 ptrue p7.s, mul3
161 // CHECK-INST: ptrue p7.s, mul3
162 // CHECK-ENCODING: [0xc7,0xe3,0x98,0x25]
163 // CHECK-ERROR: instruction requires: sve
164 // CHECK-UNKNOWN: c7 e3 98 25 <unknown>
166 ptrue p7.s, all
167 // CHECK-INST: ptrue p7.s
168 // CHECK-ENCODING: [0xe7,0xe3,0x98,0x25]
169 // CHECK-ERROR: instruction requires: sve
170 // CHECK-UNKNOWN: e7 e3 98 25 <unknown>
172 // ---------------------------------------------------------------------------//
173 // Test immediate values not corresponding to a named pattern
174 // ---------------------------------------------------------------------------//
176 ptrue p7.s, #14
177 // CHECK-INST: ptrue p7.s, #14
178 // CHECK-ENCODING: [0xc7,0xe1,0x98,0x25]
179 // CHECK-ERROR: instruction requires: sve
180 // CHECK-UNKNOWN: c7 e1 98 25 <unknown>
182 ptrue p7.s, #15
183 // CHECK-INST: ptrue p7.s, #15
184 // CHECK-ENCODING: [0xe7,0xe1,0x98,0x25]
185 // CHECK-ERROR: instruction requires: sve
186 // CHECK-UNKNOWN: e7 e1 98 25 <unknown>
188 ptrue p7.s, #16
189 // CHECK-INST: ptrue p7.s, #16
190 // CHECK-ENCODING: [0x07,0xe2,0x98,0x25]
191 // CHECK-ERROR: instruction requires: sve
192 // CHECK-UNKNOWN: 07 e2 98 25 <unknown>
194 ptrue p7.s, #17
195 // CHECK-INST: ptrue p7.s, #17
196 // CHECK-ENCODING: [0x27,0xe2,0x98,0x25]
197 // CHECK-ERROR: instruction requires: sve
198 // CHECK-UNKNOWN: 27 e2 98 25 <unknown>
200 ptrue p7.s, #18
201 // CHECK-INST: ptrue p7.s, #18
202 // CHECK-ENCODING: [0x47,0xe2,0x98,0x25]
203 // CHECK-ERROR: instruction requires: sve
204 // CHECK-UNKNOWN: 47 e2 98 25 <unknown>
206 ptrue p7.s, #19
207 // CHECK-INST: ptrue p7.s, #19
208 // CHECK-ENCODING: [0x67,0xe2,0x98,0x25]
209 // CHECK-ERROR: instruction requires: sve
210 // CHECK-UNKNOWN: 67 e2 98 25 <unknown>
212 ptrue p7.s, #20
213 // CHECK-INST: ptrue p7.s, #20
214 // CHECK-ENCODING: [0x87,0xe2,0x98,0x25]
215 // CHECK-ERROR: instruction requires: sve
216 // CHECK-UNKNOWN: 87 e2 98 25 <unknown>
218 ptrue p7.s, #21
219 // CHECK-INST: ptrue p7.s, #21
220 // CHECK-ENCODING: [0xa7,0xe2,0x98,0x25]
221 // CHECK-ERROR: instruction requires: sve
222 // CHECK-UNKNOWN: a7 e2 98 25 <unknown>
224 ptrue p7.s, #22
225 // CHECK-INST: ptrue p7.s, #22
226 // CHECK-ENCODING: [0xc7,0xe2,0x98,0x25]
227 // CHECK-ERROR: instruction requires: sve
228 // CHECK-UNKNOWN: c7 e2 98 25 <unknown>
230 ptrue p7.s, #23
231 // CHECK-INST: ptrue p7.s, #23
232 // CHECK-ENCODING: [0xe7,0xe2,0x98,0x25]
233 // CHECK-ERROR: instruction requires: sve
234 // CHECK-UNKNOWN: e7 e2 98 25 <unknown>
236 ptrue p7.s, #24
237 // CHECK-INST: ptrue p7.s, #24
238 // CHECK-ENCODING: [0x07,0xe3,0x98,0x25]
239 // CHECK-ERROR: instruction requires: sve
240 // CHECK-UNKNOWN: 07 e3 98 25 <unknown>
242 ptrue p7.s, #25
243 // CHECK-INST: ptrue p7.s, #25
244 // CHECK-ENCODING: [0x27,0xe3,0x98,0x25]
245 // CHECK-ERROR: instruction requires: sve
246 // CHECK-UNKNOWN: 27 e3 98 25 <unknown>
248 ptrue p7.s, #26
249 // CHECK-INST: ptrue p7.s, #26
250 // CHECK-ENCODING: [0x47,0xe3,0x98,0x25]
251 // CHECK-ERROR: instruction requires: sve
252 // CHECK-UNKNOWN: 47 e3 98 25 <unknown>
254 ptrue p7.s, #27
255 // CHECK-INST: ptrue p7.s, #27
256 // CHECK-ENCODING: [0x67,0xe3,0x98,0x25]
257 // CHECK-ERROR: instruction requires: sve
258 // CHECK-UNKNOWN: 67 e3 98 25 <unknown>
260 ptrue p7.s, #28
261 // CHECK-INST: ptrue p7.s, #28
262 // CHECK-ENCODING: [0x87,0xe3,0x98,0x25]
263 // CHECK-ERROR: instruction requires: sve
264 // CHECK-UNKNOWN: 87 e3 98 25 <unknown>