libm: cherry-pick one patch from freebsd to fix logb() denormals issue

from http://svnweb.freebsd.org/base?view=revision&revision=176101
"
Oops, fix the fix in rev.1.10.  logb() and logbf() were broken on
 denormals, and logb() remained broken after 1.10 because the fix for
 logbf() was incompletely translated.

Convert to __FBSDID().
"

Change-Id: I54f33648db7c421b06eee1ea8e63c57a179fae0d
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
This commit is contained in:
Jack Ren 2012-02-28 12:02:21 +08:00
parent d041bf2095
commit 1fa7b45df8

View File

@ -36,9 +36,9 @@ logb(double x)
if(ix>=0x7ff00000) return x*x;
if(ix<0x00100000) {
x *= two54; /* convert subnormal x to normal */
GET_FLOAT_WORD(ix,x);
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
return (float) ((ix>>20)-1023-54);
return (double) ((ix>>20)-1023-54);
} else
return (double) ((ix>>20)-1023);
}