diff options
author | andrew <andrew@FreeBSD.org> | 2015-08-14 14:17:04 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2015-08-14 14:17:04 +0000 |
commit | 7107a1f8522ae296199c39a8ae8a185d10e9c5fb (patch) | |
tree | b28d06553c921cffb448fbe1fc077d29114b32f6 /contrib/compiler-rt | |
parent | eb051710f8adbb3595f1a0bff8073e5b80f61287 (diff) | |
download | FreeBSD-src-7107a1f8522ae296199c39a8ae8a185d10e9c5fb.zip FreeBSD-src-7107a1f8522ae296199c39a8ae8a185d10e9c5fb.tar.gz |
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
Diffstat (limited to 'contrib/compiler-rt')
-rw-r--r-- | contrib/compiler-rt/lib/builtins/floatditf.c | 2 | ||||
-rw-r--r-- | contrib/compiler-rt/lib/builtins/floatunditf.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/compiler-rt/lib/builtins/floatditf.c b/contrib/compiler-rt/lib/builtins/floatditf.c index 01261c6..1a5f8e5 100644 --- a/contrib/compiler-rt/lib/builtins/floatditf.c +++ b/contrib/compiler-rt/lib/builtins/floatditf.c @@ -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 diff --git a/contrib/compiler-rt/lib/builtins/floatunditf.c b/contrib/compiler-rt/lib/builtins/floatunditf.c index 7533f81..8098e95 100644 --- a/contrib/compiler-rt/lib/builtins/floatunditf.c +++ b/contrib/compiler-rt/lib/builtins/floatunditf.c @@ -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. |