From owner-svn-src-head@freebsd.org Fri Aug 14 14:17:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69B0A9B8B9C; Fri, 14 Aug 2015 14:17:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5873F10F2; Fri, 14 Aug 2015 14:17:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7EEH5Il072041; Fri, 14 Aug 2015 14:17:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7EEH47J072039; Fri, 14 Aug 2015 14:17:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201508141417.t7EEH47J072039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 14 Aug 2015 14:17:04 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2015 14:17:05 -0000 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.