mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 14:03:52 +00:00
Use tzcnt instead of bsf.
This commit is contained in:
parent
7a6141389c
commit
47dfddedfd
@ -128,7 +128,23 @@ static Counts& counts() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// count leading/trailing bits
|
// count leading/trailing bits
|
||||||
#ifdef _MSC_VER
|
#if defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
# include <intrin.h>
|
||||||
|
# else
|
||||||
|
# include <x86intrin.h>
|
||||||
|
# endif
|
||||||
|
# if ROBIN_HOOD(BITNESS) == 32
|
||||||
|
# define ROBIN_HOOD_PRIVATE_DEFINITION_CTZ() _tzcnt_u32
|
||||||
|
# else
|
||||||
|
# define ROBIN_HOOD_PRIVATE_DEFINITION_CTZ() _tzcnt_u64
|
||||||
|
# endif
|
||||||
|
# ifdef __AVX2__
|
||||||
|
# define ROBIN_HOOD_COUNT_TRAILING_ZEROES(x) ROBIN_HOOD(CTZ)(x)
|
||||||
|
# else
|
||||||
|
# define ROBIN_HOOD_COUNT_TRAILING_ZEROES(x) ((x) ? ROBIN_HOOD(CTZ)(x) : ROBIN_HOOD(BITNESS))
|
||||||
|
# endif
|
||||||
|
#elif defined _MSC_VER
|
||||||
# if ROBIN_HOOD(BITNESS) == 32
|
# if ROBIN_HOOD(BITNESS) == 32
|
||||||
# define ROBIN_HOOD_PRIVATE_DEFINITION_BITSCANFORWARD() _BitScanForward
|
# define ROBIN_HOOD_PRIVATE_DEFINITION_BITSCANFORWARD() _BitScanForward
|
||||||
# else
|
# else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user