From patchwork Mon Aug 8 14:48:37 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: 656776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s7Kzm10qVz9sR9 for ; Tue, 9 Aug 2016 00:48:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=dQBWBOTh; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:subject:to:cc:date:mime-version :content-type:content-transfer-encoding:message-id; q=dns; s= default; b=G+3Xc1xgVYw3cgp6OxwGpZ6YMeKTrF3qRmoDCMM+3QpfrQ2gPOexp 30jSYIz5BCt8IuGocmSAG9DamUnIub+E4BSMMTo7dJPRUmV46PqsaQL//n/3qnJB FLgOE0d6IWLJ4Ds2oYXvjXsiI/Cai5shGLBVRwwPsyBP2tnSLLVk+M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:subject:to:cc:date:mime-version :content-type:content-transfer-encoding:message-id; s=default; bh=RMi6+AOXExhjIRUm0GCijn5fqos=; b=dQBWBOThB9GAAmGnreaJmipvgfVN fzKRreFxsfNRAXEcQ4IdutCBkyzPv2rglz3Gxv8hnKLNcSStKD5db//2lIcbUOLr Xk3wi4scmZFj3Jv+VKHOwEHvGSvIk6Sg4xW+ycBCydNUTFl+onNMpC/3N39lt7M9 EGGXmEPua5snuRw= Received: (qmail 95419 invoked by alias); 8 Aug 2016 14:48:45 -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 95403 invoked by uid 89); 8 Aug 2016 14:48:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=netbsd, 0x4000, sysdeps, fraction X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: murphyp@linux.vnet.ibm.com From: "Paul E. Murphy" Subject: [PATCH] ldbl-128: Refactor modfl snan handling To: "libc-alpha@sourceware.org" Cc: Joseph Myers Date: Mon, 8 Aug 2016 09:48:37 -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: 16080814-0008-0000-0000-00000540A9CD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005567; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000178; SDB=6.00741772; UDB=6.00349076; IPR=6.00514330; BA=6.00004651; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012247; XFM=3.00000011; UTC=2016-08-08 14:48:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16080814-0009-0000-0000-00003A0C64A5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-08_11:, , 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-1604210000 definitions=main-1608080162 This causes a test failure on float128/ppc64le as the multiplication is optimized away. This updates it to use conversions similar to other files. Tested on s390x to verify no new test failures occur. This also reduced the code size a little bit too. * sysdeps/ieee754/ldbl-128/s_modfl.c (one): Removed. (__modfl): Use more compiler friendly mechanism to quiet an snan. --- sysdeps/ieee754/ldbl-128/s_modfl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c index adb1ca6..05bcc81 100644 --- a/sysdeps/ieee754/ldbl-128/s_modfl.c +++ b/sysdeps/ieee754/ldbl-128/s_modfl.c @@ -30,8 +30,6 @@ static char rcsid[] = "$NetBSD: $"; #include #include -static const ldouble_t one = 1.0; - ldouble_t __modfl(ldouble_t x, ldouble_t *iptr) { int64_t i0,i1,j0; @@ -56,14 +54,15 @@ ldouble_t __modfl(ldouble_t x, ldouble_t *iptr) } } } else if (j0>111) { /* no fraction part */ - *iptr = x*one; /* We must handle NaNs separately. */ if (j0 == 0x4000 && ((i0 & 0x0000ffffffffffffLL) | i1)) { - *iptr = x+x; - return x+x; + /* Coerce x and iptr into qnans. */ + *iptr = x + x; + return *iptr; } /* return +-0 */ + *iptr = x; SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); return x; } else { /* fraction part in low x */