Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

<span class='option'>_pext_u32/64 </span>

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