mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-11 21:56:15 +00:00
[InstCombine] add tests for 'afn' FMF; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318423 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dbaffd4be3
commit
da65f7f639
@ -19,6 +19,27 @@ define double @pow_neghalf(double %x) {
|
||||
ret double %pow
|
||||
}
|
||||
|
||||
define double @pow_half_approx(double %x) {
|
||||
; CHECK-LABEL: @pow_half_approx(
|
||||
; CHECK-NEXT: [[SQRT:%.*]] = call double @sqrt(double %x) #1
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.fabs.f64(double [[SQRT]])
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fcmp oeq double %x, 0xFFF0000000000000
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = select i1 [[TMP2]], double 0x7FF0000000000000, double [[TMP1]]
|
||||
; CHECK-NEXT: ret double [[TMP3]]
|
||||
;
|
||||
%pow = call afn double @llvm.pow.f64(double %x, double 5.000000e-01)
|
||||
ret double %pow
|
||||
}
|
||||
|
||||
define double @pow_neghalf_approx(double %x) {
|
||||
; CHECK-LABEL: @pow_neghalf_approx(
|
||||
; CHECK-NEXT: [[POW:%.*]] = call afn double @llvm.pow.f64(double %x, double -5.000000e-01)
|
||||
; CHECK-NEXT: ret double [[POW]]
|
||||
;
|
||||
%pow = call afn double @llvm.pow.f64(double %x, double -5.000000e-01)
|
||||
ret double %pow
|
||||
}
|
||||
|
||||
declare double @llvm.pow.f64(double, double) #0
|
||||
|
||||
attributes #0 = { nounwind readnone speculatable }
|
||||
|
Loading…
Reference in New Issue
Block a user