_xbegin
Classification
Other, General Support, CPUID Test: RTM
Header File
immintrin.h
Instruction
XBEGIN r32
Synopsis
 _xbegin(void);
Description
Specify the start of an RTM code region. If the logical processor was not already in transactional execution, then this call causes the logical processor to transition into transactional execution. On an RTM abort, the logical processor discards all architectural register and memory updates performed during the RTM execution, restores architectural state, and starts execution beginning at the fallback address computed from the outermost XBEGIN instruction. Return status of ~0 (0xFFFF) if continuing inside transaction; all other codes are aborts.
Operation
IF RTM_NEST_COUNT < MAX_RTM_NEST_COUNT
	RTM_NEST_COUNT := RTM_NEST_COUNT + 1
	IF RTM_NEST_COUNT == 1
		IF _64_BIT_MODE
			fallbackRIP := RIP
		ELSE IF _32_BIT_MODE
			fallbackEIP := EIP
		FI
		
		RTM_ACTIVE := 1
		// enter RTM execution, record register state, start tracking memory state
	FI
ELSE
	// RTM abort (see _xabort)
FI