# _pext_u32/64

Transfer either contiguous or non-contiguous bits in the first source operand to contiguous low order bit positions in the destination according to the mask values. The corresponding Intel® AVX2 instruction is PEXT.

## Syntax

extern unsigned int _pext_u32(unsigned int source, unsigned int mask);

extern unsigned __int64 _pext_u64(unsigned __int64 s1, unsigned __int64 mask);

## Arguments

source | the source operand from where the bits are transferred
mask | mask value according to which the bits are transferred

## Description

The intrinsics use a mask in the second source operand to transfer either contiguous or non-contiguous bits in the first source operand to contiguous, low-order bit positions in the destination. For each bit set in the mask, the intrinsic extracts the corresponding bits from the first source operand and writes them into contiguous lower bits of the destination. The remaining upper bits of the destination are set to 0.

## Returns

Result of the operation

Parent topic: Intrinsics for Operations to Manipulate Integer Data at Bit-Granularity