[][src]Trait bitintr::Bzhi

pub trait Bzhi {
    fn bzhi(self, bit_position: u32) -> Self;
}

Zero high bits

Required methods

fn bzhi(self, bit_position: u32) -> Self

Zero the high bits of self at position >= bit_position.

Panics

If bit_position >= bit_size() and -C debug-assertions=1.

Instructions

  • BZHI:
    • Description: Zero high bits starting with specified bit position.
    • Architecture: x86.
    • Instruction set: BMI2.
    • Registers: 32/64 bit.

Example

let n = 0b1111_0010_u32;
let s = 0b0001_0010_u32;
assert_eq!(n.bzhi(5), s);
assert_eq!(n.bzhi(5), s);
Loading content...

Implementors

impl Bzhi for i8[src]

impl Bzhi for i16[src]

impl Bzhi for i32[src]

impl Bzhi for i64[src]

impl Bzhi for u8[src]

impl Bzhi for u16[src]

impl Bzhi for u32[src]

impl Bzhi for u64[src]

Loading content...