blob: bf0a6415df677c00ae976c82ebdab27e6c70659b [file] [log] [blame]
Hal Finkelf5d5c432013-03-29 08:57:48 +00001; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s
Hal Finkelf5d5c432013-03-29 08:57:48 +00002target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5define float @test1(float %x) nounwind {
6 %call = tail call float @floorf(float %x) nounwind readnone
7 ret float %call
8
Stephen Linb4dc0232013-07-13 20:38:47 +00009; CHECK-LABEL: test1:
Hal Finkelf5d5c432013-03-29 08:57:48 +000010; CHECK: frim 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000011}
12
13declare float @floorf(float) nounwind readnone
14
15define double @test2(double %x) nounwind {
16 %call = tail call double @floor(double %x) nounwind readnone
17 ret double %call
18
Stephen Linb4dc0232013-07-13 20:38:47 +000019; CHECK-LABEL: test2:
Hal Finkelf5d5c432013-03-29 08:57:48 +000020; CHECK: frim 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000021}
22
23declare double @floor(double) nounwind readnone
24
25define float @test3(float %x) nounwind {
Hal Finkel05a4d262013-08-08 04:31:34 +000026 %call = tail call float @roundf(float %x) nounwind readnone
Hal Finkelf5d5c432013-03-29 08:57:48 +000027 ret float %call
28
Stephen Linb4dc0232013-07-13 20:38:47 +000029; CHECK-LABEL: test3:
Hal Finkel05a4d262013-08-08 04:31:34 +000030; CHECK: frin 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000031}
32
Hal Finkel05a4d262013-08-08 04:31:34 +000033declare float @roundf(float) nounwind readnone
Hal Finkelf5d5c432013-03-29 08:57:48 +000034
35define double @test4(double %x) nounwind {
Hal Finkel05a4d262013-08-08 04:31:34 +000036 %call = tail call double @round(double %x) nounwind readnone
Hal Finkelf5d5c432013-03-29 08:57:48 +000037 ret double %call
38
Stephen Linb4dc0232013-07-13 20:38:47 +000039; CHECK-LABEL: test4:
Hal Finkel05a4d262013-08-08 04:31:34 +000040; CHECK: frin 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000041}
42
Hal Finkel05a4d262013-08-08 04:31:34 +000043declare double @round(double) nounwind readnone
Hal Finkelf5d5c432013-03-29 08:57:48 +000044
45define float @test5(float %x) nounwind {
46 %call = tail call float @ceilf(float %x) nounwind readnone
47 ret float %call
48
Stephen Linb4dc0232013-07-13 20:38:47 +000049; CHECK-LABEL: test5:
Hal Finkelf5d5c432013-03-29 08:57:48 +000050; CHECK: frip 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000051}
52
53declare float @ceilf(float) nounwind readnone
54
55define double @test6(double %x) nounwind {
56 %call = tail call double @ceil(double %x) nounwind readnone
57 ret double %call
58
Stephen Linb4dc0232013-07-13 20:38:47 +000059; CHECK-LABEL: test6:
Hal Finkelf5d5c432013-03-29 08:57:48 +000060; CHECK: frip 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000061}
62
63declare double @ceil(double) nounwind readnone
64
65define float @test9(float %x) nounwind {
66 %call = tail call float @truncf(float %x) nounwind readnone
67 ret float %call
68
Stephen Linb4dc0232013-07-13 20:38:47 +000069; CHECK-LABEL: test9:
Hal Finkelf5d5c432013-03-29 08:57:48 +000070; CHECK: friz 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000071}
72
73declare float @truncf(float) nounwind readnone
74
75define double @test10(double %x) nounwind {
76 %call = tail call double @trunc(double %x) nounwind readnone
77 ret double %call
78
Stephen Linb4dc0232013-07-13 20:38:47 +000079; CHECK-LABEL: test10:
Hal Finkelf5d5c432013-03-29 08:57:48 +000080; CHECK: friz 1, 1
Hal Finkelf5d5c432013-03-29 08:57:48 +000081}
82
83declare double @trunc(double) nounwind readnone
Hal Finkel0882fd62013-03-29 19:41:55 +000084