aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/PowerPC
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-09-12 19:04:12 +0000
committerHal Finkel <hfinkel@anl.gov>2013-09-12 19:04:12 +0000
commit4a1535c0383254741bcddd3500081782aad11864 (patch)
tree024a120bd85d5e80b48238be3ce46a51f2422211 /test/CodeGen/PowerPC
parentba7183bc5284a0e4254ad12b78e2ea61e291dd88 (diff)
downloadexternal_llvm-4a1535c0383254741bcddd3500081782aad11864.zip
external_llvm-4a1535c0383254741bcddd3500081782aad11864.tar.gz
external_llvm-4a1535c0383254741bcddd3500081782aad11864.tar.bz2
Make the PPC fast-math sqrt expansion safe at 0
In fast-math mode sqrt(x) is calculated using the fast expansion of the reciprocal of the reciprocal sqrt expansion. The reciprocal and reciprocal sqrt expansions use the associated estimate instructions along with some Newton iterations. Unfortunately, as a result, sqrt(0) was being calculated as NaN, which is not correct. Now we explicitly return a result of zero if the input is zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC')
-rw-r--r--test/CodeGen/PowerPC/recipest.ll5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/CodeGen/PowerPC/recipest.ll b/test/CodeGen/PowerPC/recipest.ll
index 38d7682..891e801 100644
--- a/test/CodeGen/PowerPC/recipest.ll
+++ b/test/CodeGen/PowerPC/recipest.ll
@@ -169,6 +169,7 @@ entry:
ret double %r
; CHECK: @foo3
+; CHECK: fcmpu
; CHECK-DAG: frsqrte
; CHECK-DAG: fnmsub
; CHECK: fmul
@@ -195,6 +196,7 @@ entry:
ret float %r
; CHECK: @goo3
+; CHECK: fcmpu
; CHECK-DAG: frsqrtes
; CHECK-DAG: fnmsubs
; CHECK: fmuls
@@ -217,7 +219,8 @@ entry:
; CHECK: @hoo3
; CHECK: vrsqrtefp
-; CHECK: vrefp
+; CHECK-DAG: vrefp
+; CHECK-DAG: vcmpeqfp
; CHECK-SAFE: @hoo3
; CHECK-SAFE-NOT: vrsqrtefp