[][src]Trait bitintr::Tzcnt

pub trait Tzcnt {
    fn tzcnt(self) -> Self;
}

Counts trailing zero bits

Required methods

fn tzcnt(self) -> Self

Counts the number of trailing least significant zero bits.

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

This is equivalent to searching for the least significant set bit and returning its index.

Keywords: Count trailing zeros, Bit scan forward, find first set.

Instructions

  • TZCNT:
    • Description: Count the number of trailing zero bits.
    • Architecture: x86.
    • Instruction set: BMI.
    • Registers: 16/32/64 bit.

Example

assert_eq!(0b1001_0000_u16.tzcnt(), 4_u16);
assert_eq!(0b0000_0000_u32.tzcnt(), 32_u32);
assert_eq!(0b0000_0001_u64.tzcnt(), 0_u64);
Loading content...

Implementors

impl Tzcnt for i8[src]

impl Tzcnt for i16[src]

impl Tzcnt for i32[src]

impl Tzcnt for i64[src]

impl Tzcnt for u8[src]

impl Tzcnt for u16[src]

impl Tzcnt for u32[src]

impl Tzcnt for u64[src]

Loading content...