]> Savannah Git Hosting - gnulib.git/commitdiff
count-leading-zeros: use 64-bit intrinsics on 32-bit Windows
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Jan 2015 17:05:22 +0000 (09:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Jan 2015 17:05:47 +0000 (09:05 -0800)
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.

ChangeLog
lib/count-leading-zeros.h
lib/count-one-bits.h
lib/count-trailing-zeros.h

index 79370de2b3dbe61839985050c2c3a98915310124..79787f154b4ad11105b8c14eaa96d8be30e7deb0 100644 (file)
--- 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.
index 166309a3f8c91f3035587e14f582936b721d1405..5904eb7f78a39ea5094bde7faa36e5fe86be5f36 100644 (file)
@@ -104,13 +104,8 @@ count_leading_zeros_l (unsigned long int x)
 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
 
index bd79fc5609cf8db3d87009388f3c61c9c137053e..d54397f5fac8b5c9c083c59c1a3225a6db29f1c6 100644 (file)
@@ -127,11 +127,7 @@ count_one_bits_l (unsigned long int x)
 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
 
index 1e71977fab4ad7759deb696424a64823482255ff..83ce2fbe26ce84394a7e7ae165bf890f2422571c 100644 (file)
@@ -96,13 +96,8 @@ count_trailing_zeros_l (unsigned long int x)
 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