xref: /llvm-project/llvm/test/MC/AArch64/FP8/miscellaneous-fp8.s (revision 78941e1eedb121344e0d969458ea85598cd749df)
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+fp8 < %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=+fp8 < %s \
6// RUN:        | llvm-objdump -d --mattr=+fp8 - | FileCheck %s --check-prefix=CHECK-INST
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+fp8 < %s \
8// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
9// Disassemble encoding and check the re-encoding (-show-encoding) matches.
10// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+fp8 < %s \
11// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
12// RUN:        | llvm-mc -triple=aarch64 -mattr=+fp8 -disassemble -show-encoding \
13// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
14
15///
16/// BF1CVTL instructions.
17///
18bf1cvtl v0.8h, v0.8b
19// CHECK-INST: bf1cvtl v0.8h, v0.8b
20// CHECK-ENCODING: [0x00,0x78,0xa1,0x2e]
21// CHECK-ERROR: instruction requires: fp8
22// CHECK-UNKNOWN: 2ea17800 <unknown>
23
24bf1cvtl v0.8h, v31.8b
25// CHECK-INST: bf1cvtl v0.8h, v31.8b
26// CHECK-ENCODING: [0xe0,0x7b,0xa1,0x2e]
27// CHECK-ERROR: instruction requires: fp8
28// CHECK-UNKNOWN: 2ea17be0 <unknown>
29
30bf1cvtl v31.8h, v31.8b
31// CHECK-INST: bf1cvtl v31.8h, v31.8b
32// CHECK-ENCODING: [0xff,0x7b,0xa1,0x2e]
33// CHECK-ERROR: instruction requires: fp8
34// CHECK-UNKNOWN: 2ea17bff <unknown>
35
36///
37/// BF1CVTL2 instructions.
38///
39bf1cvtl2 v0.8h, v0.16b
40// CHECK-INST: bf1cvtl2 v0.8h, v0.16b
41// CHECK-ENCODING: [0x00,0x78,0xa1,0x6e]
42// CHECK-ERROR: instruction requires: fp8
43// CHECK-UNKNOWN: 6ea17800 <unknown>
44
45bf1cvtl2 v0.8h, v31.16b
46// CHECK-INST: bf1cvtl2 v0.8h, v31.16b
47// CHECK-ENCODING: [0xe0,0x7b,0xa1,0x6e]
48// CHECK-ERROR: instruction requires: fp8
49// CHECK-UNKNOWN: 6ea17be0 <unknown>
50
51bf1cvtl2 v31.8h, v31.16b
52// CHECK-INST: bf1cvtl2 v31.8h, v31.16b
53// CHECK-ENCODING: [0xff,0x7b,0xa1,0x6e]
54// CHECK-ERROR: instruction requires: fp8
55// CHECK-UNKNOWN: 6ea17bff <unknown>
56
57///
58/// BF2CVTL instructions.
59///
60bf2cvtl v0.8h, v0.8b
61// CHECK-INST: bf2cvtl v0.8h, v0.8b
62// CHECK-ENCODING: [0x00,0x78,0xe1,0x2e]
63// CHECK-ERROR: instruction requires: fp8
64// CHECK-UNKNOWN: 2ee17800 <unknown>
65
66bf2cvtl v0.8h, v31.8b
67// CHECK-INST: bf2cvtl v0.8h, v31.8b
68// CHECK-ENCODING: [0xe0,0x7b,0xe1,0x2e]
69// CHECK-ERROR: instruction requires: fp8
70// CHECK-UNKNOWN: 2ee17be0 <unknown>
71
72bf2cvtl v31.8h, v31.8b
73// CHECK-INST: bf2cvtl v31.8h, v31.8b
74// CHECK-ENCODING: [0xff,0x7b,0xe1,0x2e]
75// CHECK-ERROR: instruction requires: fp8
76// CHECK-UNKNOWN: 2ee17bff <unknown>
77
78///
79/// BF2CVTL2 instructions.
80///
81bf2cvtl2 v0.8h, v0.16b
82// CHECK-INST: bf2cvtl2 v0.8h, v0.16b
83// CHECK-ENCODING: [0x00,0x78,0xe1,0x6e]
84// CHECK-ERROR: instruction requires: fp8
85// CHECK-UNKNOWN: 6ee17800 <unknown>
86
87bf2cvtl2 v0.8h, v31.16b
88// CHECK-INST: bf2cvtl2 v0.8h, v31.16b
89// CHECK-ENCODING: [0xe0,0x7b,0xe1,0x6e]
90// CHECK-ERROR: instruction requires: fp8
91// CHECK-UNKNOWN: 6ee17be0 <unknown>
92
93bf2cvtl2 v31.8h, v31.16b
94// CHECK-INST: bf2cvtl2 v31.8h, v31.16b
95// CHECK-ENCODING: [0xff,0x7b,0xe1,0x6e]
96// CHECK-ERROR: instruction requires: fp8
97// CHECK-UNKNOWN: 6ee17bff <unknown>
98
99///
100/// F1CVTL instructions.
101///
102f1cvtl v0.8h, v0.8b
103// CHECK-INST: f1cvtl v0.8h, v0.8b
104// CHECK-ENCODING: [0x00,0x78,0x21,0x2e]
105// CHECK-ERROR: instruction requires: fp8
106// CHECK-UNKNOWN: 2e217800 <unknown>
107
108f1cvtl v0.8h, v31.8b
109// CHECK-INST: f1cvtl v0.8h, v31.8b
110// CHECK-ENCODING: [0xe0,0x7b,0x21,0x2e]
111// CHECK-ERROR: instruction requires: fp8
112// CHECK-UNKNOWN: 2e217be0 <unknown>
113
114f1cvtl v31.8h, v31.8b
115// CHECK-INST: f1cvtl v31.8h, v31.8b
116// CHECK-ENCODING: [0xff,0x7b,0x21,0x2e]
117// CHECK-ERROR: instruction requires: fp8
118// CHECK-UNKNOWN: 2e217bff <unknown>
119
120///
121/// F1CVTL2 instructions.
122///
123f1cvtl2 v0.8h, v0.16b
124// CHECK-INST: f1cvtl2 v0.8h, v0.16b
125// CHECK-ENCODING: [0x00,0x78,0x21,0x6e]
126// CHECK-ERROR: instruction requires: fp8
127// CHECK-UNKNOWN: 6e217800 <unknown>
128
129f1cvtl2 v0.8h, v31.16b
130// CHECK-INST: f1cvtl2 v0.8h, v31.16b
131// CHECK-ENCODING: [0xe0,0x7b,0x21,0x6e]
132// CHECK-ERROR: instruction requires: fp8
133// CHECK-UNKNOWN: 6e217be0 <unknown>
134
135f1cvtl2 v31.8h, v31.16b
136// CHECK-INST: f1cvtl2 v31.8h, v31.16b
137// CHECK-ENCODING: [0xff,0x7b,0x21,0x6e]
138// CHECK-ERROR: instruction requires: fp8
139// CHECK-UNKNOWN: 6e217bff <unknown>
140
141///
142/// F2CVTL instructions.
143///
144f2cvtl v0.8h, v0.8b
145// CHECK-INST: f2cvtl v0.8h, v0.8b
146// CHECK-ENCODING: [0x00,0x78,0x61,0x2e]
147// CHECK-ERROR: instruction requires: fp8
148// CHECK-UNKNOWN: 2e617800 <unknown>
149
150f2cvtl v0.8h, v31.8b
151// CHECK-INST: f2cvtl v0.8h, v31.8b
152// CHECK-ENCODING: [0xe0,0x7b,0x61,0x2e]
153// CHECK-ERROR: instruction requires: fp8
154// CHECK-UNKNOWN: 2e617be0 <unknown>
155
156f2cvtl v31.8h, v31.8b
157// CHECK-INST: f2cvtl v31.8h, v31.8b
158// CHECK-ENCODING: [0xff,0x7b,0x61,0x2e]
159// CHECK-ERROR: instruction requires: fp8
160// CHECK-UNKNOWN: 2e617bff <unknown>
161
162///
163/// F2CVTL2 instructions.
164///
165f2cvtl2 v0.8h, v0.16b
166// CHECK-INST: f2cvtl2 v0.8h, v0.16b
167// CHECK-ENCODING: [0x00,0x78,0x61,0x6e]
168// CHECK-ERROR: instruction requires: fp8
169// CHECK-UNKNOWN: 6e617800 <unknown>
170
171f2cvtl2 v0.8h, v31.16b
172// CHECK-INST: f2cvtl2 v0.8h, v31.16b
173// CHECK-ENCODING: [0xe0,0x7b,0x61,0x6e]
174// CHECK-ERROR: instruction requires: fp8
175// CHECK-UNKNOWN: 6e617be0 <unknown>
176
177f2cvtl2 v31.8h, v31.16b
178// CHECK-INST: f2cvtl2 v31.8h, v31.16b
179// CHECK-ENCODING: [0xff,0x7b,0x61,0x6e]
180// CHECK-ERROR: instruction requires: fp8
181// CHECK-UNKNOWN: 6e617bff <unknown>
182
183///
184/// FCVTN instructions.
185///
186// FP16 TO FP8
187fcvtn  v31.8b, v31.4h, v31.4h
188// CHECK-INST: fcvtn  v31.8b, v31.4h, v31.4h
189// CHECK-ENCODING: [0xff,0xf7,0x5f,0x0e]
190// CHECK-ERROR: instruction requires: fp8
191// CHECK-UNKNOWN: 0e5ff7ff <unknown>
192
193fcvtn  v31.8b, v0.4h, v0.4h
194// CHECK-INST: fcvtn  v31.8b, v0.4h, v0.4h
195// CHECK-ENCODING: [0x1f,0xf4,0x40,0x0e]
196// CHECK-ERROR: instruction requires: fp8
197// CHECK-UNKNOWN: 0e40f41f <unknown>
198
199fcvtn  v0.8b, v0.4h, v0.4h
200// CHECK-INST: fcvtn  v0.8b, v0.4h, v0.4h
201// CHECK-ENCODING: [0x00,0xf4,0x40,0x0e]
202// CHECK-ERROR: instruction requires: fp8
203// CHECK-UNKNOWN: 0e40f400 <unknown>
204
205fcvtn  v0.16b, v0.8h, v0.8h
206// CHECK-INST: fcvtn  v0.16b, v0.8h, v0.8h
207// CHECK-ENCODING: [0x00,0xf4,0x40,0x4e]
208// CHECK-ERROR: instruction requires: fp8
209// CHECK-UNKNOWN: 4e40f400 <unknown>
210
211fcvtn  v31.16b, v0.8h, v0.8h
212// CHECK-INST: fcvtn  v31.16b, v0.8h, v0.8h
213// CHECK-ENCODING: [0x1f,0xf4,0x40,0x4e]
214// CHECK-ERROR: instruction requires: fp8
215// CHECK-UNKNOWN: 4e40f41f <unknown>
216
217fcvtn  v31.16b, v31.8h, v31.8h
218// CHECK-INST: fcvtn  v31.16b, v31.8h, v31.8h
219// CHECK-ENCODING: [0xff,0xf7,0x5f,0x4e]
220// CHECK-ERROR: instruction requires: fp8
221// CHECK-UNKNOWN: 4e5ff7ff <unknown>
222
223// FP32 TO FP8
224fcvtn  v0.8b, v0.4s, v0.4s
225// CHECK-INST: fcvtn  v0.8b, v0.4s, v0.4s
226// CHECK-ENCODING: [0x00,0xf4,0x00,0x0e]
227// CHECK-ERROR: instruction requires: fp8
228// CHECK-UNKNOWN: 0e00f400 <unknown>
229
230fcvtn  v0.8b, v31.4s, v31.4s
231// CHECK-INST: fcvtn  v0.8b, v31.4s, v31.4s
232// CHECK-ENCODING: [0xe0,0xf7,0x1f,0x0e]
233// CHECK-ERROR: instruction requires: fp8
234// CHECK-UNKNOWN: 0e1ff7e0 <unknown>
235
236fcvtn  v31.8b, v31.4s, v31.4s
237// CHECK-INST: fcvtn  v31.8b, v31.4s, v31.4s
238// CHECK-ENCODING: [0xff,0xf7,0x1f,0x0e]
239// CHECK-ERROR: instruction requires: fp8
240// CHECK-UNKNOWN: 0e1ff7ff <unknown>
241
242///
243/// FCVTN2 instructions.
244///
245
246fcvtn2  v0.16b, v0.4s, v0.4s
247// CHECK-INST: fcvtn2  v0.16b, v0.4s, v0.4s
248// CHECK-ENCODING: [0x00,0xf4,0x00,0x4e]
249// CHECK-ERROR: instruction requires: fp8
250// CHECK-UNKNOWN: 4e00f400 <unknown>
251
252fcvtn2  v0.16b, v0.4s, v31.4s
253// CHECK-INST: fcvtn2  v0.16b, v0.4s, v31.4s
254// CHECK-ENCODING: [0x00,0xf4,0x1f,0x4e]
255// CHECK-ERROR: instruction requires: fp8
256// CHECK-UNKNOWN: 4e1ff400 <unknown>
257
258fcvtn2  v31.16b, v31.4s, v31.4s
259// CHECK-INST: fcvtn2  v31.16b, v31.4s, v31.4s
260// CHECK-ENCODING: [0xff,0xf7,0x1f,0x4e]
261// CHECK-ERROR: instruction requires: fp8
262// CHECK-UNKNOWN: 4e1ff7ff <unknown>
263
264///
265/// FSCALE instructions.
266///
267fscale  v0.4h, v0.4h, v0.4h
268// CHECK-INST: fscale  v0.4h, v0.4h, v0.4h
269// CHECK-ENCODING: [0x00,0x3c,0xc0,0x2e]
270// CHECK-ERROR: instruction requires: fp8
271// CHECK-UNKNOWN: 2ec03c00 <unknown>
272
273fscale  v0.4h, v31.4h, v31.4h
274// CHECK-INST: fscale  v0.4h, v31.4h, v31.4h
275// CHECK-ENCODING: [0xe0,0x3f,0xdf,0x2e]
276// CHECK-ERROR: instruction requires: fp8
277// CHECK-UNKNOWN: 2edf3fe0 <unknown>
278
279fscale  v31.4h, v31.4h, v31.4h
280// CHECK-INST: fscale  v31.4h, v31.4h, v31.4h
281// CHECK-ENCODING: [0xff,0x3f,0xdf,0x2e]
282// CHECK-ERROR: instruction requires: fp8
283// CHECK-UNKNOWN: 2edf3fff <unknown>
284
285fscale  v0.8h, v0.8h, v0.8h
286// CHECK-INST: fscale  v0.8h, v0.8h, v0.8h
287// CHECK-ENCODING: [0x00,0x3c,0xc0,0x6e]
288// CHECK-ERROR: instruction requires: fp8
289// CHECK-UNKNOWN: 6ec03c00 <unknown>
290
291fscale  v31.8h, v0.8h, v0.8h
292// CHECK-INST: fscale  v31.8h, v0.8h, v0.8h
293// CHECK-ENCODING: [0x1f,0x3c,0xc0,0x6e]
294// CHECK-ERROR: instruction requires: fp8
295// CHECK-UNKNOWN: 6ec03c1f <unknown>
296
297fscale  v31.8h, v31.8h, v31.8h
298// CHECK-INST: fscale  v31.8h, v31.8h, v31.8h
299// CHECK-ENCODING: [0xff,0x3f,0xdf,0x6e]
300// CHECK-ERROR: instruction requires: fp8
301// CHECK-UNKNOWN: 6edf3fff <unknown>
302
303fscale  v0.2s, v0.2s, v0.2s
304// CHECK-INST: fscale  v0.2s, v0.2s, v0.2s
305// CHECK-ENCODING: [0x00,0xfc,0xa0,0x2e]
306// CHECK-ERROR: instruction requires: fp8
307// CHECK-UNKNOWN: 2ea0fc00 <unknown>
308
309fscale  v0.2s, v0.2s, v31.2s
310// CHECK-INST: fscale  v0.2s, v0.2s, v31.2s
311// CHECK-ENCODING: [0x00,0xfc,0xbf,0x2e]
312// CHECK-ERROR: instruction requires: fp8
313// CHECK-UNKNOWN: 2ebffc00 <unknown>
314
315fscale  v31.2s, v31.2s, v31.2s
316// CHECK-INST: fscale  v31.2s, v31.2s, v31.2s
317// CHECK-ENCODING: [0xff,0xff,0xbf,0x2e]
318// CHECK-ERROR: instruction requires: fp8
319// CHECK-UNKNOWN: 2ebfffff <unknown>
320
321fscale  v0.4s, v0.4s, v0.4s
322// CHECK-INST: fscale  v0.4s, v0.4s, v0.4s
323// CHECK-ENCODING: [0x00,0xfc,0xa0,0x6e]
324// CHECK-ERROR: instruction requires: fp8
325// CHECK-UNKNOWN: 6ea0fc00 <unknown>
326
327fscale  v0.4s, v31.4s, v0.4s
328// CHECK-INST: fscale  v0.4s, v31.4s, v0.4s
329// CHECK-ENCODING: [0xe0,0xff,0xa0,0x6e]
330// CHECK-ERROR: instruction requires: fp8
331// CHECK-UNKNOWN: 6ea0ffe0 <unknown>
332
333fscale  v31.4s, v31.4s, v31.4s
334// CHECK-INST: fscale  v31.4s, v31.4s, v31.4s
335// CHECK-ENCODING: [0xff,0xff,0xbf,0x6e]
336// CHECK-ERROR: instruction requires: fp8
337// CHECK-UNKNOWN: 6ebfffff <unknown>
338
339fscale  v0.2d, v0.2d, v0.2d
340// CHECK-INST: fscale  v0.2d, v0.2d, v0.2d
341// CHECK-ENCODING: [0x00,0xfc,0xe0,0x6e]
342// CHECK-ERROR: instruction requires: fp8
343// CHECK-UNKNOWN: 6ee0fc00 <unknown>
344
345fscale  v0.2d, v31.2d, v0.2d
346// CHECK-INST: fscale  v0.2d, v31.2d, v0.2d
347// CHECK-ENCODING: [0xe0,0xff,0xe0,0x6e]
348// CHECK-ERROR: instruction requires: fp8
349// CHECK-UNKNOWN: 6ee0ffe0 <unknown>
350
351fscale  v31.2d, v31.2d, v31.2d
352// CHECK-INST: fscale  v31.2d, v31.2d, v31.2d
353// CHECK-ENCODING: [0xff,0xff,0xff,0x6e]
354// CHECK-ERROR: instruction requires: fp8
355// CHECK-UNKNOWN: 6effffff
356