From patchwork Thu Aug 11 00:30:46 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: 657976 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 3s8q0T5Zjsz9s1h for ; Thu, 11 Aug 2016 10:39:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=B0cSQlDP; 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:subject:to:references:cc:from:date :mime-version:in-reply-to:content-type:content-transfer-encoding :message-id; q=dns; s=default; b=BSOmVtaIvIp4rXws+nZs1U+Ki8hhESn duCCVhazm0jwQXBg8qswaxuNDedy6DwWG0JVaHfbHR2RHiMA7iCEjVeF0SGYlnHO rtT1fOlzR61ty2AYHX9SALqnaj8Xm5iayNGfW9BAun8cZQK9SHLC0ar+2GoQORxs FEDF6MsPKe+4= 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:subject:to:references:cc:from:date :mime-version:in-reply-to:content-type:content-transfer-encoding :message-id; s=default; bh=wJLQH0OiDLqgteXLqYCD7001WgE=; b=B0cSQ lDPSOLSpEKcRjWcoUlrB7E2JqgSydKoag21yEVW0MXh2goLDJdUTZB/Qgnx3ZveB K/5bsJ7EIueOL8L3lFh45l/W7fzed/GPfM6VYAPFTh3hA+jUbAZZPwwvz/mouJeI cFntKm+S29erQt1yR21M2JurTPHjECjFYXwS/g= Received: (qmail 51362 invoked by alias); 11 Aug 2016 00:39:20 -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 104043 invoked by uid 89); 11 Aug 2016 00:30:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=UD:float.h, objpfx, M_MANT_DIG, _epsilon X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: murphyp@linux.vnet.ibm.com Subject: Re: [PATCHv2 03/11] Support for type-generic libm function implementations libm To: Joseph Myers References: <3a418cdb-ecc4-db97-ebba-bbe516188325@linux.vnet.ibm.com> <50e9ad99-870e-fbbe-89c5-02d9f4bc66bc@linux.vnet.ibm.com> Cc: libc-alpha@sourceware.org, Adhemerval Zanella From: "Paul E. Murphy" Date: Wed, 10 Aug 2016 19:30:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081100-0012-0000-0000-0000105F17CD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005575; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000180; SDB=6.00742926; UDB=6.00349769; IPR=6.00515483; BA=6.00004655; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012304; XFM=3.00000011; UTC=2016-08-11 00:30:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081100-0013-0000-0000-000044720CD1 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-10_20:, , 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-1608110007 On 08/10/2016 05:05 PM, Joseph Myers wrote: > On Wed, 10 Aug 2016, Paul E. Murphy wrote: > >> Ok, here is a patch which does all of the above. I like this approach >> much better than the previous patches. This approach is much more >> inline with the existing idioms, much easier to understand, and more >> robust. > > The shell code you're embedding in the makefile uses $${gfunc/F/} which is > a bash-specific feature. Makefile shell code is run with /bin/sh; you can > only rely on POSIX shell features. dash does not support this non-POSIX > feature. > >> Notable changes from the last patch: > > This patch has not addressed my point that the comment about LDBL_EPSILON > for IBM long double should refer to both underflows and overflows. > Oops, thanks for catching those. Both are fixed with minor changes to the patch: diff --git a/math/Makefile b/math/Makefile index 567b7ed..7451e4e 100644 --- a/math/Makefile +++ b/math/Makefile @@ -274,7 +274,7 @@ generated += $(addsuffix .c,$(call type-foreach,$(gen-libm-calls:%=%$(s)))) \ # Create wrappers in the math build directory. $(objpfx)gen-libm-templates.stmp: for gfunc in $(gen-libm-calls); do \ - gfunc_basefile=$${gfunc/F/}_template.c; \ + gfunc_basefile=$${gfunc%F*}$${gfunc#*F}_template.c; \ for type in $(foreach t,$(types),$(t)__$(type-$(t)-suffix)); do \ func=$(objpfx)$${gfunc/F/$${type#*__}}; \ type=$${type%__*}; \ diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h index 91394ba..259cb94 100644 --- a/sysdeps/generic/math-type-macros.h +++ b/sysdeps/generic/math-type-macros.h @@ -95,7 +95,7 @@ #include /* Use a special epsilon value for IBM long double - to avoid spurious overflows. */ + to avoid spurious overflows/underflows. */ #if M_MANT_DIG != 106 # define M_EPSILON __M_CONCATX (M_PFX, _EPSILON) #else