Debian Codegraph @

llvm/test/CodeGen/PowerPC/lrint-conv.ll

raw
1 ; RUN: llc < %s -mtriple=powerpc64le | FileCheck %s
2 ; RUN: llc < %s -mtriple=powerpc | FileCheck %s
3
4 ; FIXME: crash "Input type needs to be promoted!"
5 ; define signext i32 @testmswh(half %x) {
6 ; entry:
7 ; %0 = tail call i64 @llvm.lrint.i64.f16(half %x)
8 ; %conv = trunc i64 %0 to i32
9 ; ret i32 %conv
10 ; }
11
12 ; define i64 @testmsxh(half %x) {
13 ; entry:
14 ; %0 = tail call i64 @llvm.lrint.i64.f16(half %x)
15 ; ret i64 %0
16 ; }
17
18 ; CHECK-LABEL: testmsws:
19 ; CHECK: bl lrintf
20 define signext i32 @testmsws(float %x) {
21 entry:
22 %0 = tail call i64 @llvm.lrint.i64.f32(float %x)
23 %conv = trunc i64 %0 to i32
24 ret i32 %conv
25 }
26
27 ; CHECK-LABEL: testmsxs:
28 ; CHECK: bl lrintf
29 define i64 @testmsxs(float %x) {
30 entry:
31 %0 = tail call i64 @llvm.lrint.i64.f32(float %x)
32 ret i64 %0
33 }
34
35 ; CHECK-LABEL: testmswd:
36 ; CHECK: bl lrint
37 define signext i32 @testmswd(double %x) {
38 entry:
39 %0 = tail call i64 @llvm.lrint.i64.f64(double %x)
40 %conv = trunc i64 %0 to i32
41 ret i32 %conv
42 }
43
44 ; CHECK-LABEL: testmsxd:
45 ; CHECK: bl lrint
46 define i64 @testmsxd(double %x) {
47 entry:
48 %0 = tail call i64 @llvm.lrint.i64.f64(double %x)
49 ret i64 %0
50 }
51
52 ; CHECK-LABEL: testmswl:
53 ; CHECK: bl lrintl
54 define signext i32 @testmswl(ppc_fp128 %x) {
55 entry:
56 %0 = tail call i64 @llvm.lrint.i64.ppcf128(ppc_fp128 %x)
57 %conv = trunc i64 %0 to i32
58 ret i32 %conv
59 }
60
61 ; CHECK-LABEL: testmsll:
62 ; CHECK: bl lrintl
63 define i64 @testmsll(ppc_fp128 %x) {
64 entry:
65 %0 = tail call i64 @llvm.lrint.i64.ppcf128(ppc_fp128 %x)
66 ret i64 %0
67 }
68
69 ; CHECK-LABEL: testmswq:
70 ; CHECK: bl lrintf128
71 define signext i32 @testmswq(fp128 %x) {
72 entry:
73 %0 = tail call i64 @llvm.lrint.i64.f128(fp128 %x)
74 %conv = trunc i64 %0 to i32
75 ret i32 %conv
76 }
77
78 ; CHECK-LABEL: testmslq:
79 ; CHECK: bl lrintf128
80 define i64 @testmslq(fp128 %x) {
81 entry:
82 %0 = tail call i64 @llvm.lrint.i64.f128(fp128 %x)
83 ret i64 %0
84 }
85
86 declare i64 @llvm.lrint.i64.f32(float) nounwind readnone
87 declare i64 @llvm.lrint.i64.f64(double) nounwind readnone
88 declare i64 @llvm.lrint.i64.ppcf128(ppc_fp128) nounwind readnone