Commit 7107a1f8 authored by andrew's avatar andrew
Browse files

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
parent eb051710
...@@ -34,7 +34,7 @@ COMPILER_RT_ABI fp_t __floatditf(di_int a) { ...@@ -34,7 +34,7 @@ COMPILER_RT_ABI fp_t __floatditf(di_int a) {
} }
// Exponent of (fp_t)a is the width of abs(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; rep_t result;
// Shift a into the significand field and clear the implicit bit. Extra // 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) { ...@@ -25,7 +25,7 @@ COMPILER_RT_ABI fp_t __floatunditf(du_int a) {
if (a == 0) return fromRep(0); if (a == 0) return fromRep(0);
// Exponent of (fp_t)a is the width of abs(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; rep_t result;
// Shift a into the significand field and clear the implicit bit. // Shift a into the significand field and clear the implicit bit.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment