Код: Выделить всё
/** \brief Count leading zeros
This function counts the number of leading zeros of a data value.
\param [in] value Value to count the leading zeros
\return number of leading zeros in value
*/
#define __CLZ __builtin_clzhttp://infocenter.arm.com/help/index.js ... EJGJD.html4.7.2. __builtin_clz
This builtin function inserts a CLZ instruction or an equivalent code sequence into the instruction stream generated by the compiler. It is functionally equivalent to the intrinsic __clz, except that the return type is int instead of unsigned char.
Note
This builtin function is a GNU compiler extension that is supported by the ARM compiler.
Еще что-то надо?4.7.10. __clz
This intrinsic inserts a CLZ instruction or an equivalent code sequence into the instruction stream generated by the compiler. It enables you to count the number of leading zeros of a data value in your C or C++ code.
Syntax
unsigned char __clz(unsigned int val)
Where:
val
is an unsigned int.
Return value
The __clz intrinsic returns the number of leading zeros in val.