mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Make sure TracyCountBits() always returns uint64_t.
This commit is contained in:
parent
65ea33a60f
commit
68f476834f
@ -7,9 +7,12 @@
|
|||||||
# include <intrin.h>
|
# include <intrin.h>
|
||||||
# define TracyCountBits __popcnt64
|
# define TracyCountBits __popcnt64
|
||||||
#elif defined __GNUC__ || defined __clang__
|
#elif defined __GNUC__ || defined __clang__
|
||||||
# define TracyCountBits __builtin_popcountll
|
static inline uint64_t TracyCountBits( uint64_t i )
|
||||||
|
{
|
||||||
|
return uint64_t( __builtin_popcountll( i ) );
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static inline int TracyCountBits( uint64_t i )
|
static inline uint64_t TracyCountBits( uint64_t i )
|
||||||
{
|
{
|
||||||
i = i - ( (i >> 1) & 0x5555555555555555 );
|
i = i - ( (i >> 1) & 0x5555555555555555 );
|
||||||
i = ( i & 0x3333333333333333 ) + ( (i >> 2) & 0x3333333333333333 );
|
i = ( i & 0x3333333333333333 ) + ( (i >> 2) & 0x3333333333333333 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user