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
bde at FreeBSD.org
Wed Feb 13 02:44:45 PST 2008
bde 2008-02-13 10:44:45 UTC
FreeBSD src repository
lib/msun/src s_exp2f.c s_exp2.c
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
More information about the cvs-src