From owner-cvs-all@FreeBSD.ORG Thu Jan 17 16:39:07 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8036D16A47D; Thu, 17 Jan 2008 16:39:07 +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 8A95513C501; Thu, 17 Jan 2008 16:39:07 +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 m0HGd7AD089316; Thu, 17 Jan 2008 16:39:07 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0HGd7pn089315; Thu, 17 Jan 2008 16:39:07 GMT (envelope-from bde) Message-Id: <200801171639.m0HGd7pn089315@repoman.freebsd.org> From: Bruce Evans Date: Thu, 17 Jan 2008 16:39:07 +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/libc/amd64 _fpmath.h src/lib/libc/i386 _fpmath.h src/lib/libc/ia64 _fpmath.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2008 16:39:07 -0000 bde 2008-01-17 16:39:07 UTC FreeBSD src repository Modified files: lib/libc/amd64 _fpmath.h lib/libc/i386 _fpmath.h lib/libc/ia64 _fpmath.h Log: Add an alternative view of the bits in an 80-bit long double (64+16 instead of 32+32+15+1) on all arches that have such long doubles (amd64, ia64 and i386). Large objects should be be accessed in large units, and the 32+32+15+1[+padding] decomposition asks for almost the opposite of that, sometimes resulting in very slow accesses depending on how well the compiler ignores what we ask for and converts to the best units for the given machine. E.g., on Athlons, there is a 10-20 cycle penalty for accessing the middle 32-bit word immediately after an 80-bit store. Whether actually using the alternative view is better is very machine- dependent. A 32+32+16 view is probably best with old 32-bit systems and gcc through 4.2.1. The compiler should mostly avoid the view and generate best accesses, but gcc-4.2.1 is far from doing that. I think 64+16 is best for now. Similarly for doubles -- they should be using 64+0 especially on 64-bit machines, but fdlibm uses 32+32 extensively for them. Fortunately, in 64-bit mode for doubles, gcc already ignores the 32+32-bit view and generates best accesses in many cases. Revision Changes Path 1.7 +6 -1 src/lib/libc/amd64/_fpmath.h 1.6 +6 -1 src/lib/libc/i386/_fpmath.h 1.7 +12 -1 src/lib/libc/ia64/_fpmath.h