Skip to content

Commit 9ab8954

Browse files
author
Eddie
committed
Blind attempt to fix MSVC build
1 parent 29e1b21 commit 9ab8954

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

inc/zoo/swar/SWAR.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ constexpr std::make_unsigned_t<T> msbIndex(T v) noexcept {
3737
/// Index into the bits of the type T that contains the LSB.
3838
template<typename T>
3939
constexpr std::make_unsigned_t<T> lsbIndex(T v) noexcept {
40-
// ~v & (v - 1) turns on all trailing zeroes, zeroes the rest
41-
//return meta::logFloor(1 + (~v & (v - 1)));
42-
return ~v ? __builtin_ctzll(v) : sizeof(T) * 8;
40+
#ifdef _MSC_VER
41+
// ~v & (v - 1) turns on all trailing zeroes, zeroes the rest
42+
return meta::logFloor(1 + (~v & (v - 1)));
43+
#else
44+
return ~v ? __builtin_ctzll(v) : sizeof(T) * 8;
45+
#endif
4346
}
4447

4548
/// Core abstraction around SIMD Within A Register (SWAR). Specifies 'lanes'

0 commit comments

Comments
 (0)