changeset 17864:82be015ff2aa

count-leading-zeros: use 64-bit intrinsics on 32-bit Windows This reverts the last patch but one, as it shouldn't be needed now that the typo is fixed. * lib/count-leading-zeros.h (count_leading_zeros_ll): * lib/count-trailing-zeros.h: * lib/count-one-bits.h: Go back to using 64-bit intrinsics.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 06 Jan 2015 09:05:22 -0800
parents 9ace8922f68f
children 8bb83af40ef3
files ChangeLog lib/count-leading-zeros.h lib/count-one-bits.h lib/count-trailing-zeros.h
diffstat 4 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-01-06  Paul Eggert  <eggert@cs.ucla.edu>
 
+	count-leading-zeros: use 64-bit intrinsics on 32-bit Windows
+	This reverts the last patch but one, as it shouldn't be needed now
+	that the typo is fixed.
+	* lib/count-leading-zeros.h (count_leading_zeros_ll):
+	* lib/count-trailing-zeros.h:
+	* lib/count-one-bits.h:
+	Go back to using 64-bit intrinsics.
+
 	count-leading-zeros: fix pragma typos
 	* lib/count-leading-zeros.h (_BitScanReverse, _BitScanReverse64):
 	Fix typos in declaration of intrinsics when _MSC_VER.
--- a/lib/count-leading-zeros.h
+++ b/lib/count-leading-zeros.h
@@ -104,13 +104,8 @@
 COUNT_LEADING_ZEROS_INLINE int
 count_leading_zeros_ll (unsigned long long int x)
 {
-# if _MSC_VER && ! defined _M_X64
-  int count = count_leading_zeros (x >> 31 >> 1);
-  return count < 32 ? count : 32 + count_leading_zeros (x);
-# else
   COUNT_LEADING_ZEROS (__builtin_clzll, _BitScanReverse64,
                        unsigned long long int);
-# endif
 }
 #endif
 
--- a/lib/count-one-bits.h
+++ b/lib/count-one-bits.h
@@ -127,11 +127,7 @@
 COUNT_ONE_BITS_INLINE int
 count_one_bits_ll (unsigned long long int x)
 {
-# if _MSC_VER && ! defined _M_X64
-  return count_one_bits (x >> 31 >> 1) + count_one_bits (x);
-# else
   COUNT_ONE_BITS (__builtin_popcountll, __popcnt64, unsigned long long int);
-# endif
 }
 #endif
 
--- a/lib/count-trailing-zeros.h
+++ b/lib/count-trailing-zeros.h
@@ -96,13 +96,8 @@
 COUNT_TRAILING_ZEROS_INLINE int
 count_trailing_zeros_ll (unsigned long long int x)
 {
-# if _MSC_VER && ! defined _M_X64
-  int count = count_trailing_zeros (x);
-  return count < 32 ? count : 32 + count_trailing_zeros (x >> 31 >> 1);
-# else
   COUNT_TRAILING_ZEROS (__builtin_ctzll, _BitScanForward64,
                         unsigned long long int);
-# endif
 }
 #endif