]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/PowerPC/rounding-ops.ll
Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / CodeGen / PowerPC / rounding-ops.ll
1 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s
2 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"
3 target triple = "powerpc64-unknown-linux-gnu"
4
5 define float @test1(float %x) nounwind  {
6   %call = tail call float @floorf(float %x) nounwind readnone
7   ret float %call
8
9 ; CHECK-LABEL: test1:
10 ; CHECK: frim 1, 1
11 }
12
13 declare float @floorf(float) nounwind readnone
14
15 define double @test2(double %x) nounwind  {
16   %call = tail call double @floor(double %x) nounwind readnone
17   ret double %call
18
19 ; CHECK-LABEL: test2:
20 ; CHECK: frim 1, 1
21 }
22
23 declare double @floor(double) nounwind readnone
24
25 define float @test3(float %x) nounwind  {
26   %call = tail call float @roundf(float %x) nounwind readnone
27   ret float %call
28
29 ; CHECK-LABEL: test3:
30 ; CHECK: frin 1, 1
31 }
32
33 declare float @roundf(float) nounwind readnone
34
35 define double @test4(double %x) nounwind  {
36   %call = tail call double @round(double %x) nounwind readnone
37   ret double %call
38
39 ; CHECK-LABEL: test4:
40 ; CHECK: frin 1, 1
41 }
42
43 declare double @round(double) nounwind readnone
44
45 define float @test5(float %x) nounwind  {
46   %call = tail call float @ceilf(float %x) nounwind readnone
47   ret float %call
48
49 ; CHECK-LABEL: test5:
50 ; CHECK: frip 1, 1
51 }
52
53 declare float @ceilf(float) nounwind readnone
54
55 define double @test6(double %x) nounwind  {
56   %call = tail call double @ceil(double %x) nounwind readnone
57   ret double %call
58
59 ; CHECK-LABEL: test6:
60 ; CHECK: frip 1, 1
61 }
62
63 declare double @ceil(double) nounwind readnone
64
65 define float @test9(float %x) nounwind  {
66   %call = tail call float @truncf(float %x) nounwind readnone
67   ret float %call
68
69 ; CHECK-LABEL: test9:
70 ; CHECK: friz 1, 1
71 }
72
73 declare float @truncf(float) nounwind readnone
74
75 define double @test10(double %x) nounwind  {
76   %call = tail call double @trunc(double %x) nounwind readnone
77   ret double %call
78
79 ; CHECK-LABEL: test10:
80 ; CHECK: friz 1, 1
81 }
82
83 declare double @trunc(double) nounwind readnone
84