1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-SD-NOFP16
3 ; RUN: llc -mtriple=aarch64 -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-SD-FP16
4 ; RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-GI-NOFP16
5 ; RUN: llc -mtriple=aarch64 -mattr=+fullfp16 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-GI-FP16
7 define double @fdiv_f64(double %a, double %b) {
8 ; CHECK-LABEL: fdiv_f64:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: fdiv d0, d0, d1
13 %c = fdiv double %a, %b
17 define float @fdiv_f32(float %a, float %b) {
18 ; CHECK-LABEL: fdiv_f32:
19 ; CHECK: // %bb.0: // %entry
20 ; CHECK-NEXT: fdiv s0, s0, s1
23 %c = fdiv float %a, %b
27 define half @fdiv_f16(half %a, half %b) {
28 ; CHECK-SD-NOFP16-LABEL: fdiv_f16:
29 ; CHECK-SD-NOFP16: // %bb.0: // %entry
30 ; CHECK-SD-NOFP16-NEXT: fcvt s1, h1
31 ; CHECK-SD-NOFP16-NEXT: fcvt s0, h0
32 ; CHECK-SD-NOFP16-NEXT: fdiv s0, s0, s1
33 ; CHECK-SD-NOFP16-NEXT: fcvt h0, s0
34 ; CHECK-SD-NOFP16-NEXT: ret
36 ; CHECK-SD-FP16-LABEL: fdiv_f16:
37 ; CHECK-SD-FP16: // %bb.0: // %entry
38 ; CHECK-SD-FP16-NEXT: fdiv h0, h0, h1
39 ; CHECK-SD-FP16-NEXT: ret
41 ; CHECK-GI-NOFP16-LABEL: fdiv_f16:
42 ; CHECK-GI-NOFP16: // %bb.0: // %entry
43 ; CHECK-GI-NOFP16-NEXT: fcvt s0, h0
44 ; CHECK-GI-NOFP16-NEXT: fcvt s1, h1
45 ; CHECK-GI-NOFP16-NEXT: fdiv s0, s0, s1
46 ; CHECK-GI-NOFP16-NEXT: fcvt h0, s0
47 ; CHECK-GI-NOFP16-NEXT: ret
49 ; CHECK-GI-FP16-LABEL: fdiv_f16:
50 ; CHECK-GI-FP16: // %bb.0: // %entry
51 ; CHECK-GI-FP16-NEXT: fdiv h0, h0, h1
52 ; CHECK-GI-FP16-NEXT: ret
58 define <2 x double> @fdiv_v2f64(<2 x double> %a, <2 x double> %b) {
59 ; CHECK-LABEL: fdiv_v2f64:
60 ; CHECK: // %bb.0: // %entry
61 ; CHECK-NEXT: fdiv v0.2d, v0.2d, v1.2d
64 %c = fdiv <2 x double> %a, %b
68 define <3 x double> @fdiv_v3f64(<3 x double> %a, <3 x double> %b) {
69 ; CHECK-SD-LABEL: fdiv_v3f64:
70 ; CHECK-SD: // %bb.0: // %entry
71 ; CHECK-SD-NEXT: // kill: def $d3 killed $d3 def $q3
72 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
73 ; CHECK-SD-NEXT: // kill: def $d4 killed $d4 def $q4
74 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
75 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
76 ; CHECK-SD-NEXT: // kill: def $d5 killed $d5 def $q5
77 ; CHECK-SD-NEXT: mov v3.d[1], v4.d[0]
78 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
79 ; CHECK-SD-NEXT: fdiv v2.2d, v2.2d, v5.2d
80 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
81 ; CHECK-SD-NEXT: fdiv v0.2d, v0.2d, v3.2d
82 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
83 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
84 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
87 ; CHECK-GI-LABEL: fdiv_v3f64:
88 ; CHECK-GI: // %bb.0: // %entry
89 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
90 ; CHECK-GI-NEXT: // kill: def $d3 killed $d3 def $q3
91 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
92 ; CHECK-GI-NEXT: // kill: def $d4 killed $d4 def $q4
93 ; CHECK-GI-NEXT: fdiv d2, d2, d5
94 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
95 ; CHECK-GI-NEXT: mov v3.d[1], v4.d[0]
96 ; CHECK-GI-NEXT: fdiv v0.2d, v0.2d, v3.2d
97 ; CHECK-GI-NEXT: mov d1, v0.d[1]
98 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
101 %c = fdiv <3 x double> %a, %b
105 define <4 x double> @fdiv_v4f64(<4 x double> %a, <4 x double> %b) {
106 ; CHECK-SD-LABEL: fdiv_v4f64:
107 ; CHECK-SD: // %bb.0: // %entry
108 ; CHECK-SD-NEXT: fdiv v1.2d, v1.2d, v3.2d
109 ; CHECK-SD-NEXT: fdiv v0.2d, v0.2d, v2.2d
112 ; CHECK-GI-LABEL: fdiv_v4f64:
113 ; CHECK-GI: // %bb.0: // %entry
114 ; CHECK-GI-NEXT: fdiv v0.2d, v0.2d, v2.2d
115 ; CHECK-GI-NEXT: fdiv v1.2d, v1.2d, v3.2d
118 %c = fdiv <4 x double> %a, %b
122 define <2 x float> @fdiv_v2f32(<2 x float> %a, <2 x float> %b) {
123 ; CHECK-LABEL: fdiv_v2f32:
124 ; CHECK: // %bb.0: // %entry
125 ; CHECK-NEXT: fdiv v0.2s, v0.2s, v1.2s
128 %c = fdiv <2 x float> %a, %b
132 define <3 x float> @fdiv_v3f32(<3 x float> %a, <3 x float> %b) {
133 ; CHECK-LABEL: fdiv_v3f32:
134 ; CHECK: // %bb.0: // %entry
135 ; CHECK-NEXT: fdiv v0.4s, v0.4s, v1.4s
138 %c = fdiv <3 x float> %a, %b
142 define <4 x float> @fdiv_v4f32(<4 x float> %a, <4 x float> %b) {
143 ; CHECK-LABEL: fdiv_v4f32:
144 ; CHECK: // %bb.0: // %entry
145 ; CHECK-NEXT: fdiv v0.4s, v0.4s, v1.4s
148 %c = fdiv <4 x float> %a, %b
152 define <8 x float> @fdiv_v8f32(<8 x float> %a, <8 x float> %b) {
153 ; CHECK-SD-LABEL: fdiv_v8f32:
154 ; CHECK-SD: // %bb.0: // %entry
155 ; CHECK-SD-NEXT: fdiv v1.4s, v1.4s, v3.4s
156 ; CHECK-SD-NEXT: fdiv v0.4s, v0.4s, v2.4s
159 ; CHECK-GI-LABEL: fdiv_v8f32:
160 ; CHECK-GI: // %bb.0: // %entry
161 ; CHECK-GI-NEXT: fdiv v0.4s, v0.4s, v2.4s
162 ; CHECK-GI-NEXT: fdiv v1.4s, v1.4s, v3.4s
165 %c = fdiv <8 x float> %a, %b
169 define <7 x half> @fdiv_v7f16(<7 x half> %a, <7 x half> %b) {
170 ; CHECK-SD-NOFP16-LABEL: fdiv_v7f16:
171 ; CHECK-SD-NOFP16: // %bb.0: // %entry
172 ; CHECK-SD-NOFP16-NEXT: fcvtl v2.4s, v1.4h
173 ; CHECK-SD-NOFP16-NEXT: fcvtl v3.4s, v0.4h
174 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v1.4s, v1.8h
175 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
176 ; CHECK-SD-NOFP16-NEXT: fdiv v2.4s, v3.4s, v2.4s
177 ; CHECK-SD-NOFP16-NEXT: fdiv v1.4s, v0.4s, v1.4s
178 ; CHECK-SD-NOFP16-NEXT: fcvtn v0.4h, v2.4s
179 ; CHECK-SD-NOFP16-NEXT: fcvtn2 v0.8h, v1.4s
180 ; CHECK-SD-NOFP16-NEXT: ret
182 ; CHECK-SD-FP16-LABEL: fdiv_v7f16:
183 ; CHECK-SD-FP16: // %bb.0: // %entry
184 ; CHECK-SD-FP16-NEXT: fdiv v0.8h, v0.8h, v1.8h
185 ; CHECK-SD-FP16-NEXT: ret
187 ; CHECK-GI-NOFP16-LABEL: fdiv_v7f16:
188 ; CHECK-GI-NOFP16: // %bb.0: // %entry
189 ; CHECK-GI-NOFP16-NEXT: fcvtl v2.4s, v0.4h
190 ; CHECK-GI-NOFP16-NEXT: fcvtl v3.4s, v1.4h
191 ; CHECK-GI-NOFP16-NEXT: mov v4.h[0], v0.h[4]
192 ; CHECK-GI-NOFP16-NEXT: fdiv v2.4s, v2.4s, v3.4s
193 ; CHECK-GI-NOFP16-NEXT: mov v3.h[0], v1.h[4]
194 ; CHECK-GI-NOFP16-NEXT: mov v4.h[1], v0.h[5]
195 ; CHECK-GI-NOFP16-NEXT: mov v3.h[1], v1.h[5]
196 ; CHECK-GI-NOFP16-NEXT: mov v4.h[2], v0.h[6]
197 ; CHECK-GI-NOFP16-NEXT: mov v3.h[2], v1.h[6]
198 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v4.4h
199 ; CHECK-GI-NOFP16-NEXT: fcvtl v1.4s, v3.4h
200 ; CHECK-GI-NOFP16-NEXT: fcvtn v2.4h, v2.4s
201 ; CHECK-GI-NOFP16-NEXT: fdiv v1.4s, v0.4s, v1.4s
202 ; CHECK-GI-NOFP16-NEXT: mov v0.h[0], v2.h[0]
203 ; CHECK-GI-NOFP16-NEXT: mov v0.h[1], v2.h[1]
204 ; CHECK-GI-NOFP16-NEXT: mov v0.h[2], v2.h[2]
205 ; CHECK-GI-NOFP16-NEXT: fcvtn v1.4h, v1.4s
206 ; CHECK-GI-NOFP16-NEXT: mov v0.h[3], v2.h[3]
207 ; CHECK-GI-NOFP16-NEXT: mov v0.h[4], v1.h[0]
208 ; CHECK-GI-NOFP16-NEXT: mov v0.h[5], v1.h[1]
209 ; CHECK-GI-NOFP16-NEXT: mov v0.h[6], v1.h[2]
210 ; CHECK-GI-NOFP16-NEXT: ret
212 ; CHECK-GI-FP16-LABEL: fdiv_v7f16:
213 ; CHECK-GI-FP16: // %bb.0: // %entry
214 ; CHECK-GI-FP16-NEXT: fdiv v0.8h, v0.8h, v1.8h
215 ; CHECK-GI-FP16-NEXT: ret
217 %c = fdiv <7 x half> %a, %b
221 define <4 x half> @fdiv_v4f16(<4 x half> %a, <4 x half> %b) {
222 ; CHECK-SD-NOFP16-LABEL: fdiv_v4f16:
223 ; CHECK-SD-NOFP16: // %bb.0: // %entry
224 ; CHECK-SD-NOFP16-NEXT: fcvtl v1.4s, v1.4h
225 ; CHECK-SD-NOFP16-NEXT: fcvtl v0.4s, v0.4h
226 ; CHECK-SD-NOFP16-NEXT: fdiv v0.4s, v0.4s, v1.4s
227 ; CHECK-SD-NOFP16-NEXT: fcvtn v0.4h, v0.4s
228 ; CHECK-SD-NOFP16-NEXT: ret
230 ; CHECK-SD-FP16-LABEL: fdiv_v4f16:
231 ; CHECK-SD-FP16: // %bb.0: // %entry
232 ; CHECK-SD-FP16-NEXT: fdiv v0.4h, v0.4h, v1.4h
233 ; CHECK-SD-FP16-NEXT: ret
235 ; CHECK-GI-NOFP16-LABEL: fdiv_v4f16:
236 ; CHECK-GI-NOFP16: // %bb.0: // %entry
237 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v0.4h
238 ; CHECK-GI-NOFP16-NEXT: fcvtl v1.4s, v1.4h
239 ; CHECK-GI-NOFP16-NEXT: fdiv v0.4s, v0.4s, v1.4s
240 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v0.4s
241 ; CHECK-GI-NOFP16-NEXT: ret
243 ; CHECK-GI-FP16-LABEL: fdiv_v4f16:
244 ; CHECK-GI-FP16: // %bb.0: // %entry
245 ; CHECK-GI-FP16-NEXT: fdiv v0.4h, v0.4h, v1.4h
246 ; CHECK-GI-FP16-NEXT: ret
248 %c = fdiv <4 x half> %a, %b
252 define <8 x half> @fdiv_v8f16(<8 x half> %a, <8 x half> %b) {
253 ; CHECK-SD-NOFP16-LABEL: fdiv_v8f16:
254 ; CHECK-SD-NOFP16: // %bb.0: // %entry
255 ; CHECK-SD-NOFP16-NEXT: fcvtl v2.4s, v1.4h
256 ; CHECK-SD-NOFP16-NEXT: fcvtl v3.4s, v0.4h
257 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v1.4s, v1.8h
258 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
259 ; CHECK-SD-NOFP16-NEXT: fdiv v2.4s, v3.4s, v2.4s
260 ; CHECK-SD-NOFP16-NEXT: fdiv v1.4s, v0.4s, v1.4s
261 ; CHECK-SD-NOFP16-NEXT: fcvtn v0.4h, v2.4s
262 ; CHECK-SD-NOFP16-NEXT: fcvtn2 v0.8h, v1.4s
263 ; CHECK-SD-NOFP16-NEXT: ret
265 ; CHECK-SD-FP16-LABEL: fdiv_v8f16:
266 ; CHECK-SD-FP16: // %bb.0: // %entry
267 ; CHECK-SD-FP16-NEXT: fdiv v0.8h, v0.8h, v1.8h
268 ; CHECK-SD-FP16-NEXT: ret
270 ; CHECK-GI-NOFP16-LABEL: fdiv_v8f16:
271 ; CHECK-GI-NOFP16: // %bb.0: // %entry
272 ; CHECK-GI-NOFP16-NEXT: fcvtl v2.4s, v0.4h
273 ; CHECK-GI-NOFP16-NEXT: fcvtl v3.4s, v1.4h
274 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
275 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v1.4s, v1.8h
276 ; CHECK-GI-NOFP16-NEXT: fdiv v2.4s, v2.4s, v3.4s
277 ; CHECK-GI-NOFP16-NEXT: fdiv v1.4s, v0.4s, v1.4s
278 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v2.4s
279 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v0.8h, v1.4s
280 ; CHECK-GI-NOFP16-NEXT: ret
282 ; CHECK-GI-FP16-LABEL: fdiv_v8f16:
283 ; CHECK-GI-FP16: // %bb.0: // %entry
284 ; CHECK-GI-FP16-NEXT: fdiv v0.8h, v0.8h, v1.8h
285 ; CHECK-GI-FP16-NEXT: ret
287 %c = fdiv <8 x half> %a, %b
291 define <16 x half> @fdiv_v16f16(<16 x half> %a, <16 x half> %b) {
292 ; CHECK-SD-NOFP16-LABEL: fdiv_v16f16:
293 ; CHECK-SD-NOFP16: // %bb.0: // %entry
294 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v4.4s, v2.8h
295 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v5.4s, v0.8h
296 ; CHECK-SD-NOFP16-NEXT: fcvtl v2.4s, v2.4h
297 ; CHECK-SD-NOFP16-NEXT: fcvtl v0.4s, v0.4h
298 ; CHECK-SD-NOFP16-NEXT: fdiv v4.4s, v5.4s, v4.4s
299 ; CHECK-SD-NOFP16-NEXT: fcvtl v5.4s, v1.4h
300 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v1.4s, v1.8h
301 ; CHECK-SD-NOFP16-NEXT: fdiv v0.4s, v0.4s, v2.4s
302 ; CHECK-SD-NOFP16-NEXT: fcvtl v2.4s, v3.4h
303 ; CHECK-SD-NOFP16-NEXT: fcvtl2 v3.4s, v3.8h
304 ; CHECK-SD-NOFP16-NEXT: fdiv v2.4s, v5.4s, v2.4s
305 ; CHECK-SD-NOFP16-NEXT: fcvtn v0.4h, v0.4s
306 ; CHECK-SD-NOFP16-NEXT: fcvtn2 v0.8h, v4.4s
307 ; CHECK-SD-NOFP16-NEXT: fdiv v3.4s, v1.4s, v3.4s
308 ; CHECK-SD-NOFP16-NEXT: fcvtn v1.4h, v2.4s
309 ; CHECK-SD-NOFP16-NEXT: fcvtn2 v1.8h, v3.4s
310 ; CHECK-SD-NOFP16-NEXT: ret
312 ; CHECK-SD-FP16-LABEL: fdiv_v16f16:
313 ; CHECK-SD-FP16: // %bb.0: // %entry
314 ; CHECK-SD-FP16-NEXT: fdiv v1.8h, v1.8h, v3.8h
315 ; CHECK-SD-FP16-NEXT: fdiv v0.8h, v0.8h, v2.8h
316 ; CHECK-SD-FP16-NEXT: ret
318 ; CHECK-GI-NOFP16-LABEL: fdiv_v16f16:
319 ; CHECK-GI-NOFP16: // %bb.0: // %entry
320 ; CHECK-GI-NOFP16-NEXT: fcvtl v4.4s, v0.4h
321 ; CHECK-GI-NOFP16-NEXT: fcvtl v5.4s, v2.4h
322 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
323 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v2.4s, v2.8h
324 ; CHECK-GI-NOFP16-NEXT: fdiv v4.4s, v4.4s, v5.4s
325 ; CHECK-GI-NOFP16-NEXT: fcvtl v5.4s, v3.4h
326 ; CHECK-GI-NOFP16-NEXT: fdiv v2.4s, v0.4s, v2.4s
327 ; CHECK-GI-NOFP16-NEXT: fcvtl v0.4s, v1.4h
328 ; CHECK-GI-NOFP16-NEXT: fdiv v5.4s, v0.4s, v5.4s
329 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v0.4s, v1.8h
330 ; CHECK-GI-NOFP16-NEXT: fcvtl2 v1.4s, v3.8h
331 ; CHECK-GI-NOFP16-NEXT: fdiv v3.4s, v0.4s, v1.4s
332 ; CHECK-GI-NOFP16-NEXT: fcvtn v0.4h, v4.4s
333 ; CHECK-GI-NOFP16-NEXT: fcvtn v1.4h, v5.4s
334 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v0.8h, v2.4s
335 ; CHECK-GI-NOFP16-NEXT: fcvtn2 v1.8h, v3.4s
336 ; CHECK-GI-NOFP16-NEXT: ret
338 ; CHECK-GI-FP16-LABEL: fdiv_v16f16:
339 ; CHECK-GI-FP16: // %bb.0: // %entry
340 ; CHECK-GI-FP16-NEXT: fdiv v0.8h, v0.8h, v2.8h
341 ; CHECK-GI-FP16-NEXT: fdiv v1.8h, v1.8h, v3.8h
342 ; CHECK-GI-FP16-NEXT: ret
344 %c = fdiv <16 x half> %a, %b