Home | History | Annotate | Download | only in Generic
      1 ; RUN: llc < %s
      2 
      3 ;; SQRT
      4 declare float @llvm.sqrt.f32(float)
      5 
      6 declare double @llvm.sqrt.f64(double)
      7 
      8 define double @test_sqrt(float %F) {
      9         %G = call float @llvm.sqrt.f32( float %F )              ; <float> [#uses=1]
     10         %H = fpext float %G to double           ; <double> [#uses=1]
     11         %I = call double @llvm.sqrt.f64( double %H )            ; <double> [#uses=1]
     12         ret double %I
     13 }
     14 
     15 
     16 ; SIN
     17 declare float @sinf(float) readonly
     18 
     19 declare double @sin(double) readonly
     20 
     21 define double @test_sin(float %F) {
     22         %G = call float @sinf( float %F )               ; <float> [#uses=1]
     23         %H = fpext float %G to double           ; <double> [#uses=1]
     24         %I = call double @sin( double %H )              ; <double> [#uses=1]
     25         ret double %I
     26 }
     27 
     28 
     29 ; COS
     30 declare float @cosf(float) readonly
     31 
     32 declare double @cos(double) readonly
     33 
     34 define double @test_cos(float %F) {
     35         %G = call float @cosf( float %F )               ; <float> [#uses=1]
     36         %H = fpext float %G to double           ; <double> [#uses=1]
     37         %I = call double @cos( double %H )              ; <double> [#uses=1]
     38         ret double %I
     39 }
     40 
     41