[][src]Trait bitintr::Pdep

pub trait Pdep {
    fn pdep(self, mask: Self) -> Self;
}

Parallel bits deposit

Required methods

fn pdep(self, mask: Self) -> Self

Parallel bits deposit.

Scatter contiguous low order bits of x to the result at the positions specified by the mask.

All other bits (bits not set in the mask) of the result are set to zero.

Keywords: Parallel bits deposit, scatter bits.

Instructions

  • PDEP:
    • Description: Parallel bits deposit.
    • Architecture: x86.
    • Instruction set: BMI2.
    • Registers: 32/64 bit.

Example

let n = 0b1011_1110_1001_0011u16;

let m0 = 0b0110_0011_1000_0101u16;
let s0 = 0b0000_0010_0000_0101u16;

let m1 = 0b1110_1011_1110_1111u16;
let s1 = 0b1110_1001_0010_0011u16;

assert_eq!(n.pdep(m0), s0);
assert_eq!(n.pdep(m1), s1);
Loading content...

Implementors

impl Pdep for i8[src]

impl Pdep for i16[src]

impl Pdep for i32[src]

impl Pdep for i64[src]

impl Pdep for u8[src]

impl Pdep for u16[src]

impl Pdep for u32[src]

impl Pdep for u64[src]

Loading content...