Date: Wed, 13 Feb 2008 10:44:45 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org 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 Message-ID: <200802131044.m1DAijwH055356@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802131044.m1DAijwH055356>
