Trait bitintr::Bzhi
[−]
[src]
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);
Implementors
impl Bzhi for u8
impl Bzhi for u16
impl Bzhi for i8
impl Bzhi for i16
impl Bzhi for u32
impl Bzhi for i32
impl Bzhi for u64
impl Bzhi for i64