Use __builtin_clzll to count the leading zero bits, the data is based on

long long so __builtin_clz will return an incorrect value.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D3375
This commit is contained in:
andrew 2015-08-14 14:17:04 +00:00
parent eb051710f8
commit 7107a1f852
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ COMPILER_RT_ABI fp_t __floatditf(di_int a) {
}
// Exponent of (fp_t)a is the width of abs(a).
const int exponent = (aWidth - 1) - __builtin_clz(a);
const int exponent = (aWidth - 1) - __builtin_clzll(a);
rep_t result;
// Shift a into the significand field and clear the implicit bit. Extra

View File

@ -25,7 +25,7 @@ COMPILER_RT_ABI fp_t __floatunditf(du_int a) {
if (a == 0) return fromRep(0);
// Exponent of (fp_t)a is the width of abs(a).
const int exponent = (aWidth - 1) - __builtin_clz(a);
const int exponent = (aWidth - 1) - __builtin_clzll(a);
rep_t result;
// Shift a into the significand field and clear the implicit bit.