From owner-cvs-src@FreeBSD.ORG Fri Jul 9 03:33:33 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA2C616A4CE; Fri, 9 Jul 2004 03:33:33 +0000 (GMT) Received: from VARK.homeunix.com (adsl-69-107-108-110.dsl.pltn13.pacbell.net [69.107.108.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BC7243D46; Fri, 9 Jul 2004 03:33:33 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i693XRpS015001; Thu, 8 Jul 2004 20:33:27 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i693XRdj015000; Thu, 8 Jul 2004 20:33:27 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Thu, 8 Jul 2004 20:33:27 -0700 From: David Schultz To: src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG Message-ID: <20040709033327.GA14984@VARK.homeunix.com> Mail-Followup-To: src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200407090331.i693VAIL038494@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200407090331.i693VAIL038494@repoman.freebsd.org> Subject: Re: cvs commit: src/lib/msun/src math.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2004 03:33:33 -0000 On Fri, Jul 09, 2004, David Schultz wrote: > das 2004-07-09 03:31:09 UTC > > FreeBSD src repository > > Modified files: > lib/msun/src math.h > Log: > Define the following macros in terms of [gi]cc builtins when the > builtins are available: HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, > and NAN. These macros now expand to floating-point constant > expressions rather than external references, as required by C99. > Other compilers will retain the historical behavior. Note that > it is not possible say, e.g. > #define HUGE_VAL 1.0e9999 > because the above may result in diagnostics at translation time > and spurious exceptions at runtime. Hence the need for compiler > support for these features. > > Also use builtins to implement the macros isgreater(), > isgreaterequal(), isless(), islessequal(), islessgreater(), > and isunordered() when such builtins are available. > Although the old macros are correct, the builtin versions > are much faster, and they avoid double-expansion problems. The Intel compiler is too smart for its own good sometimes. I kept wondering why, despite icc's lack of a __builtin_isgreater(), it seemed to be using one anyway. It turns out that it had done some constant propagation and determined the value of my call to the libm routine __fpclassifyd() statically. Pretty spiffy.