Skip to content

Commit

Permalink
fixup! Add cluster linearization code
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaftuar committed Oct 19, 2023
1 parent 4b69d84 commit 190ada4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/util/bitset.h
Expand Up @@ -33,6 +33,14 @@

namespace bitset_detail {

#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
# pragma intrinsic(_BitScanForward)
#endif

#if defined(_MSC_VER) && defined(_M_X64)
# pragma intrinsic(_BitScanForward64)
#endif

/** Compute the trailing zeroes of a non-zero value. */
template<typename I>
unsigned inline CountTrailingZeroes(I v) noexcept
Expand All @@ -52,15 +60,13 @@ unsigned inline CountTrailingZeroes(I v) noexcept
if constexpr (BITS <= BITS_ULL) return __builtin_ctzll(v);
#endif
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
# pragma intrinsic(_BitScanForward)
if constexpr (BITS <= 32) {
unsigned long ret;
_BitScanForward(&ret, v);
return ret;
}
#endif
#if defined(_MSC_VER) && defined(_M_X64)
# pragma intrinsic(_BitScanForward64)
if constexpr (BITS <= 64) {
unsigned long ret;
_BitScanForward64(&ret, v);
Expand Down

0 comments on commit 190ada4

Please sign in to comment.