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