From 7b7bd3ce0d76903618e300bd8b2e21fe781c6eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 1 Apr 2015 14:38:24 -0700 Subject: [PATCH] Fixed 64-bit clz/ctz. --- include/bx/uint32_t.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bx/uint32_t.h b/include/bx/uint32_t.h index ce04e04..9e77295 100644 --- a/include/bx/uint32_t.h +++ b/include/bx/uint32_t.h @@ -648,7 +648,7 @@ namespace bx inline uint64_t uint64_cntlz(uint64_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG - return __builtin_clz(_val); + return __builtin_clzll(_val); #elif BX_COMPILER_MSVC && BX_PLATFORM_WINDOWS && BX_ARCH_64BIT unsigned long index; _BitScanReverse64(&index, _val); @@ -669,7 +669,7 @@ namespace bx inline uint64_t uint64_cnttz(uint64_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG - return __builtin_ctzl(_val); + return __builtin_ctzll(_val); #elif BX_COMPILER_MSVC && BX_PLATFORM_WINDOWS && BX_ARCH_64BIT unsigned long index; _BitScanForward64(&index, _val);