1 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s
2 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -enable-unsafe-fp-math | FileCheck -check-prefix=CHECK-FM %s
3 target 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"
4 target triple = "powerpc64-unknown-linux-gnu"
6 define float @test1(float %x) nounwind {
7 %call = tail call float @floorf(float %x) nounwind readnone
17 declare float @floorf(float) nounwind readnone
19 define double @test2(double %x) nounwind {
20 %call = tail call double @floor(double %x) nounwind readnone
30 declare double @floor(double) nounwind readnone
32 define float @test3(float %x) nounwind {
33 %call = tail call float @nearbyintf(float %x) nounwind readnone
43 declare float @nearbyintf(float) nounwind readnone
45 define double @test4(double %x) nounwind {
46 %call = tail call double @nearbyint(double %x) nounwind readnone
56 declare double @nearbyint(double) nounwind readnone
58 define float @test5(float %x) nounwind {
59 %call = tail call float @ceilf(float %x) nounwind readnone
69 declare float @ceilf(float) nounwind readnone
71 define double @test6(double %x) nounwind {
72 %call = tail call double @ceil(double %x) nounwind readnone
82 declare double @ceil(double) nounwind readnone
84 define float @test9(float %x) nounwind {
85 %call = tail call float @truncf(float %x) nounwind readnone
95 declare float @truncf(float) nounwind readnone
97 define double @test10(double %x) nounwind {
98 %call = tail call double @trunc(double %x) nounwind readnone
105 ; CHECK-FM: friz 1, 1
108 declare double @trunc(double) nounwind readnone
110 define void @test11(float %x, float* %y) nounwind {
111 %call = tail call float @rintf(float %x) nounwind readnone
112 store float %call, float* %y
119 ; CHECK-FM: frin [[R2:[0-9]+]], [[R1:[0-9]+]]
120 ; CHECK-FM: fcmpu [[CR:[0-9]+]], [[R2]], [[R1]]
121 ; CHECK-FM: beq [[CR]], .LBB[[BB:[0-9]+]]_2
123 ; CHECK-FM: .LBB[[BB]]_2:
127 declare float @rintf(float) nounwind readnone
129 define void @test12(double %x, double* %y) nounwind {
130 %call = tail call double @rint(double %x) nounwind readnone
131 store double %call, double* %y
138 ; CHECK-FM: frin [[R2:[0-9]+]], [[R1:[0-9]+]]
139 ; CHECK-FM: fcmpu [[CR:[0-9]+]], [[R2]], [[R1]]
140 ; CHECK-FM: beq [[CR]], .LBB[[BB:[0-9]+]]_2
142 ; CHECK-FM: .LBB[[BB]]_2:
146 declare double @rint(double) nounwind readnone