Ehsan Amiri | a538b0f | 2016-08-03 18:17:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx < %s | FileCheck %s |
| 2 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx < %s | FileCheck -check-prefix=CHECK-VSX %s |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 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" |
| 5 | |
| 6 | define float @test1(float %x) nounwind { |
| 7 | %call = tail call float @floorf(float %x) nounwind readnone |
| 8 | ret float %call |
| 9 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 10 | ; CHECK-LABEL: test1: |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 11 | ; CHECK: frim 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 12 | ; CHECK-VSX-LABEL: test1: |
| 13 | ; CHECK-VSX: frim 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | declare float @floorf(float) nounwind readnone |
| 17 | |
| 18 | define double @test2(double %x) nounwind { |
| 19 | %call = tail call double @floor(double %x) nounwind readnone |
| 20 | ret double %call |
| 21 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 22 | ; CHECK-LABEL: test2: |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 23 | ; CHECK: frim 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 24 | ; CHECK-VSX-LABEL: test2: |
| 25 | ; CHECK-VSX: xsrdpim 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | declare double @floor(double) nounwind readnone |
| 29 | |
| 30 | define float @test3(float %x) nounwind { |
Hal Finkel | 2b7b2f3 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 31 | %call = tail call float @roundf(float %x) nounwind readnone |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 32 | ret float %call |
| 33 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 34 | ; CHECK-LABEL: test3: |
Hal Finkel | 2b7b2f3 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 35 | ; CHECK: frin 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 36 | ; CHECK-VSX-LABEL: test3: |
| 37 | ; CHECK-VSX: frin 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Hal Finkel | 2b7b2f3 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 40 | declare float @roundf(float) nounwind readnone |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 41 | |
| 42 | define double @test4(double %x) nounwind { |
Hal Finkel | 2b7b2f3 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 43 | %call = tail call double @round(double %x) nounwind readnone |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 44 | ret double %call |
| 45 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 46 | ; CHECK-LABEL: test4: |
Hal Finkel | 2b7b2f3 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 47 | ; CHECK: frin 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 48 | ; CHECK-VSX-LABEL: test4: |
| 49 | ; CHECK-VSX: xsrdpi 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 50 | } |
| 51 | |
Hal Finkel | 2b7b2f3 | 2013-08-08 04:31:34 +0000 | [diff] [blame] | 52 | declare double @round(double) nounwind readnone |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 53 | |
| 54 | define float @test5(float %x) nounwind { |
| 55 | %call = tail call float @ceilf(float %x) nounwind readnone |
| 56 | ret float %call |
| 57 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 58 | ; CHECK-LABEL: test5: |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 59 | ; CHECK: frip 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 60 | ; CHECK-VSX-LABEL: test5: |
| 61 | ; CHECK-VSX: frip 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | declare float @ceilf(float) nounwind readnone |
| 65 | |
| 66 | define double @test6(double %x) nounwind { |
| 67 | %call = tail call double @ceil(double %x) nounwind readnone |
| 68 | ret double %call |
| 69 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 70 | ; CHECK-LABEL: test6: |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 71 | ; CHECK: frip 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 72 | ; CHECK-VSX-LABEL: test6: |
| 73 | ; CHECK-VSX: xsrdpip 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | declare double @ceil(double) nounwind readnone |
| 77 | |
| 78 | define float @test9(float %x) nounwind { |
| 79 | %call = tail call float @truncf(float %x) nounwind readnone |
| 80 | ret float %call |
| 81 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 82 | ; CHECK-LABEL: test9: |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 83 | ; CHECK: friz 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 84 | ; CHECK-VSX-LABEL: test9: |
| 85 | ; CHECK-VSX: friz 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | declare float @truncf(float) nounwind readnone |
| 89 | |
| 90 | define double @test10(double %x) nounwind { |
| 91 | %call = tail call double @trunc(double %x) nounwind readnone |
| 92 | ret double %call |
| 93 | |
Stephen Lin | f799e3f | 2013-07-13 20:38:47 +0000 | [diff] [blame] | 94 | ; CHECK-LABEL: test10: |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 95 | ; CHECK: friz 1, 1 |
Bill Schmidt | 32e9c64 | 2014-10-17 01:41:22 +0000 | [diff] [blame] | 96 | ; CHECK-VSX-LABEL: test10: |
| 97 | ; CHECK-VSX: xsrdpiz 1, 1 |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | declare double @trunc(double) nounwind readnone |
Hal Finkel | f8ac57e | 2013-03-29 19:41:55 +0000 | [diff] [blame] | 101 | |