From 90bc94f237453085547847540c674f5800cc0ca6 Mon Sep 17 00:00:00 2001 From: Alex Gunnarson Date: Wed, 17 Dec 2025 15:24:04 -0700 Subject: [PATCH] Use builtins before MSVC intrinsics --- server/TracyPopcnt.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/TracyPopcnt.hpp b/server/TracyPopcnt.hpp index 945324fd..07b98fd8 100644 --- a/server/TracyPopcnt.hpp +++ b/server/TracyPopcnt.hpp @@ -4,11 +4,7 @@ #include #include -#if defined _WIN64 -# include -# 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 +# define TracyCountBits __popcnt64 +# define TracyLzcnt __lzcnt64 #else static inline uint64_t TracyCountBits( uint64_t i ) {