Author: andrew
Date: Fri Aug 14 14:17:04 2015
New Revision: 286779
URL: https://svnweb.freebsd.org/changeset/base/286779

Log:
  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

Modified:
  head/contrib/compiler-rt/lib/builtins/floatditf.c
  head/contrib/compiler-rt/lib/builtins/floatunditf.c

Modified: head/contrib/compiler-rt/lib/builtins/floatditf.c
==============================================================================
--- head/contrib/compiler-rt/lib/builtins/floatditf.c   Fri Aug 14 13:58:18 
2015        (r286778)
+++ head/contrib/compiler-rt/lib/builtins/floatditf.c   Fri Aug 14 14:17:04 
2015        (r286779)
@@ -34,7 +34,7 @@ COMPILER_RT_ABI fp_t __floatditf(di_int 
     }
 
     // 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

Modified: head/contrib/compiler-rt/lib/builtins/floatunditf.c
==============================================================================
--- head/contrib/compiler-rt/lib/builtins/floatunditf.c Fri Aug 14 13:58:18 
2015        (r286778)
+++ head/contrib/compiler-rt/lib/builtins/floatunditf.c Fri Aug 14 14:17:04 
2015        (r286779)
@@ -25,7 +25,7 @@ COMPILER_RT_ABI fp_t __floatunditf(du_in
     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.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to