From owner-cvs-all@FreeBSD.ORG Wed Feb 13 10:44:45 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 5603C16A418; Wed, 13 Feb 2008 10:44:45 +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 4AC7013C474; Wed, 13 Feb 2008 10:44:45 +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 m1DAijJX055357; Wed, 13 Feb 2008 10:44:45 GMT (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1DAijwH055356; Wed, 13 Feb 2008 10:44:45 GMT (envelope-from bde) Message-Id: <200802131044.m1DAijwH055356@repoman.freebsd.org> From: Bruce Evans Date: Wed, 13 Feb 2008 10:44:45 +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/src s_exp2.c s_exp2f.c src/lib/msun/ld128 s_exp2l.c src/lib/msun/ld80 s_exp2l.c 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: Wed, 13 Feb 2008 10:44:45 -0000 bde 2008-02-13 10:44:45 UTC FreeBSD src repository Modified files: lib/msun/src s_exp2f.c s_exp2.c lib/msun/ld128 s_exp2l.c lib/msun/ld80 s_exp2l.c Log: Fix exp2*(x) on signaling NaNs by returning x+x as usual. This has the side effect of confusing gcc-4.2.1's optimizer into more often doing the right thing. When it does the wrong thing here, it seems to be mainly making too many copies of x with dependency chains. This effect is tiny on amd64, but in some cases on i386 it is enormous. E.g., on i386 (A64) with -O1, the current version of exp2() should take about 50 cycles, but took 83 cycles before this change and 66 cycles after this change. exp2f() with -O1 only speeded up from 51 to 47 cycles. (exp2f() should take about 40 cycles, on an Athlon in either i386 or amd64 mode, and now takes 42 on amd64). exp2l() with -O1 slowed down from 155 cycles to 123 for some args; this is unimportant since the i386 exp2l() is a fake; the wrong thing for it seems to involve branch misprediction. Revision Changes Path 1.3 +1 -1 src/lib/msun/ld128/s_exp2l.c 1.3 +1 -1 src/lib/msun/ld80/s_exp2l.c 1.6 +1 -1 src/lib/msun/src/s_exp2.c 1.8 +1 -1 src/lib/msun/src/s_exp2f.c