Microsoft Specific

Emits the zero immediate form of the IPF Deposit (dep.z) instruction, which is used to copy a number of bits specified by len from a constant value source into a bit position specified by pos of the resulting value.

__m64 __m64_dep_zi( 
   const int source, 
   const int pos, 
   const int len 

[in] source

An 8-bit constant value to act as the source of bits to be copied into the result.

[in] pos

The bit position in the result to place the copied bits.

[in] len

The number of bits to copy.





Header file <intrin.h>

The bits are copied sign extended. The rest of the bits in the result are cleared to zero.

// dep_zi.cpp
// compile with: /EHsc
// processor: IPF
#include <iostream>
#include <intrin.h>
using namespace std;

#pragma intrinsic(__m64_dep_zi)

int main()
  const int imm = 0x12;
  __m64 result = __m64_dep_zi(imm, 4, 16);

  cout << hex << "0x" << result.m64_i64 << endl;

  // When copying a number of bits larger than an int,
  // the copied bits are sign extended:
  const int imm2 = -1;
  result = __m64_dep_zi(imm2, 0, 56); 
  cout << hex << "0x" << result.m64_i64;


Community Additions