mirror of
https://github.com/boostorg/unordered.git
synced 2025-09-25 07:10:57 +02:00
microoptimized unchecked_countr_zero for GCC/Clang
This commit is contained in:
@@ -923,6 +923,8 @@ inline unsigned int unchecked_countr_zero(int x)
|
||||
unsigned long r;
|
||||
_BitScanForward(&r,(unsigned long)x);
|
||||
return (unsigned int)r;
|
||||
#elif defined(BOOST_GCC)||defined(BOOST_CLANG)
|
||||
return (unsigned int)__builtin_ctz((unsigned int)x);
|
||||
#else
|
||||
BOOST_UNORDERED_ASSUME(x!=0);
|
||||
return (unsigned int)boost::core::countr_zero((unsigned int)x);
|
||||
|
Reference in New Issue
Block a user