Function bitintr::x86::abm::lzcnt [] [src]

pub fn lzcnt<T: Int>(x: T) -> T

Counts the leading most significant zero bits.

When the operand is zero, it returns its size in bits.

Keywords: Leading Zeros Count, Count Leading Zeros, Bit Scan Severse, Find Last Set.

See also arm::v7::clz.

Assembly Instructions

Example

use bitintr::x86::abm::*;

assert_eq!(lzcnt(0b0101_1010u16), 9u16);
assert_eq!(0b0101_1010u16.lzcnt(), 9u16);