[−][src]Trait bitintr::Bzhi
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);