Developer Guide and Reference

Contents

Function Prototype and Macro Definitions

To use the prototypes and macro definitions shown in Group 1, include the
immintrin.h
file as follows:
#include <immintrin.h>
Group 1: Function Prototypes:
unsigned int _xbegin(void);
void _xend(void); void _xabort(const unsigned int imm); unsigned char _xtest(void);
The following macro definitions are included in the
immintrin.h
header file:
Group 1: Macro Definitions:
#define _XBEGIN_STARTED (~0u) #define _XABORT_EXPLICIT (1 << 0) #define _XABORT_RETRY (1 << 1) #define _XABORT_CONFLICT (1 << 2) #define _XABORT_CAPACITY (1 << 3) #define _XABORT_DEBUG (1 << 4) #define _XABORT_NESTED (1 << 5)
Group 2: Function Macros
The following function Macros are
not
included in
immintrin.h
header file. If you want to use them, you need to define them in your applications.
For the HW with RTM support
#define __try_transaction(x) if ((x =_xbegin()) == _XBEGIN_STARTED) #define __try_else _xend() } else #define __transaction_abort(c) _xabort(c)
For the HW with no RTM support
#define __try_transaction(x) if (0) { #define __try_else } else #define __transaction_abort(c)
x
is an unsigned integer type local variable for programmers to access RTM transaction abort code and holds the return value of
_xbegin()
.
c
is an unsigned integer com