__m64_shrp

Microsoft Specific

Emits the IPF Shift Right Pair (shrp) instruction.

__m64 __m64_shrp( 
   __m64 a, 
   __m64 b, 
   const int nBit 
);

Parameters

  • [in] a
    An __m64 union containing a 64-bit data field.

  • [in] b
    An __m64 union containing a 64-bit data field.

  • [in] nBit
    The number of bits to right shift the concatenated pair. Valid values from 0 to 63.

Return Value

The least significant 64 bits of the concatenated, right-shifted pair.

Requirements

Intrinsic

Architecture

__m64_shrp

IPF

Header file <intrin.h>

Remarks

Two 64-bit data fields are concatenated, a being placed in the upper 64 bits and b in the lower 64 bits; the resulting 128-bit value is right shifted by nBit bits and the lower 64 bits are returned.

Example

// shrp.cpp
// processor: IPF
#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(__m64_shrp)

int main()
{
    __m64 m, n, result;
    m.m64_u64 = 0x1111111111111111; 
    n.m64_u64 = 0x2222222222222222;
    result = __m64_shrp(m, n, 32);
    printf_s("__m64_shrp(0x%I64x, 0x%I64x, %d) returns\n0x%I64x\n",
             m, n, 32, result);

    result = __m64_shrp(m, n, 17);
    printf_s("__m64_shrp(0x%I64x, 0x%I64x, %d) returns\n0x%I64x\n",
             m, n, 17, result);
}
__m64_shrp(0x1111111111111111, 0x2222222222222222, 32) returns
0x1111111122222222
__m64_shrp(0x1111111111111111, 0x2222222222222222, 17) returns
0x8888911111111111

See Also

Reference

__m64

Compiler Intrinsics