diff mbox

Remove tacit double usage in ldbl-128

Message ID 0fe6230c-bd2b-6711-acdb-e33d6ad58fba@linux.vnet.ibm.com
State New
Headers show

Commit Message

Paul E. Murphy Aug. 2, 2016, 6:57 p.m. UTC
There is quiet truncation to double arithmetic in several
files.  I noticed them when building ldbl-128 in a
soft-fp context.  This did not change any test results.

	* sysdeps/ieee754/ldbl-128/k_tanl.c (__kernal_tanl):
	Use fabsl instead of fabs.
	* sysdeps/ieee754/ldbl-128/s_logbl.c (__logbl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_atanl.c (__kernel_tanl):
	Add long double suffix to constant to ensure proper
	promotion to long double.
---
 sysdeps/ieee754/ldbl-128/k_tanl.c  | 2 +-
 sysdeps/ieee754/ldbl-128/s_atanl.c | 2 +-
 sysdeps/ieee754/ldbl-128/s_logbl.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Joseph Myers Aug. 2, 2016, 8:10 p.m. UTC | #1
On Tue, 2 Aug 2016, Paul E. Murphy wrote:

> There is quiet truncation to double arithmetic in several
> files.  I noticed them when building ldbl-128 in a
> soft-fp context.  This did not change any test results.
> 
> 	* sysdeps/ieee754/ldbl-128/k_tanl.c (__kernal_tanl):
> 	Use fabsl instead of fabs.
> 	* sysdeps/ieee754/ldbl-128/s_logbl.c (__logbl):
> 	Likewise.
> 	* sysdeps/ieee754/ldbl-128/s_atanl.c (__kernel_tanl):
> 	Add long double suffix to constant to ensure proper
> 	promotion to long double.

OK.
Paul E. Murphy Aug. 3, 2016, 5:13 p.m. UTC | #2
On 08/02/2016 01:57 PM, Paul E. Murphy wrote:
> There is quiet truncation to double arithmetic in several
> files.  I noticed them when building ldbl-128 in a
> soft-fp context.  This did not change any test results.
> 
> 	* sysdeps/ieee754/ldbl-128/k_tanl.c (__kernal_tanl):
> 	Use fabsl instead of fabs.
> 	* sysdeps/ieee754/ldbl-128/s_logbl.c (__logbl):
> 	Likewise.
> 	* sysdeps/ieee754/ldbl-128/s_atanl.c (__kernel_tanl):
> 	Add long double suffix to constant to ensure proper
> 	promotion to long double.

Committed as cad1d60.
diff mbox

Patch

diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c
index 6bb221e..cd2bbf5 100644
--- a/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -98,7 +98,7 @@  __kernel_tanl (long double x, long double y, int iy)
 	{			/* generate inexact */
 	  if ((ix | u.parts32.w1 | u.parts32.w2 | u.parts32.w3
 	       | (iy + 1)) == 0)
-	    return one / fabs (x);
+	    return one / fabsl (x);
 	  else if (iy == 1)
 	    {
 	      math_check_force_underflow (x);
diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c
index aaae701..35577a8 100644
--- a/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -231,7 +231,7 @@  __atanl (long double x)
 	 Roundoff to integer is asymmetrical to avoid cancellation when t < 0
          (cf. fdlibm). */
       k = 8.0 * x + 0.25;
-      u = 0.125 * k;
+      u = 0.125L * k;
       /* Small arctan argument.  */
       t = (x - u) / (1.0 + x * u);
     }
diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c
index 3ba67b7..b7c1ca1 100644
--- a/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -34,7 +34,7 @@  __logbl (long double x)
   GET_LDOUBLE_WORDS64 (hx, lx, x);
   hx &= 0x7fffffffffffffffLL;	/* high |x| */
   if ((hx | lx) == 0)
-    return -1.0 / fabs (x);
+    return -1.0 / fabsl (x);
   if (hx >= 0x7fff000000000000LL)
     return x * x;
   if ((ex = hx >> 48) == 0)	/* IEEE 754 logb */