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:
parent
eb051710f8
commit
7107a1f852
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user