We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29e1b21 commit 9ab8954Copy full SHA for 9ab8954
inc/zoo/swar/SWAR.h
@@ -37,9 +37,12 @@ constexpr std::make_unsigned_t<T> msbIndex(T v) noexcept {
37
/// Index into the bits of the type T that contains the LSB.
38
template<typename T>
39
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;
+ #ifdef _MSC_VER
+ // ~v & (v - 1) turns on all trailing zeroes, zeroes the rest
+ return meta::logFloor(1 + (~v & (v - 1)));
43
+ #else
44
+ return ~v ? __builtin_ctzll(v) : sizeof(T) * 8;
45
+ #endif
46
}
47
48
/// Core abstraction around SIMD Within A Register (SWAR). Specifies 'lanes'
0 commit comments