score: Use builtin for _Bitfield_Find_first_bit()

In case the CPU architecture provides no specialized
_CPU_Bitfield_Find_first_bit() macro, then use the __builtin_clz()
builtin in case __GNUC__ is defined.
This commit is contained in:
Sebastian Huber
2016-06-08 08:52:38 +02:00
parent b8a84064ac
commit 80bbb4eda3

View File

@@ -60,6 +60,8 @@ RTEMS_INLINE_ROUTINE unsigned int _Bitfield_Find_first_bit(
#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
_CPU_Bitfield_Find_first_bit( value, bit_number );
#elif defined(__GNUC__)
bit_number = __builtin_clz( value ) - __SIZEOF_INT__ * __CHAR_BIT__ + 16;
#else
if ( value < 0x100 ) {
bit_number = _Bitfield_Leading_zeros[ value ] + 8;