diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-10-01 23:42:29 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-10-01 23:42:29 +0300 |
commit | 68f476834f6ed5e33175af0d5af8f7986f412c19 (patch) | |
tree | 963aa01f8c7ddb6d077b5c598d53bb225ab9bb0d /server/TracyPopcnt.hpp | |
parent | 65ea33a60f5dbe4fa1008f606760c37648e6fe15 (diff) |
Make sure TracyCountBits() always returns uint64_t.
Diffstat (limited to 'server/TracyPopcnt.hpp')
-rw-r--r-- | server/TracyPopcnt.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/TracyPopcnt.hpp b/server/TracyPopcnt.hpp index a84008d5..e6c4539d 100644 --- a/server/TracyPopcnt.hpp +++ b/server/TracyPopcnt.hpp @@ -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 ); |