1; RUN: llc < %s -mtriple=powerpc64le | FileCheck %s
2
3; CHECK-LABEL: testmsws:
4; CHECK:       bl      lroundf
5define signext i32 @testmsws(float %x) {
6entry:
7  %0 = tail call i64 @llvm.lround.i64.f32(float %x)
8  %conv = trunc i64 %0 to i32
9  ret i32 %conv
10}
11
12; CHECK-LABEL: testmsxs:
13; CHECK:       bl      lroundf
14define i64 @testmsxs(float %x) {
15entry:
16  %0 = tail call i64 @llvm.lround.i64.f32(float %x)
17  ret i64 %0
18}
19
20; CHECK-LABEL: testmswd:
21; CHECK:       bl      lround
22define signext i32 @testmswd(double %x) {
23entry:
24  %0 = tail call i64 @llvm.lround.i64.f64(double %x)
25  %conv = trunc i64 %0 to i32
26  ret i32 %conv
27}
28
29; CHECK-LABEL: testmsxd:
30; CHECK:       bl      lround
31define i64 @testmsxd(double %x) {
32entry:
33  %0 = tail call i64 @llvm.lround.i64.f64(double %x)
34  ret i64 %0
35}
36
37; CHECK-LABEL: testmswl:
38; CHECK:       bl      lroundl
39define signext i32 @testmswl(ppc_fp128 %x) {
40entry:
41  %0 = tail call i64 @llvm.lround.i64.ppcf128(ppc_fp128 %x)
42  %conv = trunc i64 %0 to i32
43  ret i32 %conv
44}
45
46; CHECK-LABEL: testmsll:
47; CHECK:       bl      lroundl
48define i64 @testmsll(ppc_fp128 %x) {
49entry:
50  %0 = tail call i64 @llvm.lround.i64.ppcf128(ppc_fp128 %x)
51  ret i64 %0
52}
53
54declare i64 @llvm.lround.i64.f32(float) nounwind readnone
55declare i64 @llvm.lround.i64.f64(double) nounwind readnone
56declare i64 @llvm.lround.i64.ppcf128(ppc_fp128) nounwind readnone
57