0
0
mirror of https://github.com/wolfpld/tracy.git synced 2026-01-18 17:11:26 +01:00

Use builtins before MSVC intrinsics

This commit is contained in:
Alex Gunnarson
2025-12-17 15:24:04 -07:00
committed by GitHub
parent dffa18378b
commit 90bc94f237

View File

@@ -4,11 +4,7 @@
#include <limits.h>
#include <stdint.h>
#if defined _WIN64
# include <intrin.h>
# define TracyCountBits __popcnt64
# define TracyLzcnt __lzcnt64
#elif defined __GNUC__ || defined __clang__
#if defined __GNUC__ || defined __clang__
static inline uint64_t TracyCountBits( uint64_t i )
{
return uint64_t( __builtin_popcountll( i ) );
@@ -17,6 +13,10 @@ static inline uint64_t TracyLzcnt( uint64_t i )
{
return uint64_t( __builtin_clzll( i ) );
}
#elif defined _WIN64
# include <intrin.h>
# define TracyCountBits __popcnt64
# define TracyLzcnt __lzcnt64
#else
static inline uint64_t TracyCountBits( uint64_t i )
{