Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 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 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 9 | ; CHECK-LABEL: test1: |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 10 | ; CHECK: frim 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 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 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 19 | ; CHECK-LABEL: test2: |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 20 | ; CHECK: frim 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | declare double @floor(double) nounwind readnone |
| 24 | |
| 25 | define float @test3(float %x) nounwind { |
Hal Finkel | 05a4d26 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 26 | %call = tail call float @roundf(float %x) nounwind readnone |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 27 | ret float %call |
| 28 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 29 | ; CHECK-LABEL: test3: |
Hal Finkel | 05a4d26 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 30 | ; CHECK: frin 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Hal Finkel | 05a4d26 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 33 | declare float @roundf(float) nounwind readnone |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 34 | |
| 35 | define double @test4(double %x) nounwind { |
Hal Finkel | 05a4d26 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 36 | %call = tail call double @round(double %x) nounwind readnone |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 37 | ret double %call |
| 38 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 39 | ; CHECK-LABEL: test4: |
Hal Finkel | 05a4d26 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 40 | ; CHECK: frin 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 41 | } |
| 42 | |
Hal Finkel | 05a4d26 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 43 | declare double @round(double) nounwind readnone |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 44 | |
| 45 | define float @test5(float %x) nounwind { |
| 46 | %call = tail call float @ceilf(float %x) nounwind readnone |
| 47 | ret float %call |
| 48 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 49 | ; CHECK-LABEL: test5: |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 50 | ; CHECK: frip 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 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 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 59 | ; CHECK-LABEL: test6: |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 60 | ; CHECK: frip 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 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 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 69 | ; CHECK-LABEL: test9: |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 70 | ; CHECK: friz 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 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 | |
Stephen Lin | b4dc023 | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 79 | ; CHECK-LABEL: test10: |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 80 | ; CHECK: friz 1, 1 |
Hal Finkel | f5d5c43 | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | declare double @trunc(double) nounwind readnone |
Hal Finkel | 0882fd6 | 2013-03-29 19:41:55 +0000 | [diff] [blame] | 84 | |