1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s --check-prefixes=CHECK-NOFP16
3 ; RUN: llc < %s -mtriple=aarch64 -mattr=+fullfp16 | FileCheck %s --check-prefixes=CHECK-FP16
5 define i16 @testmhhs(half %x) {
6 ; CHECK-NOFP16-LABEL: testmhhs:
7 ; CHECK-NOFP16: // %bb.0: // %entry
8 ; CHECK-NOFP16-NEXT: fcvt s0, h0
9 ; CHECK-NOFP16-NEXT: fcvtas x0, s0
10 ; CHECK-NOFP16-NEXT: // kill: def $w0 killed $w0 killed $x0
11 ; CHECK-NOFP16-NEXT: ret
13 ; CHECK-FP16-LABEL: testmhhs:
14 ; CHECK-FP16: // %bb.0: // %entry
15 ; CHECK-FP16-NEXT: fcvtas x0, h0
16 ; CHECK-FP16-NEXT: // kill: def $w0 killed $w0 killed $x0
17 ; CHECK-FP16-NEXT: ret
19 %0 = tail call i64 @llvm.llround.i64.f16(half %x)
20 %conv = trunc i64 %0 to i16
24 define i32 @testmhws(half %x) {
25 ; CHECK-NOFP16-LABEL: testmhws:
26 ; CHECK-NOFP16: // %bb.0: // %entry
27 ; CHECK-NOFP16-NEXT: fcvt s0, h0
28 ; CHECK-NOFP16-NEXT: fcvtas x0, s0
29 ; CHECK-NOFP16-NEXT: // kill: def $w0 killed $w0 killed $x0
30 ; CHECK-NOFP16-NEXT: ret
32 ; CHECK-FP16-LABEL: testmhws:
33 ; CHECK-FP16: // %bb.0: // %entry
34 ; CHECK-FP16-NEXT: fcvtas x0, h0
35 ; CHECK-FP16-NEXT: // kill: def $w0 killed $w0 killed $x0
36 ; CHECK-FP16-NEXT: ret
38 %0 = tail call i64 @llvm.llround.i64.f16(half %x)
39 %conv = trunc i64 %0 to i32
43 define i64 @testmhxs(half %x) {
44 ; CHECK-NOFP16-LABEL: testmhxs:
45 ; CHECK-NOFP16: // %bb.0: // %entry
46 ; CHECK-NOFP16-NEXT: fcvt s0, h0
47 ; CHECK-NOFP16-NEXT: fcvtas x0, s0
48 ; CHECK-NOFP16-NEXT: ret
50 ; CHECK-FP16-LABEL: testmhxs:
51 ; CHECK-FP16: // %bb.0: // %entry
52 ; CHECK-FP16-NEXT: fcvtas x0, h0
53 ; CHECK-FP16-NEXT: ret
55 %0 = tail call i64 @llvm.llround.i64.f16(half %x)
59 declare i64 @llvm.llround.i64.f16(half) nounwind readnone