# Intrinsics for Operations to Manipulate Integer Data at Bit-Granularity

Parent topic: Intrinsics for Intel® Advanced Vector Extensions 2 (Intel® AVX2)

- _bextr_u32/64
  Extracts contiguous bits from the first source operand to the destination using an index value and length value specified in the second source operand. The corresponding Intel® AVX2 instruction is BEXTR.
- _blsi_u32/64
  Extracts the lowest set bit from the source operand and set the corresponding bit in the destination. The corresponding Intel® AVX2 instruction is BLSI.
- _blsmsk_u32/64
  Sets all the lower bits of the destination to “1” up to and including lowest set bit (=1) in the source operand. The corresponding Intel® AVX2 instruction is BLSMSK.
- _blsr_u32/64
  Copies all bits from the source operand to the destination and resets (=0) the bit position in the destination that corresponds to the lowest set bit of the source operand. The corresponding Intel® AVX2 instruction is BLSR.
- _bzhi_u32/64
  Copies the bits of the first source operand into the destination and clears the higher bits in the destination according to the index value specified by the second source operand. The corresponding Intel® AVX2 instruction is BZHI.
- _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.
- _pdep_u32/64
  Transfer/scatter contiguous low order bits in the first source operand into the destination according to the mask in the second source operand. The corresponding Intel® AVX2 instruction is PDEP.
- _lzcnt_u32/64
  Counts the number of leading zero bits in a source operand. Returns operand size as output when source operand is zero. The corresponding Intel® AVX2 instruction is LZCNT.
- _tzcnt_u32/64
  Counts the number of trailing least significant zero bits in source operand and returns the result in destination. When source operand is 0, it returns its size in bits. The corresponding Intel® AVX2 instruction is TZCNT.