From patchwork Tue Aug 2 18:57:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 14252 X-Patchwork-Delegate: joseph@codesourcery.com Received: (qmail 88919 invoked by alias); 2 Aug 2016 18:57:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 88909 invoked by uid 89); 2 Aug 2016 18:57:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=80, ieee754, cancellation, ldbl-128 X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d01dlp02.pok.ibm.com X-IBM-MailFrom: murphyp@linux.vnet.ibm.com From: "Paul E. Murphy" Subject: [PATCH] Remove tacit double usage in ldbl-128 To: "libc-alpha@sourceware.org" Cc: Joseph Myers Date: Tue, 2 Aug 2016 13:57:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16080218-0056-0000-0000-000000F273C6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005545; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000177; SDB=6.00739052; UDB=6.00347417; IPR=6.00511643; BA=6.00004637; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012128; XFM=3.00000011; UTC=2016-08-02 18:57:11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080218-0057-0000-0000-0000050CAFD3 Message-Id: <0fe6230c-bd2b-6711-acdb-e33d6ad58fba@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-02_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1606300000 definitions=main-1608020194 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(-) 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 */