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