mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 20:29:53 +00:00
3cb206f57f
Differential Revision: https://reviews.llvm.org/D28479 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291486 91177308-0d34-0410-b5e6-96231b3b80d8
23 lines
690 B
LLVM
23 lines
690 B
LLVM
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
|
|
define double @pow_half(double %x) {
|
|
%pow = call fast double @llvm.pow.f64(double %x, double 5.000000e-01)
|
|
ret double %pow
|
|
}
|
|
|
|
; CHECK-LABEL: define double @pow_half(
|
|
; CHECK-NEXT: %sqrt = call fast double @sqrt(double %x)
|
|
; CHECK-NEXT: ret double %sqrt
|
|
|
|
define double @pow_neghalf(double %x) {
|
|
%pow = call fast double @llvm.pow.f64(double %x, double -5.000000e-01)
|
|
ret double %pow
|
|
}
|
|
|
|
; CHECK-LABEL: define double @pow_neghalf(
|
|
; CHECK-NEXT: %sqrt = call fast double @sqrt(double %x) #0
|
|
; CHECK-NEXT: %sqrtrecip = fdiv fast double 1.000000e+00, %sqrt
|
|
; CHECK-NEXT: ret double %sqrtrecip
|
|
|
|
declare double @llvm.pow.f64(double, double)
|