Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -mtriple=armv8-linux-gnueabihf -mattr=+fp-armv8 | FileCheck --check-prefix=CHECK --check-prefix=DP %s
      2 ; RUN: llc < %s -mtriple=thumbv7em-linux-gnueabihf -mattr=+fp-armv8,+d16,+fp-only-sp | FileCheck --check-prefix=SP %s
      3 ; RUN: llc < %s -mtriple=thumbv7em-linux-gnueabihf -mattr=+fp-armv8,+d16 | FileCheck --check-prefix=DP %s
      4 
      5 ; CHECK-LABEL: test1
      6 ; CHECK: vrintm.f32
      7 define float @test1(float %a) {
      8 entry:
      9   %call = call float @floorf(float %a) nounwind readnone
     10   ret float %call
     11 }
     12 
     13 ; CHECK-LABEL: test2
     14 ; SP: b floor
     15 ; DP: vrintm.f64
     16 define double @test2(double %a) {
     17 entry:
     18   %call = call double @floor(double %a) nounwind readnone
     19   ret double %call
     20 }
     21 
     22 ; CHECK-LABEL: test3
     23 ; CHECK: vrintp.f32
     24 define float @test3(float %a) {
     25 entry:
     26   %call = call float @ceilf(float %a) nounwind readnone
     27   ret float %call
     28 }
     29 
     30 ; CHECK-LABEL: test4
     31 ; SP: b ceil
     32 ; DP: vrintp.f64
     33 define double @test4(double %a) {
     34 entry:
     35   %call = call double @ceil(double %a) nounwind readnone
     36   ret double %call
     37 }
     38 
     39 ; CHECK-LABEL: test5
     40 ; CHECK: vrinta.f32
     41 define float @test5(float %a) {
     42 entry:
     43   %call = call float @roundf(float %a) nounwind readnone
     44   ret float %call
     45 }
     46 
     47 ; CHECK-LABEL: test6
     48 ; SP: b round
     49 ; DP: vrinta.f64
     50 define double @test6(double %a) {
     51 entry:
     52   %call = call double @round(double %a) nounwind readnone
     53   ret double %call
     54 }
     55 
     56 ; CHECK-LABEL: test7
     57 ; CHECK: vrintz.f32
     58 define float @test7(float %a) {
     59 entry:
     60   %call = call float @truncf(float %a) nounwind readnone
     61   ret float %call
     62 }
     63 
     64 ; CHECK-LABEL: test8
     65 ; SP: b trunc
     66 ; DP: vrintz.f64
     67 define double @test8(double %a) {
     68 entry:
     69   %call = call double @trunc(double %a) nounwind readnone
     70   ret double %call
     71 }
     72 
     73 ; CHECK-LABEL: test9
     74 ; CHECK: vrintr.f32
     75 define float @test9(float %a) {
     76 entry:
     77   %call = call float @nearbyintf(float %a) nounwind readnone
     78   ret float %call
     79 }
     80 
     81 ; CHECK-LABEL: test10
     82 ; SP: b nearbyint
     83 ; DP: vrintr.f64
     84 define double @test10(double %a) {
     85 entry:
     86   %call = call double @nearbyint(double %a) nounwind readnone
     87   ret double %call
     88 }
     89 
     90 ; CHECK-LABEL: test11
     91 ; CHECK: vrintx.f32
     92 define float @test11(float %a) {
     93 entry:
     94   %call = call float @rintf(float %a) nounwind readnone
     95   ret float %call
     96 }
     97 
     98 ; CHECK-LABEL: test12
     99 ; SP: b rint
    100 ; DP: vrintx.f64
    101 define double @test12(double %a) {
    102 entry:
    103   %call = call double @rint(double %a) nounwind readnone
    104   ret double %call
    105 }
    106 
    107 declare float @floorf(float) nounwind readnone
    108 declare double @floor(double) nounwind readnone
    109 declare float @ceilf(float) nounwind readnone
    110 declare double @ceil(double) nounwind readnone
    111 declare float @roundf(float) nounwind readnone
    112 declare double @round(double) nounwind readnone
    113 declare float @truncf(float) nounwind readnone
    114 declare double @trunc(double) nounwind readnone
    115 declare float @nearbyintf(float) nounwind readnone
    116 declare double @nearbyint(double) nounwind readnone
    117 declare float @rintf(float) nounwind readnone
    118 declare double @rint(double) nounwind readnone
    119