2015-08-12 00:51:31 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse2 | FileCheck %s
|
2010-01-01 11:32:16 +08:00
|
|
|
; Ideally this would compile to 5 multiplies.
|
|
|
|
|
2015-08-12 00:51:31 +08:00
|
|
|
define double @pow_wrapper(double %a) nounwind readonly ssp noredzone {
|
|
|
|
; CHECK-LABEL: pow_wrapper:
|
|
|
|
; CHECK: # BB#0:
|
|
|
|
; CHECK-NEXT: movapd %xmm0, %xmm1
|
2017-10-04 00:59:13 +08:00
|
|
|
; CHECK-NEXT: mulsd %xmm1, %xmm1
|
2015-08-12 00:51:31 +08:00
|
|
|
; CHECK-NEXT: mulsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: mulsd %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: mulsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: mulsd %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: mulsd %xmm0, %xmm1
|
|
|
|
; CHECK-NEXT: movapd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1]
|
|
|
|
ret double %ret
|
2010-01-01 11:32:16 +08:00
|
|
|
}
|
|
|
|
|
2015-08-12 01:04:31 +08:00
|
|
|
define double @pow_wrapper_optsize(double %a) optsize {
|
2015-08-12 00:58:49 +08:00
|
|
|
; CHECK-LABEL: pow_wrapper_optsize:
|
|
|
|
; CHECK: # BB#0:
|
|
|
|
; CHECK-NEXT: movl $15, %edi
|
|
|
|
; CHECK-NEXT: jmp
|
|
|
|
%ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1]
|
|
|
|
ret double %ret
|
|
|
|
}
|
|
|
|
|
2015-08-12 01:04:31 +08:00
|
|
|
define double @pow_wrapper_minsize(double %a) minsize {
|
2015-08-12 00:58:49 +08:00
|
|
|
; CHECK-LABEL: pow_wrapper_minsize:
|
|
|
|
; CHECK: # BB#0:
|
2016-03-25 09:10:56 +08:00
|
|
|
; CHECK-NEXT: pushq $15
|
|
|
|
; CHECK: popq %rdi
|
|
|
|
; CHECK: jmp
|
2016-01-05 10:32:06 +08:00
|
|
|
%ret = tail call double @llvm.powi.f64(double %a, i32 15) nounwind ; <double> [#uses=1]
|
2015-08-12 00:58:49 +08:00
|
|
|
ret double %ret
|
|
|
|
}
|
|
|
|
|
2010-01-01 11:32:16 +08:00
|
|
|
declare double @llvm.powi.f64(double, i32) nounwind readonly
|
|
|
|
|