]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use STRICT_ASSIGN() for exp2f() and exp2() instead of a volatile
authorBruce Evans <bde@FreeBSD.org>
Sat, 19 Jan 2008 21:37:14 +0000 (21:37 +0000)
committerBruce Evans <bde@FreeBSD.org>
Sat, 19 Jan 2008 21:37:14 +0000 (21:37 +0000)
commit684217d8896437b642fa8a6020bb5318b2c330ed
treec3e748c0022c141866c1b2b93edc0bc911915c6e
parentfa7fdac72578705b19b445abcf8cee9f90ef2907
Use STRICT_ASSIGN() for exp2f() and exp2() instead of a volatile
variable hack for exp2f() only.

The volatile variable had a surprisingly large cost for exp2f() -- 19
cycles or 15% on i386 in the worst case observed.  This is only partly
explained by there being several references to the variable, only one
of which benefited from it being volatile.  Arches that have working
assignment are likely to benefit even more from not having any volatile
variable.

exp2() now has a chance of working with extra precision on i386.

exp2() has even more references to the variable, so it would have been
pessimized more by simply declaring the variable as volatile.  Even
the temporary volatile variable for STRICT_ASSIGN costs 5-10% on i386,
(A64) so I will change STRICT_ASSIGN() to do an ordinary assignment
until i386 defaults to extra precision.
lib/msun/src/s_exp2.c
lib/msun/src/s_exp2f.c