summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-02-19 11:20:18 +0100
committerAurelien Jarno <aurelien@aurel32.net>2012-02-19 11:20:18 +0100
commit92221550d72bafcd322ac5ab2a951054184b7f1a (patch)
treea48ab236bb1d2c3f29138d04500129fa230ed2e6 /sysdeps
parentebaf36ebd838cec73c00433e7b3d41c9d126fe47 (diff)
Use non-signaling floating-point comparisons in math functions.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ieee754/dbl-64/e_atanh.c8
-rw-r--r--sysdeps/ieee754/dbl-64/w_exp.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_atanhf.c8
-rw-r--r--sysdeps/ieee754/flt-32/w_expf.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/w_expl.c6
5 files changed, 17 insertions, 17 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c
index 9fc21abe2d..5f471b1d79 100644
--- a/sysdeps/ieee754/dbl-64/e_atanh.c
+++ b/sysdeps/ieee754/dbl-64/e_atanh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -46,7 +46,7 @@ __ieee754_atanh (double x)
{
double xa = fabs (x);
double t;
- if (xa < 0.5)
+ if (isless (xa, 0.5))
{
if (__builtin_expect (xa < 0x1.0p-28, 0))
{
@@ -57,11 +57,11 @@ __ieee754_atanh (double x)
t = xa + xa;
t = 0.5 * __log1p (t + t * xa / (1.0 - xa));
}
- else if (__builtin_expect (xa < 1.0, 1))
+ else if (__builtin_expect (isless (xa, 1.0), 1))
t = 0.5 * __log1p ((xa + xa) / (1.0 - xa));
else
{
- if (xa > 1.0)
+ if (isgreater (xa, 1.0))
return (x - x) / (x - x);
return x / 0.0;
diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp.c
index ee42587be4..b584ed83d9 100644
--- a/sysdeps/ieee754/dbl-64/w_exp.c
+++ b/sysdeps/ieee754/dbl-64/w_exp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -28,12 +28,12 @@ u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */
double
__exp (double x)
{
- if (__builtin_expect (x > o_threshold, 0))
+ if (__builtin_expect (isgreater (x, o_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
return __kernel_standard_f (x, x, 6);
}
- else if (__builtin_expect (x < u_threshold, 0))
+ else if (__builtin_expect (isless (x, u_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
return __kernel_standard_f (x, x, 7);
diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c
index 75ed6917e9..7af2f6ce67 100644
--- a/sysdeps/ieee754/flt-32/e_atanhf.c
+++ b/sysdeps/ieee754/flt-32/e_atanhf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -46,7 +46,7 @@ __ieee754_atanhf (float x)
{
float xa = fabsf (x);
float t;
- if (xa < 0.5f)
+ if (isless (xa, 0.5f))
{
if (__builtin_expect (xa < 0x1.0p-28f, 0))
{
@@ -57,11 +57,11 @@ __ieee754_atanhf (float x)
t = xa + xa;
t = 0.5f * __log1pf (t + t * xa / (1.0f - xa));
}
- else if (__builtin_expect (xa < 1.0f, 1))
+ else if (__builtin_expect (isless (xa, 1.0f), 1))
t = 0.5f * __log1pf ((xa + xa) / (1.0f - xa));
else
{
- if (xa > 1.0f)
+ if (isgreater (xa, 1.0f))
return (x - x) / (x - x);
return x / 0.0f;
diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c
index 5500872319..bc3b2f6790 100644
--- a/sysdeps/ieee754/flt-32/w_expf.c
+++ b/sysdeps/ieee754/flt-32/w_expf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -28,12 +28,12 @@ u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */
float
__expf (float x)
{
- if (__builtin_expect (x > o_threshold, 0))
+ if (__builtin_expect (isgreater (x, o_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
return __kernel_standard_f (x, x, 106);
}
- else if (__builtin_expect (x < u_threshold, 0))
+ else if (__builtin_expect (isless (x, u_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
return __kernel_standard_f (x, x, 107);
diff --git a/sysdeps/ieee754/ldbl-96/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl.c
index ec9d8a7884..d61c0a37bb 100644
--- a/sysdeps/ieee754/ldbl-96/w_expl.c
+++ b/sysdeps/ieee754/ldbl-96/w_expl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -30,12 +30,12 @@ u_threshold= -1.140019167866942050398521670162263001513e4;
long double
__expl (long double x)
{
- if (__builtin_expect (x > o_threshold, 0))
+ if (__builtin_expect (isgreater (x, o_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
return __kernel_standard (x, x, 206);
}
- else if (__builtin_expect (x < u_threshold, 0))
+ else if (__builtin_expect (isless (x, u_threshold), 0))
{
if (_LIB_VERSION != _IEEE_)
return __kernel_standard (x, x, 207);