1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[util] Cast _tzcnt_u64 to uint32_t

MSVC has _tzcnt_u64 return a uint64_t, which obviously, it can never return a number that big.
This commit is contained in:
Joshua Ashton 2022-11-16 15:49:34 +00:00 committed by Philip Rebohle
parent 69b1aa251d
commit 287412f746

View File

@ -101,7 +101,7 @@ namespace dxvk::bit {
inline uint32_t tzcnt(uint64_t n) {
#if defined(DXVK_ARCH_X86_64) && defined(_MSC_VER) && !defined(__clang__)
return _tzcnt_u64(n);
return (uint32_t)_tzcnt_u64(n);
#elif defined(DXVK_ARCH_X86_64) && defined(__BMI__)
return __tzcnt_u64(n);
#elif defined(DXVK_ARCH_X86_64) && (defined(__GNUC__) || defined(__clang__))