_CountLeadingZeros, _CountLeadingZeros64

9/7/2007

This function returns the number of contiguous zero bits starting with the most significant bit in the argument.

Syntax

unsigned __cdecl _CountLeadingZeros(
  long arg1
);

unsigned __cdecl _CountLeadingZeros64(
  __int64 arg1
);

Parameters

  • arg1
    [in] The unsigned integer to be examined by the function.

Return Values

The number of contiguous zero bits in arg1. If none of the bits in arg1 are set, the return value is of _CountLeadingZeros is 32, or the value of _CountLeadingZeros64 is 64.

Remarks

This function can be implemented by calling a runtime function.

Requirements

Routine Required header Architecture

_CountLeadingZeros

<cmnintrin.h>

ARM, SH-4, MIPS

_CountLeadingZeros64

<cmnintrin.h>

ARM, SH-4, MIPS

See Also

Other Resources

Intrinsic Functions for Device Compilers