From owner-freebsd-current Wed Mar 20 19:20:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by hub.freebsd.org (Postfix) with ESMTP id A986337B404 for ; Wed, 20 Mar 2002 19:20:14 -0800 (PST) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.12.2/8.12.2) with ESMTP id g2L3KEU6042556; Wed, 20 Mar 2002 19:20:14 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.12.2/8.12.2/Submit) id g2L3KDmq042555; Wed, 20 Mar 2002 19:20:13 -0800 (PST) Date: Wed, 20 Mar 2002 19:20:13 -0800 From: Steve Kargl To: Bruce Evans Cc: freebsd-current@FreeBSD.ORG Subject: Re: Removing CSRG libm? Message-ID: <20020320192013.A42351@troutmask.apl.washington.edu> References: <20020320153229.A41158@troutmask.apl.washington.edu> <20020321121625.K12290-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020321121625.K12290-100000@gamplex.bde.org>; from bde@zeta.org.au on Thu, Mar 21, 2002 at 12:33:45PM +1100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Mar 21, 2002 at 12:33:45PM +1100, Bruce Evans wrote: > On Wed, 20 Mar 2002, Steve Kargl wrote: > > I forgot about the missing __pure2 in . (It prevents gcc > doing optimizations like moving sqrt(2) out of loops.) There is > another thread on freebsd-standards about _MULTI_LIBM support. I I'm not subscribed to freebsd-standards. Too many list, too little time. I guess I'll go browse the archive. > want the errno support completely removed so that we have a chance > of declaring math functions as __pure2 unconditionally. But maybe > we can't do this anyway, because math functions normally have the > side effect of setting IEEE exception flags. Can we do things like > > #ifpragma STDC FENV_ACCESS ON > double sqrt(double); > #else > double sqrt(double) __pure2; > #endif > > ? I don't know. I forgot about the libm PR until last week when someone else posted about paranoi.c failing several tests. I decided to check into the quality of libm and work on improvements. I still have a lot to learn. I think we'll only be able to add __pure2 on a case by case basis. For example, the POSIX sqrt(3) manpage states An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW |FE_UNDERFLOW) is non-zero, an error has occurred. > > > Also, are functions missing in libm with respect to the > > C99 standard? I would be willing to work on implementing > > these functions. > > Most are missing, if you count long double and complex support. Only > a few are, for double support. I noticed some easy ones like > isnormal() when I scanned the C99 draft standard today to check the > status if infnan.3. Garrett pointed me to the Open Group's docs. I didn't know the docs were available on-line. Complex functions are confined to complex.h. I suppose we need to implement complex.h, but I'll probably concentrate on math.h. -- Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message