This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] allow long double (IBM Extended) to build with soft-fp
- From: Steven Munroe <munroesj at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 14 Jun 2006 16:34:50 -0500
- Subject: [PATCH] allow long double (IBM Extended) to build with soft-fp
Found that soft-fp (--without-fp) does not have a <fenv_libc.h> include
which caused some compile failures in ldbl-128ibm. So we should remove
the need for <fenv_libc.h> or change to use simply <fenv.h>.
Removing the fenv usage was simple for ceill, floorl, roundl, and
truncl. llroundl uses feraisexcept() so I changed it to use <fenv.h>,
Simularly for llrintl and rintl.
2006-06-01 Steven Munroe <sjmunroe@us.ibm.com>
[BZ #2423, BZ #2749]
* sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include <fenv_libc.h>.
(__ceill): Remove calls to fegetround(), fesetround().
* sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise.
[BZ #2749]
* sysdeps/ieee754/ldbl-128ibm/s_llrintl.c: Replace include
<fenv_libc.h> with <fenv.h>.
* sysdeps/ieee754/ldbl-128ibm/s_llroundl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_rintl.c: Likewise
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_ceill.c libc24/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_ceill.c 2006-03-16 05:46:37.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_ceill.c 2006-05-30 15:52:33.000000000 -0500
@@ -19,7 +19,6 @@
02111-1307 USA. */
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -44,11 +43,9 @@
__builtin_inf ()), 1))
{
double orig_xh;
- int save_round = fegetround ();
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
- fesetround (FE_TONEAREST);
/* Convert the high double to integer. */
orig_xh = xh;
@@ -81,8 +78,6 @@
/* Ensure we return -0 rather than +0 when appropriate. */
if (orig_xh < 0.0)
xh = -__builtin_fabs (xh);
-
- fesetround (save_round);
}
return ldbl_pack (xh, xl);
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_floorl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_floorl.c 2006-03-16 05:46:37.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_floorl.c 2006-05-30 15:53:11.000000000 -0500
@@ -19,7 +19,6 @@
02111-1307 USA. */
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -43,11 +42,8 @@
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- int save_round = fegetround ();
-
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
- fesetround (FE_TONEAREST);
/* Convert the high double to integer. */
hi = ldbl_nearbyint (xh);
@@ -75,8 +71,6 @@
xh = hi;
xl = lo;
ldbl_canonicalize (&xh, &xl);
-
- fesetround (save_round);
}
return ldbl_pack (xh, xl);
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c 2006-03-16 17:16:52.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c 2006-05-18 13:09:21.000000000 -0500
@@ -22,7 +22,7 @@
when it's coded in C. */
#include <math.h>
-#include <fenv_libc.h>
+#include <fenv.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c 2006-03-16 17:16:52.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c 2006-05-18 13:12:09.000000000 -0500
@@ -22,7 +22,7 @@
when it's coded in C. */
#include <math.h>
-#include <fenv_libc.h>
+#include <fenv.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_rintl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_rintl.c 2006-03-16 05:46:37.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_rintl.c 2006-05-18 12:45:13.000000000 -0500
@@ -22,7 +22,7 @@
when it's coded in C. */
#include <math.h>
-#include <fenv_libc.h>
+#include <fenv.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_roundl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_roundl.c 2006-03-16 05:46:37.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_roundl.c 2006-05-30 15:55:46.000000000 -0500
@@ -22,7 +22,6 @@
when it's coded in C. */
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -47,11 +46,9 @@
__builtin_inf ()), 1))
{
double orig_xh;
- int save_round = fegetround ();
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
- fesetround (FE_TONEAREST);
/* Convert the high double to integer. */
orig_xh = xh;
@@ -88,8 +85,6 @@
xh = hi;
xl = lo;
ldbl_canonicalize (&xh, &xl);
-
- fesetround (save_round);
}
return ldbl_pack (xh, xl);
diff -urN libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_truncl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
--- libc24-cvstip-20060512/sysdeps/ieee754/ldbl-128ibm/s_truncl.c 2006-03-16 05:46:37.000000000 -0600
+++ libc24/sysdeps/ieee754/ldbl-128ibm/s_truncl.c 2006-05-30 15:56:20.000000000 -0500
@@ -22,7 +22,6 @@
when it's coded in C. */
#include <math.h>
-#include <fenv_libc.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -47,11 +46,9 @@
__builtin_inf ()), 1))
{
double orig_xh;
- int save_round = fegetround ();
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
- fesetround (FE_TONEAREST);
/* Convert the high double to integer. */
orig_xh = xh;
@@ -92,8 +89,6 @@
/* Ensure we return -0 rather than +0 when appropriate. */
if (orig_xh < 0.0)
xh = -__builtin_fabs (xh);
-
- fesetround (save_round);
}
return ldbl_pack (xh, xl);