Extensions
Forms
1 (1 Legacy)
Data
Intel XED v2026.08.23

XBEGIN starts a transaction of Intel’s Restricted Transactional Memory (RTM). Execution goes on with the next instruction, transactionally: the processor tracks every cache line the code reads and writes, and keeps its stores from other processors until XEND commits them all at once. If anything stops that (another processor touching a tracked line, too much data, some instructions and system events, or XABORT), the transaction aborts: the registers and memory go back to what they were at XBEGIN, and execution jumps to the fallback address, the operand of XBEGIN, with a status in EAX. Nothing guarantees that a transaction ever commits, so the fallback path has to do the work another way, usually under a lock.

The status in EAX

After an abort, bit 0 means XABORT, with its 8-bit operand in bits 31 to 24; bit 1 that a retry may succeed; bit 2 a conflict with another processor; bit 3 a full buffer; bit 4 a #DB or #BP; bit 5 an abort in a nested transaction. EAX may also be 0. With -mrtm, GCC 14 at -O2 compiles _xbegin() to mov eax, -1 and an XBEGIN whose fallback is the very next instruction, so both paths meet at a cmp eax, -1: -1 is _XBEGIN_STARTED, what _xbegin() returns when the transaction runs. Clang 23 sends the fallback to a label of its own instead.

Inner XBEGINs only count the nesting; an abort returns to the outermost one’s fallback. With a 66 prefix the offset is 16 bits, but unlike a near JMP the target is not cut to 16 bits.

Where it runs

XBEGIN, XEND and XABORT need CPUID.(EAX=7,ECX=0):EBX[11]; without it they raise #UD. Intel’s own documents say where RTM is gone or disabled:

  • Microcode from Intel’s platform update 2021.1 and later disables TSX by default on 6th- to 10th-generation Core processors and the related Xeon E3 and E parts, as listed in Intel’s article: every XBEGIN aborts, CPUID may still report RTM, and CPUID.(EAX=7,ECX=0):EDX[11], RTM_ALWAYS_ABORT, says that this is so.
  • The optimization manual says that the 12th-generation Core processors with P-cores and E-cores keep one instruction set on both kinds of core, and that their E-cores do not support TSX.

AMD’s manual defines no RTM instructions and marks the CPUID bits of RTM and HLE reserved. On this site’s Zen 5, all four cases, with 32- and 16-bit offsets, raised #UD.

In the optimization guide

What the optimization guide says about XBEGIN, a line per claim. Each links to the claim in the guide, with its sources and where they differ.

Haswell and Broadwell

  • Transactional memory: A transaction tracks its data in the 8-way L1 data cache, so writing nine lines of one set aborts it.

Vulnerability mitigations

Mitigations of these processor vulnerabilities use XBEGIN:

Forms

Every encoding of XBEGIN that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
XBEGIN rel16/32 XBEGIN_RELBRzC7 F8 cw/cdRTM

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
Modelrel32
Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake, Sapphire Rapids100 / 0.25p0156

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

if not cpuid_leaf(7, 0)[1] >> 11 & 1:
    fault(UD)                    # CPUID: no RTM
room = rtm_nest < rtm_nest_max
if room and not ldtrk_suspended:
    if rtm_nest == 0:            # the outermost: one starts
        t = low(rip + signed(rel), 64)
                                 # rel16 or rel32, sign-extended; a
                                 # 66 prefix does not cut RIP to 16
                                 # bits here
        if not canonical(t):
            fault(GP, 0)
        fallback = t
        rtm_active = 1           # registers and memory as they are
                                 # now are what an abort restores
    rtm_nest = rtm_nest + 1
else:
    tx_abort(UNDEFINED)          # too deep, or inside a region of
                                 # XSUSLDTRK
# XBEGIN goes on with the next instruction: it is no branch until
# an abort, which needs no ENDBR64 at the fallback address

Run on AMD Zen 5 (EPYC 9645): 4 cases. Its cases ran where CPUID reported no RTM, and every one raised an exception.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
XBEGIN rel16/32
rel16/32explicitread
rIPimplicitread, write
EAXimplicitconditional write

Flags

None: XED records no flag that the forms test or change.

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to XBEGIN, each with the form it compiles to and the Clang options it needs. The forms come from compiling every intrinsic and decoding the result with Intel XED; all intrinsics A–Z explains the method.

IntrinsicCompiles to
_xbegin unsigned int _xbegin(void)

XBEGIN rel16/32 Legacy -mrtm

CPUID and processors

Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.

More RTM instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. Clang's x86 intrinsic headers, LLVM 23.1.2 (commit 85ac56026243): the intrinsics, their signatures and doc comments, and the Clang of that release, which compiled each of them.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2D, page 6-29 (XBEGIN)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  6. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
  7. Intel: Intel Transactional Synchronization Extensions (Intel TSX) Memory and Performance Monitoring Update for Intel Processors (support article 000059422)
  8. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.38, July 2026)

The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The intrinsics and their signatures come from Clang and the timings from LLVM's scheduling models, both part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.