Format
#include <builtin.h>unsigned int __cnttz4(unsigned int num)
Language Level: None
__cnttz4 calculates the number of trailing (ie. least
significant) zero bits in the 4 byte unsigned value num.
Return Value
Returns the number of trailing zero bits. If num
is zero, then 32 is returned.
Example
This example calculates the number of trailing zero bits
in the 4 byte value 0x00040000.
#include <stdio.h> #include <builtin.h>
unsigned int input = 0x00040000;
int main(void)
{
printf("The number of trailing zero bits in %.8x is %u.\n",
input, __cnttz4(input));
/*******************************************************
The output should be:
The number of trailing zero bits in 00040000 is 18. *******************************************************/
return 0; }
![]()
__cntlz4 -- Count Leading Zero Bits
in 4 Byte Value
__cntlz8 -- Count Leading Zero Bits in 8
Byte Value
__cnttz8 -- Count Trailing Zero Bits in 8
Byte Value