From owner-freebsd-i386@FreeBSD.ORG Sun Feb 13 19:40:21 2005 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A82F616A4CE for ; Sun, 13 Feb 2005 19:40:21 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 840B143D39 for ; Sun, 13 Feb 2005 19:40:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1DJeLCo049880 for ; Sun, 13 Feb 2005 19:40:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1DJeLD3049879; Sun, 13 Feb 2005 19:40:21 GMT (envelope-from gnats) Date: Sun, 13 Feb 2005 19:40:21 GMT Message-Id: <200502131940.j1DJeLD3049879@freefall.freebsd.org> To: freebsd-i386@FreeBSD.org From: Bruce Evans Subject: Re: i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2005 19:40:21 -0000 The following reply was made to PR i386/67469; it has been noted by GNATS. From: Bruce Evans To: David Schultz Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-i386@FreeBSD.org, bde@FreeBSD.org Subject: Re: i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs Date: Mon, 14 Feb 2005 06:38:16 +1100 (EST) On Sun, 13 Feb 2005, David Schultz wrote: > On Mon, Feb 14, 2005, Bruce Evans wrote: > > >... > > I did a quick test of some other functions: > > - hardware sqrt is much faster > > - hardware exp is slightly faster on the range [1,100] > > - hardware atan is slower on the range [0,1.5] > > - hardware acos is much slower (139 nsec vs 57 nsec!) on the range [0,1.0]. > > sqrt isn't transcendental, so it should be faster and correctly > rounded on every hardware platform. I found similar results to I don't know if we can trust the hardware for that. ISTR checking that hardware sqrtf gives the same result as fdlibm for possible values for sqrtf. This is of course impossible for double sqrt. > yours for atan() and acos() when writing amd64 math routines, but > of course amd64 has the overhead of switching between the SSE and > i387 units. Maybe they should go away, too... These are easier to decide (for now) because there are no old CPUs. I fixed the bug that gave unbelievable cycle counts: %%% --- r.c~ Mon Feb 14 02:19:34 2005 +++ r.c Mon Feb 14 02:22:21 2005 @@ -45,4 +47,5 @@ tmax = 0; tmin = INT_MAX; + total = 0; for (i = 0; i < ITER; i++) { if (fabs(avg - t[i]) <= sd * 2) { %%% With this fix on athlon-xp's, the cpuid instructions only disturb the cycle counts in a small and almost deterministic way (by about 59 cycles for every run). Bruce