__m64_dep_zi
Visual Studio 2010
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 );
// 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;
}