__m64_psub2uus

Microsoft Specific

Emits the 2-byte uus (unsigned, unsigned, signed) saturation form of the IPF Parallel Subtract (psub2.uus) instruction.

__m64 __m64_psub2uus( 
   __m64 a, 
   __m64 b 
);

Parameters

  • [in] a
    An __m64 union containing an array of four 16-bit unsigned integers.

  • [in] b
    An __m64 union containing an array of four 16-bit signed integers.

Return Value

An __m64 union containing an array of eight 8-bit unsigned integers, which are the results of the subtraction of the integers in b from the integers in a.

Requirements

Intrinsic

Architecture

__m64_psub2uus

IPF

Header file <intrin.h>

Remarks

The uus-saturation form means that the first parameter is unsigned, the second parameter is signed, and the return value is unsigned, and if an overflow or underflow occurs, the value saturates at the limit value. The 2-byte form operates on each 16-bit block as a separate integer.

Example

// psub2uus.cpp
// processor: IPF

#include <stdio.h>
#include <intrin.h>

#pragma intrinsic(__m64_psub2uus)

int main()
{
    __m64 m, n, result;
    m.m64_i64 = 0x110022003300FF00;  
    n.m64_i64 = 0x01100220033000FF;

    result = __m64_psub2uus(m, n);
    printf_s( "__m64_psub2uus(%#18I64x, %#18I64x) == %#18I64x\n",
              m, n, result);

    // due to underflow (negative result) many of the bytes here
    // will be zero.
    result = __m64_psub2uus(n, m);
    printf_s( "__m64_psub2uus(%#18I64x, %#18I64x) == %#18I64x\n",
              n, m, result);
}

__m64_psub2uus(0x110022003300ff00,  0x1100220033000ff) ==  0xff01fe02fd0fe01
__m64_psub2uus( 0x1100220033000ff, 0x110022003300ff00) ==              0x1ff

See Also

Concepts

__m64

Compiler Intrinsics