forked from OSchip/llvm-project
Use 'unsigned long' to match the APIs of the MS bitscan intrinsics
We were getting warnings about how 'uint32_t*' is different from 'unsigned long*' even though they are effectively the same on Windows. llvm-svn: 277363
This commit is contained in:
parent
4c58266038
commit
1bd5e3ec56
|
@ -91,14 +91,14 @@ COMPILER_RT_ABI tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
|
|||
#include <intrin.h>
|
||||
|
||||
uint32_t __inline __builtin_ctz(uint32_t value) {
|
||||
uint32_t trailing_zero = 0;
|
||||
unsigned long trailing_zero = 0;
|
||||
if (_BitScanForward(&trailing_zero, value))
|
||||
return trailing_zero;
|
||||
return 32;
|
||||
}
|
||||
|
||||
uint32_t __inline __builtin_clz(uint32_t value) {
|
||||
uint32_t leading_zero = 0;
|
||||
unsigned long leading_zero = 0;
|
||||
if (_BitScanReverse(&leading_zero, value))
|
||||
return 31 - leading_zero;
|
||||
return 32;
|
||||
|
@ -106,7 +106,7 @@ uint32_t __inline __builtin_clz(uint32_t value) {
|
|||
|
||||
#if defined(_M_ARM) || defined(_M_X64)
|
||||
uint32_t __inline __builtin_clzll(uint64_t value) {
|
||||
uint32_t leading_zero = 0;
|
||||
unsigned long leading_zero = 0;
|
||||
if (_BitScanReverse64(&leading_zero, value))
|
||||
return 63 - leading_zero;
|
||||
return 64;
|
||||
|
|
Loading…
Reference in New Issue