aboutsummaryrefslogtreecommitdiff
path: root/libgcc/libgcc2.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2018-10-03 22:29:10 +0200
committerUros Bizjak <uros@gcc.gnu.org>2018-10-03 22:29:10 +0200
commitaf8096fc2b6ee76426b021a2657291dfc62ca933 (patch)
tree83eb5eae31cfbd2591e058e2306b5b54a20369b8 /libgcc/libgcc2.c
parenta41cc59de4134194fc2e96beb12cf18737da3cee (diff)
downloadgcc-af8096fc2b6ee76426b021a2657291dfc62ca933.zip
gcc-af8096fc2b6ee76426b021a2657291dfc62ca933.tar.gz
gcc-af8096fc2b6ee76426b021a2657291dfc62ca933.tar.bz2
libgcc2.c (isnan): Use __builtin_isnan.
* libgcc2.c (isnan): Use __builtin_isnan. (isfinite): Use __builtin_isfinite. (isinf): Use __builtin_isinf. From-SVN: r264823
Diffstat (limited to 'libgcc/libgcc2.c')
-rw-r--r--libgcc/libgcc2.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libgcc/libgcc2.c b/libgcc/libgcc2.c
index f418f3a..8ac2025 100644
--- a/libgcc/libgcc2.c
+++ b/libgcc/libgcc2.c
@@ -1939,15 +1939,9 @@ NAME (TYPE x, int m)
#define CONCAT2(A,B) _CONCAT2(A,B)
#define _CONCAT2(A,B) A##B
-/* All of these would be present in a full C99 implementation of <math.h>
- and <complex.h>. Our problem is that only a few systems have such full
- implementations. Further, libgcc_s.so isn't currently linked against
- libm.so, and even for systems that do provide full C99, the extra overhead
- of all programs using libgcc having to link against libm. So avoid it. */
-
-#define isnan(x) __builtin_expect ((x) != (x), 0)
-#define isfinite(x) __builtin_expect (!isnan((x) - (x)), 1)
-#define isinf(x) __builtin_expect (!isnan(x) & !isfinite(x), 0)
+#define isnan(x) __builtin_isnan (x)
+#define isfinite(x) __builtin_isfinite (x)
+#define isinf(x) __builtin_isinf (x)
#define INFINITY CONCAT2(__builtin_huge_val, CEXT) ()
#define I 1i