1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse2 | FileCheck %s
2 ; Ideally this would compile to 5 multiplies.
4 define double @pow_wrapper(double %a) nounwind readonly ssp noredzone {
5 ; CHECK-LABEL: pow_wrapper:
7 ; CHECK-NEXT: movapd %xmm0, %xmm1
8 ; CHECK-NEXT: mulsd %xmm1, %xmm1
9 ; CHECK-NEXT: mulsd %xmm1, %xmm0
10 ; CHECK-NEXT: mulsd %xmm1, %xmm1
11 ; CHECK-NEXT: mulsd %xmm1, %xmm0
12 ; CHECK-NEXT: mulsd %xmm1, %xmm1
13 ; CHECK-NEXT: mulsd %xmm0, %xmm1
14 ; CHECK-NEXT: movapd %xmm1, %xmm0
16 %ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1]
20 define double @pow_wrapper_optsize(double %a) optsize {
21 ; CHECK-LABEL: pow_wrapper_optsize:
23 ; CHECK-NEXT: movl $15, %edi
25 %ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1]
29 ; FIXME: Should not expand with minsize
31 define double @pow_wrapper_minsize(double %a) minsize {
32 ; CHECK-LABEL: pow_wrapper_minsize:
34 ; CHECK-NEXT: movapd %xmm0, %xmm1
35 ; CHECK-NEXT: mulsd %xmm1, %xmm1
36 ; CHECK-NEXT: mulsd %xmm1, %xmm0
37 ; CHECK-NEXT: mulsd %xmm1, %xmm1
38 ; CHECK-NEXT: mulsd %xmm1, %xmm0
39 ; CHECK-NEXT: mulsd %xmm1, %xmm1
40 ; CHECK-NEXT: mulsd %xmm0, %xmm1
41 ; CHECK-NEXT: movapd %xmm1, %xmm0
43 %ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1]
47 declare double @llvm.powi.f64(double, i32) nounwind readonly