X86: Disable generation of rep;movsl when %esi is used as a base pointer.
[oota-llvm.git] / test / CodeGen / X86 / sincos-opt.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-macosx10.9.0 -mcpu=core2 | FileCheck %s --check-prefix=SINCOS
2 ; RUN: llc < %s -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core2 | FileCheck %s --check-prefix=NOOPT
3
4 ; Combine sin / cos into a single call.
5 ; rdar://13087969
6
7 define float @test1(float %x) nounwind {
8 entry:
9 ; SINCOS: test1:
10 ; SINCOS: callq ___sincosf_stret
11 ; SINCOS: addss %xmm1, %xmm0
12
13 ; NOOPT: test1
14 ; NOOPT: callq _cosf
15 ; NOOPT: callq _sinf
16   %call = tail call float @sinf(float %x) nounwind readnone
17   %call1 = tail call float @cosf(float %x) nounwind readnone
18   %add = fadd float %call, %call1
19   ret float %add
20 }
21
22 define double @test2(double %x) nounwind {
23 entry:
24 ; SINCOS: test2:
25 ; SINCOS: callq ___sincos_stret
26 ; SINCOS: addsd %xmm1, %xmm0
27
28 ; NOOPT: test2
29 ; NOOPT: callq _cos
30 ; NOOPT: callq _sin
31   %call = tail call double @sin(double %x) nounwind readnone
32   %call1 = tail call double @cos(double %x) nounwind readnone
33   %add = fadd double %call, %call1
34   ret double %add
35 }
36
37 declare float  @sinf(float) readonly
38 declare double @sin(double) readonly
39 declare float @cosf(float) readonly
40 declare double @cos(double) readonly