Microsoft Specific

Emits the IPF padd1.uus instruction (the 1-byte, unsigned, unsigned, signed-saturation form of Parallel Add).

__m64 __m64_padd1uus( 
   __m64 a, 
   __m64 b 


  • [in] a
    The first 64-bit field containing bytes to be added.

  • [in] b
    The second 64-bit field containing bytes to be added.






Header file <intrin.h>


Parallel Add adds each byte of one operand to the corresponding byte of the second operand and puts the result in the corresponding byte of the result. The bytes from the first operand are considered unsigned, and the bytes from the second operand are considered signed. The resulting bytes are considered unsigned.

If the result of the addition overflows 1 byte, the value saturates the byte and the byte is set to 0xFF. If the second (signed) parameter represents a negative integer greater in absolute value than the first parameter, the byte is said to underflow and is set to zero.


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

#pragma intrinsic(__m64_padd1uus)

int main()
    __m64 m, n, result;
    m.m64_i64 = 0xee0100;  
    n.m64_i64 = 0x00ff22;

    // As the second parameter, 0xff = -1,
    // so the second byte will add to zero.
    result = __m64_padd1uus(m, n);
    printf_s("__m64_padd1uus(0x%I64x, 0x%I64x) returns 0x%I64x\n",
             m, n, result);

    // This operation is not commutative, as this example shows.
    // The byte containing 0xff will be considered unsigned and when
    // 0x01 is added, will be saturated at the limit value of 0xff.
    // The byte containing ee will be a negative integer, which
    // when added to 0x00 will underflow, so that byte will be set
    // to zero.
    result = __m64_padd1uus(n, m);
    printf_s("__m64_padd1uus(0x%I64x, 0x%I64x) returns 0x%I64x\n",
             n, m, result);
__m64_padd1uus(0xee0100, 0xff22) returns 0xee0022
__m64_padd1uus(0xff22, 0xee0100) returns 0xff22

See Also



Compiler Intrinsics