__sum
TOC
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

__sum

Microsoft Specific

Emits the IPF Set User Mask (sum) instruction.


void __sum( 
   int Mask 
);

Parameters

[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]);
}

Output

0x12345678
0x78563412
Show:
© 2016 Microsoft