Make the order of operations for lib/msun more clear.

Tested with md5 sum of object code

Reported by:	swildner@DragonFlyBSD.org
Submitted by:	bde
This commit is contained in:
Eitan Adler 2013-06-24 19:12:17 +00:00
parent 19e1c4d115
commit 19eb5fb06b
2 changed files with 2 additions and 2 deletions

View File

@ -117,7 +117,7 @@ add_and_denormalize(double a, double b, int scale)
if (sum.lo != 0) {
EXTRACT_WORD64(hibits, sum.hi);
bits_lost = -((int)(hibits >> 52) & 0x7ff) - scale + 1;
if (bits_lost != 1 ^ (int)(hibits & 1)) {
if ((bits_lost != 1) ^ (int)(hibits & 1)) {
/* hibits += (int)copysign(1.0, sum.hi * sum.lo) */
EXTRACT_WORD64(lobits, sum.lo);
hibits += 1 - (((hibits ^ lobits) >> 62) & 2);

View File

@ -113,7 +113,7 @@ add_and_denormalize(long double a, long double b, int scale)
if (sum.lo != 0) {
u.e = sum.hi;
bits_lost = -u.bits.exp - scale + 1;
if (bits_lost != 1 ^ (int)(u.bits.manl & 1))
if ((bits_lost != 1) ^ (int)(u.bits.manl & 1))
sum.hi = nextafterl(sum.hi, INFINITY * sum.lo);
}
return (ldexp(sum.hi, scale));