mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
tuklib_integer.h: Fix a recent copypaste error in Clang detection.
Wrong line was changed in 7062348bf3
.
Also, this has >= instead of == since ints larger than 32 bits would
work too even if not relevant in practice.
This commit is contained in:
parent
fbecaa2eb4
commit
809a2fd698
1 changed files with 2 additions and 2 deletions
|
@ -700,10 +700,10 @@ ctz32(uint32_t n)
|
||||||
#if defined(__INTEL_COMPILER)
|
#if defined(__INTEL_COMPILER)
|
||||||
return _bit_scan_forward(n);
|
return _bit_scan_forward(n);
|
||||||
|
|
||||||
#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX >= UINT32_MAX
|
#elif (TUKLIB_GNUC_REQ(3, 4) || defined(__clang__)) && UINT_MAX >= UINT32_MAX
|
||||||
return (uint32_t)__builtin_ctz(n);
|
return (uint32_t)__builtin_ctz(n);
|
||||||
|
|
||||||
#elif (TUKLIB_GNUC_REQ(3, 4) || defined(__clang__)) && UINT_MAX == UINT32_MAX
|
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
__asm__("bsfl %1, %0" : "=r" (i) : "rm" (n));
|
__asm__("bsfl %1, %0" : "=r" (i) : "rm" (n));
|
||||||
return i;
|
return i;
|
||||||
|
|
Loading…
Reference in a new issue