summaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-12 18:36:05 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-12 18:36:05 +0000
commit776a7bab6ef74a50f9a50dc5de25ac1ddedb621a (patch)
tree28a5829b4314d3e5594b4821a5e06e7b7ae2fbe9 /gcc/real.c
parent6672356353b80a3d59d3fa452c2fedd8f24ba140 (diff)
downloadgcc-776a7bab6ef74a50f9a50dc5de25ac1ddedb621a.tar.gz
* real.c (real_isfinite): New.
(real_sqrt): Use it. * real.h (real_isfinite): New. * builtins.c: Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125654 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 9a84329f975..b4d617f94d6 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1163,6 +1163,14 @@ real_isnan (const REAL_VALUE_TYPE *r)
return (r->cl == rvc_nan);
}
+/* Determine whether a floating-point value X is finite. */
+
+bool
+real_isfinite (const REAL_VALUE_TYPE *r)
+{
+ return (r->cl != rvc_nan) && (r->cl != rvc_inf);
+}
+
/* Determine whether a floating-point value X is negative. */
bool
@@ -4571,7 +4579,7 @@ real_sqrt (REAL_VALUE_TYPE *r, enum machine_mode mode,
}
/* Infinity and NaN return themselves. */
- if (real_isinf (x) || real_isnan (x))
+ if (!real_isfinite (x))
{
*r = *x;
return false;