Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

__sum

Microsoft Specific

Emits the IPF Set User Mask (sum) instruction.

void __sum( 
   int Mask 
);
[in] Mask

The 6-bit value to perform an OR operation with the user mask. Must be a compile time constant.

Intrinsic

Architecture

__sum

IPF

Header file <intrin.h>

The Mask parameter is used with an OR operation with the user mask to determine the new user mask value. For a table of the meaning of each of the 6 bits, see __rum.

This routine is only available as an intrinsic.

// usermask.cpp
// processor: IPF

#include <cstdio>
#include <intrin.h>

#pragma intrinsic(__sum, __rum)

#define BIG_ENDIAN 2

int main()
{
    int p[1];
    
    p[0] = 0x12345678;
    printf_s("0x%x\n", p[0]);

    // Switch to big-endian memory references.
    __sum(BIG_ENDIAN); 
    
    // write the value in big-endian format
    p[0] = 0x12345678; 

    // Switch back to little-endian memory references.
    __rum(BIG_ENDIAN); 

    // The same statement in code has produced a different result!
    printf_s("0x%x\n", p[0]);
}
0x12345678 0x78563412
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.