From owner-cvs-src@FreeBSD.ORG Mon Sep 19 11:28:21 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org 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 B7F5E16A41F; Mon, 19 Sep 2005 11:28:21 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70D2A43D58; Mon, 19 Sep 2005 11:28:21 +0000 (GMT) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8JBSLDP031216; Mon, 19 Sep 2005 11:28:21 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8JBSKIc031215; Mon, 19 Sep 2005 11:28:20 GMT (envelope-from bde) Message-Id: <200509191128.j8JBSKIc031215@repoman.freebsd.org> From: Bruce Evans Date: Mon, 19 Sep 2005 11:28:19 +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/lib/msun/bsdsrc b_log.c b_tgamma.c mathimpl.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: Mon, 19 Sep 2005 11:28:22 -0000 bde 2005-09-19 11:28:19 UTC FreeBSD src repository Modified files: lib/msun/bsdsrc b_log.c b_tgamma.c mathimpl.h Log: Fixed aliasing bugs in TRUNC() by using the fdlibm macros for access to doubles as bits. fdlibm-1.1 had similar aliasing bugs, but these were fixed by NetBSD or Cygnus before a modified version of fdlibm was imported in 1994. TRUNC() is only used by tgamma() and some implementation-detail functions. The aliasing bugs were detected by compiling with gcc -O2 but don't seem to have broken tgamma() on i386's or amd64's. They broke my modified version of tgamma(). Moved the definition of TRUNC() to mathimpl.h so that it can be fixed in one place, although the general version is even slower than necessary because it has to operate on pointers to volatiles to handle its arg sometimes being volatile. Inefficiency of the fdlibm macros slows down libm generally, and tgamma() is a relatively unimportant part of libm. The macros act as if on 32-bit words in memory, so they are hard to optimize to direct actions on 64-bit double registers for (non-i386) machines where this is possible. The optimization is too hard for gcc on amd64's, and declaring variables as volatile makes it impossible. Revision Changes Path 1.8 +1 -4 src/lib/msun/bsdsrc/b_log.c 1.7 +0 -8 src/lib/msun/bsdsrc/b_tgamma.c 1.6 +25 -0 src/lib/msun/bsdsrc/mathimpl.h