1; RUN: llc < %s -mtriple=aarch64-windows -mattr=+fullfp16 | FileCheck %s
2
3; CHECK-LABEL: testmhhs:
4; CHECK:       frintx  h0, h0
5; CHECK-NEXT:  fcvtzs  w0, h0
6; CHECK-NEXT:  ret
7define i16 @testmhhs(half %x) {
8entry:
9  %0 = tail call i32 @llvm.lrint.i32.f16(half %x)
10  %conv = trunc i32 %0 to i16
11  ret i16 %conv
12}
13
14; CHECK-LABEL: testmhws:
15; CHECK:       frintx  h0, h0
16; CHECK-NEXT:  fcvtzs  w0, h0
17; CHECK-NEXT:  ret
18define i32 @testmhws(half %x) {
19entry:
20  %0 = tail call i32 @llvm.lrint.i32.f16(half %x)
21  ret i32 %0
22}
23
24; CHECK-LABEL: testmhxs:
25; CHECK:       frintx  h0, h0
26; CHECK-NEXT:  fcvtzs  w8, h0
27; CHECK-NEXT:  sxtw    x0, w8
28; CHECK-NEXT:  ret
29define i64 @testmhxs(half %x) {
30entry:
31  %0 = tail call i32 @llvm.lrint.i32.f16(half %x)
32  %conv = sext i32 %0 to i64
33  ret i64 %conv
34}
35
36declare i32 @llvm.lrint.i32.f16(half) nounwind readnone
37