Make sure TracyCountBits() always returns uint64_t.

This commit is contained in:
Bartosz Taudul 2019-10-01 22:42:29 +02:00
parent 65ea33a60f
commit 68f476834f

View File

@ -7,9 +7,12 @@
# include <intrin.h>
# define TracyCountBits __popcnt64
#elif defined __GNUC__ || defined __clang__
# define TracyCountBits __builtin_popcountll
static inline uint64_t TracyCountBits( uint64_t i )
{
return uint64_t( __builtin_popcountll( i ) );
}
#else
static inline int TracyCountBits( uint64_t i )
static inline uint64_t TracyCountBits( uint64_t i )
{
i = i - ( (i >> 1) & 0x5555555555555555 );
i = ( i & 0x3333333333333333 ) + ( (i >> 2) & 0x3333333333333333 );