From owner-svn-src-head@FreeBSD.ORG Thu Sep 30 22:17:12 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B27E5106564A; Thu, 30 Sep 2010 22:17:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 2E62E8FC21; Thu, 30 Sep 2010 22:17:11 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8UMH8JC002282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Oct 2010 08:17:10 +1000 Date: Fri, 1 Oct 2010 08:17:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Dimitry Andric In-Reply-To: <201009301920.o8UJKLCx078875@svn.freebsd.org> Message-ID: <20101001075452.F1348@delplex.bde.org> References: <201009301920.o8UJKLCx078875@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213308 - in head/lib/libc: amd64/gen i386/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2010 22:17:12 -0000 On Thu, 30 Sep 2010, Dimitry Andric wrote: > Log: > Retire the amd64 and i386 specific inline assembly versions of ldexp.c, > as they are slower than the generic version in C, at least on modern > hardware. This leaves us with just five implementations. > > Suggested by: bde > Approved by: rpaulo (mentor) Thanks. I suppose it has had enough testing. I just tested it on a Celeron 366 (late 90's P2 arch). The C version is faster there too: libc asm ldexp: 1.98 seconds libm asm scalbn: 1.91 libm C scalbn: 1.84 While there, I noticed that the libm asm scalbn is still using RCSID(), like many of the older libm asm functions. This is not just a style bug. RCSID() and __RCSID() are compatibility cruft that should never be used. The RCSID() in i386/include/asm.h is especially bad. It bloats the text section with $FreeBSD$ strings using ".text; .asciz...". __FBSDID() normally uses .ident which normally puts the strings in a better place. Are there only 5 implementations left? :-) arm is the only arch that still has one in libc. amd64 are i386 the only arches that have asm versions of scalbn in libm. They are there for float and long double precision too. This is especially silly for float precision since the integer versions are especially easy to make efficient for float precision. OTOH, long double precision is probably still faster in asm. There are also silly scalbln* interfaces (taking a long for the exponent). These are only implemented in C (as wrappers). Bruce Bruce