Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx < %s | FileCheck %s
      2 ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx < %s | FileCheck -check-prefix=CHECK-VSX %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"
      5 
      6 define float @test1(float %x) nounwind  {
      7   %call = tail call float @floorf(float %x) nounwind readnone
      8   ret float %call
      9 
     10 ; CHECK-LABEL: test1:
     11 ; CHECK: frim 1, 1
     12 ; CHECK-VSX-LABEL: test1:
     13 ; CHECK-VSX: frim 1, 1
     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 
     22 ; CHECK-LABEL: test2:
     23 ; CHECK: frim 1, 1
     24 ; CHECK-VSX-LABEL: test2:
     25 ; CHECK-VSX: xsrdpim 1, 1
     26 }
     27 
     28 declare double @floor(double) nounwind readnone
     29 
     30 define float @test3(float %x) nounwind  {
     31   %call = tail call float @roundf(float %x) nounwind readnone
     32   ret float %call
     33 
     34 ; CHECK-LABEL: test3:
     35 ; CHECK: frin 1, 1
     36 ; CHECK-VSX-LABEL: test3:
     37 ; CHECK-VSX: frin 1, 1
     38 }
     39 
     40 declare float @roundf(float) nounwind readnone
     41 
     42 define double @test4(double %x) nounwind  {
     43   %call = tail call double @round(double %x) nounwind readnone
     44   ret double %call
     45 
     46 ; CHECK-LABEL: test4:
     47 ; CHECK: frin 1, 1
     48 ; CHECK-VSX-LABEL: test4:
     49 ; CHECK-VSX: xsrdpi 1, 1
     50 }
     51 
     52 declare double @round(double) nounwind readnone
     53 
     54 define float @test5(float %x) nounwind  {
     55   %call = tail call float @ceilf(float %x) nounwind readnone
     56   ret float %call
     57 
     58 ; CHECK-LABEL: test5:
     59 ; CHECK: frip 1, 1
     60 ; CHECK-VSX-LABEL: test5:
     61 ; CHECK-VSX: frip 1, 1
     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 
     70 ; CHECK-LABEL: test6:
     71 ; CHECK: frip 1, 1
     72 ; CHECK-VSX-LABEL: test6:
     73 ; CHECK-VSX: xsrdpip 1, 1
     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 
     82 ; CHECK-LABEL: test9:
     83 ; CHECK: friz 1, 1
     84 ; CHECK-VSX-LABEL: test9:
     85 ; CHECK-VSX: friz 1, 1
     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 
     94 ; CHECK-LABEL: test10:
     95 ; CHECK: friz 1, 1
     96 ; CHECK-VSX-LABEL: test10:
     97 ; CHECK-VSX: xsrdpiz 1, 1
     98 }
     99 
    100 declare double @trunc(double) nounwind readnone
    101 
    102