Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Aug 2015 14:17:04 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286779 - head/contrib/compiler-rt/lib/builtins
Message-ID:  <201508141417.t7EEH47J072039@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508141417.t7EEH47J072039>