1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-eabi -mattr=+v8.2a,+fullfp16 | FileCheck %s
4 declare i64 @llvm.aarch64.neon.fcvtpu.i64.f16(half)
5 declare i32 @llvm.aarch64.neon.fcvtpu.i32.f16(half)
6 declare i64 @llvm.aarch64.neon.fcvtps.i64.f16(half)
7 declare i32 @llvm.aarch64.neon.fcvtps.i32.f16(half)
8 declare i64 @llvm.aarch64.neon.fcvtnu.i64.f16(half)
9 declare i32 @llvm.aarch64.neon.fcvtnu.i32.f16(half)
10 declare i64 @llvm.aarch64.neon.fcvtns.i64.f16(half)
11 declare i32 @llvm.aarch64.neon.fcvtns.i32.f16(half)
12 declare i64 @llvm.aarch64.neon.fcvtmu.i64.f16(half)
13 declare i32 @llvm.aarch64.neon.fcvtmu.i32.f16(half)
14 declare i64 @llvm.aarch64.neon.fcvtms.i64.f16(half)
15 declare i32 @llvm.aarch64.neon.fcvtms.i32.f16(half)
16 declare i64 @llvm.aarch64.neon.fcvtau.i64.f16(half)
17 declare i32 @llvm.aarch64.neon.fcvtau.i32.f16(half)
18 declare i64 @llvm.aarch64.neon.fcvtas.i64.f16(half)
19 declare i32 @llvm.aarch64.neon.fcvtas.i32.f16(half)
20 declare i64 @llvm.aarch64.neon.fcvtzs.i64.f16(half)
21 declare i32 @llvm.aarch64.neon.fcvtzs.i32.f16(half)
22 declare i64 @llvm.aarch64.neon.fcvtzu.i64.f16(half)
23 declare i32 @llvm.aarch64.neon.fcvtzu.i32.f16(half)
24 declare half @llvm.aarch64.neon.frsqrte.f16(half)
25 declare half @llvm.aarch64.neon.frecpx.f16(half)
26 declare half @llvm.aarch64.neon.frecpe.f16(half)
28 define dso_local i16 @t2(half %a) {
30 ; CHECK: // %bb.0: // %entry
31 ; CHECK-NEXT: fcmp h0, #0.0
32 ; CHECK-NEXT: csetm w0, eq
35 %0 = fcmp oeq half %a, 0xH0000
36 %vceqz = sext i1 %0 to i16
40 define dso_local i16 @t3(half %a) {
42 ; CHECK: // %bb.0: // %entry
43 ; CHECK-NEXT: fcmp h0, #0.0
44 ; CHECK-NEXT: csetm w0, ge
47 %0 = fcmp oge half %a, 0xH0000
48 %vcgez = sext i1 %0 to i16
52 define dso_local i16 @t4(half %a) {
54 ; CHECK: // %bb.0: // %entry
55 ; CHECK-NEXT: fcmp h0, #0.0
56 ; CHECK-NEXT: csetm w0, gt
59 %0 = fcmp ogt half %a, 0xH0000
60 %vcgtz = sext i1 %0 to i16
64 define dso_local i16 @t5(half %a) {
66 ; CHECK: // %bb.0: // %entry
67 ; CHECK-NEXT: fcmp h0, #0.0
68 ; CHECK-NEXT: csetm w0, ls
71 %0 = fcmp ole half %a, 0xH0000
72 %vclez = sext i1 %0 to i16
76 define dso_local i16 @t6(half %a) {
78 ; CHECK: // %bb.0: // %entry
79 ; CHECK-NEXT: fcmp h0, #0.0
80 ; CHECK-NEXT: csetm w0, mi
83 %0 = fcmp olt half %a, 0xH0000
84 %vcltz = sext i1 %0 to i16
88 define dso_local half @t8(i32 %a) {
90 ; CHECK: // %bb.0: // %entry
91 ; CHECK-NEXT: scvtf h0, w0
94 %0 = sitofp i32 %a to half
98 define dso_local half @t9(i64 %a) {
100 ; CHECK: // %bb.0: // %entry
101 ; CHECK-NEXT: scvtf h0, x0
104 %0 = sitofp i64 %a to half
108 define dso_local half @t12(i64 %a) {
110 ; CHECK: // %bb.0: // %entry
111 ; CHECK-NEXT: ucvtf h0, x0
114 %0 = uitofp i64 %a to half
118 define dso_local i16 @t13(half %a) {
120 ; CHECK: // %bb.0: // %entry
121 ; CHECK-NEXT: fcvtzs w0, h0
124 %0 = fptosi half %a to i16
128 define dso_local i64 @t15(half %a) {
130 ; CHECK: // %bb.0: // %entry
131 ; CHECK-NEXT: fcvtzs x0, h0
134 %0 = fptosi half %a to i64
138 define dso_local i16 @t16(half %a) {
140 ; CHECK: // %bb.0: // %entry
141 ; CHECK-NEXT: fcvtzs w0, h0
144 %0 = fptoui half %a to i16
148 define dso_local i64 @t18(half %a) {
150 ; CHECK: // %bb.0: // %entry
151 ; CHECK-NEXT: fcvtzu x0, h0
154 %0 = fptoui half %a to i64
158 define i32 @fcvtzu_intrinsic_i32(half %a) {
159 ; CHECK-LABEL: fcvtzu_intrinsic_i32:
160 ; CHECK: // %bb.0: // %entry
161 ; CHECK-NEXT: fcvtzu w0, h0
164 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtzu.i32.f16(half %a)
168 define i64 @fcvtzu_intrinsic_i64(half %a) {
169 ; CHECK-LABEL: fcvtzu_intrinsic_i64:
170 ; CHECK: // %bb.0: // %entry
171 ; CHECK-NEXT: fcvtzs x0, h0
174 %fcvt = tail call i64 @llvm.aarch64.neon.fcvtzs.i64.f16(half %a)
178 define i32 @fcvtzs_intrinsic_i32(half %a) {
179 ; CHECK-LABEL: fcvtzs_intrinsic_i32:
180 ; CHECK: // %bb.0: // %entry
181 ; CHECK-NEXT: fcvtzs w0, h0
184 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtzs.i32.f16(half %a)
188 define i64 @fcvtzs_intrinsic_i64(half %a) {
189 ; CHECK-LABEL: fcvtzs_intrinsic_i64:
190 ; CHECK: // %bb.0: // %entry
191 ; CHECK-NEXT: fcvtzs x0, h0
194 %fcvt = tail call i64 @llvm.aarch64.neon.fcvtzs.i64.f16(half %a)
198 define dso_local i16 @t19(half %a) {
200 ; CHECK: // %bb.0: // %entry
201 ; CHECK-NEXT: fcvtas w0, h0
204 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtas.i32.f16(half %a)
205 %0 = trunc i32 %fcvt to i16
209 define dso_local i64 @t21(half %a) {
211 ; CHECK: // %bb.0: // %entry
212 ; CHECK-NEXT: fcvtas x0, h0
215 %vcvtah_s64_f16 = tail call i64 @llvm.aarch64.neon.fcvtas.i64.f16(half %a)
216 ret i64 %vcvtah_s64_f16
219 define dso_local i16 @t22(half %a) {
221 ; CHECK: // %bb.0: // %entry
222 ; CHECK-NEXT: fcvtau w0, h0
225 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtau.i32.f16(half %a)
226 %0 = trunc i32 %fcvt to i16
230 define dso_local i64 @t24(half %a) {
232 ; CHECK: // %bb.0: // %entry
233 ; CHECK-NEXT: fcvtau x0, h0
236 %vcvtah_u64_f16 = tail call i64 @llvm.aarch64.neon.fcvtau.i64.f16(half %a)
237 ret i64 %vcvtah_u64_f16
240 define dso_local i16 @t25(half %a) {
242 ; CHECK: // %bb.0: // %entry
243 ; CHECK-NEXT: fcvtms w0, h0
246 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtms.i32.f16(half %a)
247 %0 = trunc i32 %fcvt to i16
251 define dso_local i64 @t27(half %a) {
253 ; CHECK: // %bb.0: // %entry
254 ; CHECK-NEXT: fcvtms x0, h0
257 %vcvtmh_s64_f16 = tail call i64 @llvm.aarch64.neon.fcvtms.i64.f16(half %a)
258 ret i64 %vcvtmh_s64_f16
261 define dso_local i16 @t28(half %a) {
263 ; CHECK: // %bb.0: // %entry
264 ; CHECK-NEXT: fcvtmu w0, h0
267 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtmu.i32.f16(half %a)
268 %0 = trunc i32 %fcvt to i16
272 define dso_local i64 @t30(half %a) {
274 ; CHECK: // %bb.0: // %entry
275 ; CHECK-NEXT: fcvtmu x0, h0
278 %vcvtmh_u64_f16 = tail call i64 @llvm.aarch64.neon.fcvtmu.i64.f16(half %a)
279 ret i64 %vcvtmh_u64_f16
282 define dso_local i16 @t31(half %a) {
284 ; CHECK: // %bb.0: // %entry
285 ; CHECK-NEXT: fcvtns w0, h0
288 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtns.i32.f16(half %a)
289 %0 = trunc i32 %fcvt to i16
293 define dso_local i64 @t33(half %a) {
295 ; CHECK: // %bb.0: // %entry
296 ; CHECK-NEXT: fcvtns x0, h0
299 %vcvtnh_s64_f16 = tail call i64 @llvm.aarch64.neon.fcvtns.i64.f16(half %a)
300 ret i64 %vcvtnh_s64_f16
303 define dso_local i16 @t34(half %a) {
305 ; CHECK: // %bb.0: // %entry
306 ; CHECK-NEXT: fcvtnu w0, h0
309 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtnu.i32.f16(half %a)
310 %0 = trunc i32 %fcvt to i16
314 define dso_local i64 @t36(half %a) {
316 ; CHECK: // %bb.0: // %entry
317 ; CHECK-NEXT: fcvtnu x0, h0
320 %vcvtnh_u64_f16 = tail call i64 @llvm.aarch64.neon.fcvtnu.i64.f16(half %a)
321 ret i64 %vcvtnh_u64_f16
324 define dso_local i16 @t37(half %a) {
326 ; CHECK: // %bb.0: // %entry
327 ; CHECK-NEXT: fcvtps w0, h0
330 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtps.i32.f16(half %a)
331 %0 = trunc i32 %fcvt to i16
335 define dso_local i64 @t39(half %a) {
337 ; CHECK: // %bb.0: // %entry
338 ; CHECK-NEXT: fcvtps x0, h0
341 %vcvtph_s64_f16 = tail call i64 @llvm.aarch64.neon.fcvtps.i64.f16(half %a)
342 ret i64 %vcvtph_s64_f16
345 define dso_local i16 @t40(half %a) {
347 ; CHECK: // %bb.0: // %entry
348 ; CHECK-NEXT: fcvtpu w0, h0
351 %fcvt = tail call i32 @llvm.aarch64.neon.fcvtpu.i32.f16(half %a)
352 %0 = trunc i32 %fcvt to i16
356 define dso_local i64 @t42(half %a) {
358 ; CHECK: // %bb.0: // %entry
359 ; CHECK-NEXT: fcvtpu x0, h0
362 %vcvtph_u64_f16 = tail call i64 @llvm.aarch64.neon.fcvtpu.i64.f16(half %a)
363 ret i64 %vcvtph_u64_f16
366 define dso_local half @t44(half %a) {
368 ; CHECK: // %bb.0: // %entry
369 ; CHECK-NEXT: frecpe h0, h0
372 %vrecpeh_f16 = tail call half @llvm.aarch64.neon.frecpe.f16(half %a)
373 ret half %vrecpeh_f16
376 define dso_local half @t45(half %a) {
378 ; CHECK: // %bb.0: // %entry
379 ; CHECK-NEXT: frecpx h0, h0
382 %vrecpxh_f16 = tail call half @llvm.aarch64.neon.frecpx.f16(half %a)
383 ret half %vrecpxh_f16
386 define dso_local half @t53(half %a) {
388 ; CHECK: // %bb.0: // %entry
389 ; CHECK-NEXT: frsqrte h0, h0
392 %vrsqrteh_f16 = tail call half @llvm.aarch64.neon.frsqrte.f16(half %a)
393 ret half %vrsqrteh_f16