Home | History | Annotate | Download | only in X86
      1 ; Make sure this testcase codegens to the sin and cos instructions, not calls
      2 ; RUN: llc < %s -mtriple=i686-apple-macosx -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math  | FileCheck %s --check-prefix=SIN
      3 ; RUN: llc < %s -mtriple=i686-apple-macosx -mattr=-sse,-sse2,-sse3 -enable-unsafe-fp-math  | FileCheck %s --check-prefix=COS
      4 
      5 declare float  @sinf(float) readonly
      6 
      7 declare double @sin(double) readonly
      8 
      9 declare x86_fp80 @sinl(x86_fp80) readonly
     10 
     11 ; SIN: test1:
     12 define float @test1(float %X) {
     13         %Y = call float @sinf(float %X) readonly
     14         ret float %Y
     15 }
     16 ; SIN: {{^[ \t]*fsin$}}
     17 
     18 ; SIN-NOT: fsin
     19 
     20 ; SIN: test2:
     21 define double @test2(double %X) {
     22         %Y = call double @sin(double %X) readonly
     23         ret double %Y
     24 }
     25 ; SIN: {{^[ \t]*fsin$}}
     26 
     27 ; SIN-NOT: fsin
     28 
     29 ; SIN: test3:
     30 define x86_fp80 @test3(x86_fp80 %X) {
     31         %Y = call x86_fp80 @sinl(x86_fp80 %X) readonly
     32         ret x86_fp80 %Y
     33 }
     34 ; SIN: {{^[ \t]*fsin$}}
     35 
     36 ; SIN-NOT: fsin
     37 ; COS-NOT: fcos
     38 declare float @cosf(float) readonly
     39 
     40 declare double @cos(double) readonly
     41 
     42 declare x86_fp80 @cosl(x86_fp80) readonly
     43 
     44 
     45 ; SIN: test4:
     46 ; COS: test3:
     47 define float @test4(float %X) {
     48         %Y = call float @cosf(float %X) readonly
     49         ret float %Y
     50 }
     51 ; COS: {{^[ \t]*fcos}}
     52 
     53 define double @test5(double %X) {
     54         %Y = call double @cos(double %X) readonly
     55         ret double %Y
     56 }
     57 ; COS: {{^[ \t]*fcos}}
     58 
     59 define x86_fp80 @test6(x86_fp80 %X) {
     60         %Y = call x86_fp80 @cosl(x86_fp80 %X) readonly
     61         ret x86_fp80 %Y
     62 }
     63 ; COS: {{^[ \t]*fcos}}
     64 
     65 ; SIN-NOT: fsin
     66 ; COS-NOT: fcos
     67