diff options
author | bde <bde@FreeBSD.org> | 2007-05-29 07:13:07 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2007-05-29 07:13:07 +0000 |
commit | 0cadc213d533d92acab0d770376baacbd16de8bf (patch) | |
tree | 32181c87cca3b6a2c5d8f6fa67166bbc2a2a0066 /lib/msun/src/s_cbrtf.c | |
parent | 39d0d8b3e6e02fad04605003dc661b043c320ff8 (diff) | |
download | FreeBSD-src-0cadc213d533d92acab0d770376baacbd16de8bf.zip FreeBSD-src-0cadc213d533d92acab0d770376baacbd16de8bf.tar.gz |
Merge the relevant part of rev.1.14 of s_cbrt.c (a micro-optimization
involving moving the check for x == 0). The savings in cycles are
smaller for cbrtf() than for cbrt(), and positive in all measured cases
with gcc-3.4.4, but still very machine/compiler-dependent.
Diffstat (limited to 'lib/msun/src/s_cbrtf.c')
-rw-r--r-- | lib/msun/src/s_cbrtf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/msun/src/s_cbrtf.c b/lib/msun/src/s_cbrtf.c index 5fcd795..ea7b3cd 100644 --- a/lib/msun/src/s_cbrtf.c +++ b/lib/msun/src/s_cbrtf.c @@ -41,11 +41,11 @@ cbrtf(float x) sign=hx&0x80000000; /* sign= sign(x) */ hx ^=sign; if(hx>=0x7f800000) return(x+x); /* cbrt(NaN,INF) is itself */ - if(hx==0) - return(x); /* cbrt(0) is itself */ /* rough cbrt to 5 bits */ - if(hx<0x00800000) { /* subnormal number */ + if(hx<0x00800000) { /* zero or subnormal? */ + if(hx==0) + return(x); /* cbrt(+-0) is itself */ SET_FLOAT_WORD(t,0x4b800000); /* set t= 2**24 */ t*=x; GET_FLOAT_WORD(high,t); |