From owner-svn-src-head@FreeBSD.ORG Wed Dec 17 21:16:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A5CFCA3; Wed, 17 Dec 2014 21:16:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6341E41; Wed, 17 Dec 2014 21:16:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sBHLGs0a095276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Dec 2014 13:16:54 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sBHLGsc0095275; Wed, 17 Dec 2014 13:16:54 -0800 (PST) (envelope-from sgk) Date: Wed, 17 Dec 2014 13:16:54 -0800 From: Steve Kargl To: Garrett Cooper Subject: Re: svn commit: r275819 - in head/lib/msun: ld128 ld80 src Message-ID: <20141217211654.GA95193@troutmask.apl.washington.edu> References: <201412160921.sBG9LvFY064961@svn.freebsd.org> <20141216162055.GA64273@troutmask.apl.washington.edu> <20141217191235.GA89501@troutmask.apl.washington.edu> <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87FF0FD4-EEF2-4264-9CBA-4B3A46E52FCB@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2014 21:16:56 -0000 On Wed, Dec 17, 2014 at 12:48:37PM -0800, Garrett Cooper wrote: > On Dec 17, 2014, at 11:12, Steve Kargl wrote: > > > On Wed, Dec 17, 2014 at 04:30:32PM +0100, Ed Schouten wrote: > > ? > > >>> This comment isn't true! These functions pre-date C11 by years. > >>> See r151865. These functions were designed to deal with gcc's > >>> poorly implemented I. See the paragraph above your comment. > >> > >> Keep in mind that the phrasing is intended to say that CMPLX*() and > >> friends are part of C11. Those do not pre-date C11. > > > > The phrasing is wrong. cpack[fl] came at least 6 years before > C11 and were designed to work around defects in C99. CMPLX[FL] > > were introduced into C11 to address those defects. Changing > > cpack[fl] to CMPLX[FL] and claiming that the functions are > > modeled after the C11 macros is wrong (unless the meaning of > > "before" and "after" have changed). > > Hi Dimitry/Ed/Steve, > Does it make sense to take the logic that Ed added and guard it with a conditional so people building the functions can use the C+11 definitions instead of the C99 definitions? This could preserve the old behavior for folks who don?t have C+11 capable compilers, but would allow us (and others) who do via clang or newer versions of gcc to use the new C+11 idioms, similar to some of the other macros in sys/cdefs.h, et al. > Thank you! Ed's patch works for non-C11 compilers. His patch to math_private.h contained, for example, #ifndef CMPLXF static __inline float complex CMPLXF(float x, float y) { float_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } #endif IMNSHO, the correct patch should have been #ifdef CMPLXF #define cpackf(x, y) CMPLXF((x), (y)) #else static __inline float complex cpackf(float x, float y) { float_complex z; REALPART(z) = x; IMAGPART(z) = y; return (z.f); } #endif Ed's diff is ~1000 lines and touches several files. Localizing the change to math_private.h would have been a ~20 line diff to a single file. -- Steve