Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


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



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.
    // write the value in big-endian format
    p[0] = 0x12345678; 

    // Switch back to little-endian memory references.

    // The same statement in code has produced a different result!
    printf_s("0x%x\n", p[0]);


© 2016 Microsoft