0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-07-24 10:25:42 -04:00

nasmlib: we need the exact size for the clz functions

We need to use the exact size for the clz functions, otherwise we will
generate the wrong result.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2016-11-15 14:05:53 -08:00
parent 8b19083483
commit 069ad5fc18

View File

@ -68,7 +68,7 @@ int ilog2_32(uint32_t v)
return n; return n;
} }
#elif defined(HAVE___BUILTIN_CTZ) && INT_MAX >= 2147483647 #elif defined(HAVE___BUILTIN_CTZ) && INT_MAX == 2147483647
int ilog2_32(uint32_t v) int ilog2_32(uint32_t v)
{ {
@ -107,7 +107,7 @@ int ilog2_64(uint64_t v)
return n; return n;
} }
#elif defined(HAVE__BUILTIN_CTZLL) && LLONG_MAX >= 9223372036854775807L #elif defined(HAVE__BUILTIN_CTZLL) && LLONG_MAX == 9223372036854775807LL
int ilog2_64(uint64_t v) int ilog2_64(uint64_t v)
{ {