From owner-cvs-src@FreeBSD.ORG Wed Mar 5 11:11:54 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 335A41065693; Wed, 5 Mar 2008 11:11:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1E3A98FC25; Wed, 5 Mar 2008 11:11:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m25BBsop035028; Wed, 5 Mar 2008 11:11:54 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m25BBreL035027; Wed, 5 Mar 2008 11:11:53 GMT (envelope-from bde) Message-Id: <200803051111.m25BBreL035027@repoman.freebsd.org> From: Bruce Evans Date: Wed, 5 Mar 2008 11:11:53 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/i386/include float.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 05 Mar 2008 11:11:54 -0000 bde 2008-03-05 11:11:53 UTC FreeBSD src repository Modified files: sys/i386/include float.h Log: Change float_t and double_t to long double on i386. All floating point expressions on i386 are evaluated in the range of the long double type, so this is wrong in a different but hopefully less worse way than before. Since expressions are evaluated in long double registers, there is no runtime cost to using long double instead of double to declare intermediate values (except in cases where this avoids compiler bugs), and by careful use of float_t or double_t it is possible to avoid some of the compiler bugs in this area, provided these types are declared as long double. I was going to change float.h to be less broken and more usable in combination with the change here (in particular, it is more necessary to know the effective number of bits in a double_t when double_t != double, since DBL_MANT_DIG no longer logically gives this, and LDBL_MANT_DIG doesn't give it either with FreeBSD-i386's default rounding precision. However, this was too hard for now. In particular, LDBL_MANT_DIG is used a lot in libm, so it cannot be changed. One thing that is completely broken now is LDBL_MAX. This may have sort of worked when it was changed from DBL_MAX in 2002 (adding 0 to it at runtime gave +Inf, but you could at least compare with it), but starting with gcc-3.3.1 in 2003, it is always +Inf due to evaluating it at compile time in the default rounding precision. Revision Changes Path 1.16 +5 -4 src/sys/i386/include/float.h