Skip to content

Commit

Permalink
SVF code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
yuleisui committed Aug 14, 2024
1 parent f6f863c commit d1549c8
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions svf/include/Util/SparseBitVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,35 +71,39 @@ template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter
};

#if defined(__GNUC__) || defined(_MSC_VER)
template <typename T> struct TrailingZerosCounter<T, 4> {
static unsigned count(T Val, ZeroBehavior) {
if (Val == 0)
return 32;
template <typename T> struct TrailingZerosCounter<T, 4>
{
static unsigned count(T Val, ZeroBehavior)
{
if (Val == 0)
return 32;

#if HAS_CTZ || defined(__GNUC__)
return __builtin_ctz(Val);
return __builtin_ctz(Val);
#elif defined(_MSC_VER)
unsigned long Index;
_BitScanForward(&Index, Val);
return Index;
unsigned long Index;
_BitScanForward(&Index, Val);
return Index;
#endif
}
}
};

#if !defined(_MSC_VER) || defined(_M_X64)
template <typename T> struct TrailingZerosCounter<T, 8> {
static unsigned count(T Val, ZeroBehavior) {
if (Val == 0)
return 64;
template <typename T> struct TrailingZerosCounter<T, 8>
{
static unsigned count(T Val, ZeroBehavior)
{
if (Val == 0)
return 64;

#if HAS_CTZLL || defined(__GNUC__)
return __builtin_ctzll(Val);
return __builtin_ctzll(Val);
#elif defined(_MSC_VER)
unsigned long Index;
_BitScanForward64(&Index, Val);
return Index;
unsigned long Index;
_BitScanForward64(&Index, Val);
return Index;
#endif
}
}
};
#endif
#endif
Expand Down

0 comments on commit d1549c8

Please sign in to comment.