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

RDPID copies the IA32_TSC_AUX MSR into a register: the number that RDTSCP returns in ECX, without the time stamp and without RDTSCP’s wait for earlier instructions. The operating system decides what the MSR holds; Linux writes the CPU number into its low 12 bits and the NUMA node above them, and its vDSO answers getcpu() with RDPID where the processor has it. With -mrdpid, or an -march such as icelake-client, goldmont-plus or znver2, GCC 14 and Clang 23 at -O2 compile _rdpid_u32() & 0xfff to rdpid rax and an AND; x86-64-v4 and skylake lack it.

The answer may be stale at once

Nothing stops the scheduler from moving the thread right after RDPID, so the number says where the thread was, not where it is. That is enough to pick a per-CPU shard of a counter or an allocator cache, where a wrong guess costs only contention, as long as the shard itself is updated atomically. It is not enough to touch per-CPU data without atomics.

Operand size

The destination is the full 64-bit register in 64-bit mode and a 32-bit one elsewhere; the MSR’s 32 bits are zero-extended. Operand size prefixes do not change that: on Zen 5, rdpid rdx with a 66 prefix still wrote all of RDX, and on CPU 0, where the probe pins itself, it returned 0. The encoding, F3 0F C7 /7 with a register operand, is RDSEED’s with an F3 prefix.

Who may run it

CR4.TSD, which can forbid RDTSC and RDTSCP outside ring 0, does not affect RDPID; AMD’s manual names that as its purpose, reading the number where the operating system has disabled RDTSCP for user code. Under Intel’s VMX, RDPID follows RDTSCP’s “enable RDTSCP” control and raises #UD in a guest without it (volume 3).

The manuals disagree on the flags. Intel’s says RDPID changes none, and XED records none; AMD’s text says none too, but its flag table marks CF as modified. AMD’s Zen 5 guide lists RDPID as microcoded. The CPUID bit is leaf 07H, ECX bit 22, the same for both vendors.

In the optimization guide

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

Silvermont to Goldmont Plus

Forms

Every encoding of RDPID that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
RDPID r32 not in 64-bit mode RDPID_GPR32u32F3 0F C7 /7RDPID
RDPID r64 64-bit mode only RDPID_GPR64u64F3 0F C7 /7RDPID

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.
Modelr64
Ice Lake100 / 0.25p0156
Alder Lake, Sapphire Rapids100 / 1p1
Zen 2100 / 0.25
Zen 3, Zen 4100 / 25ALU0 ALU1 ALU2 ALU3

Operation

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

dest.write(tsc_aux)              # TSC_AUX's 32 bits, the OS's; in
                                 # 64-bit mode RDPID r64, zero-extended
# 66 and REX.W change nothing: with 66, Zen 5 still writes the 64-bit
# register. CR4.TSD does not stop it, so that a program can read the
# number where the OS keeps RDTSCP from it

Run on AMD Zen 5 (EPYC 9645): 3 cases. The forms that 64-bit mode lacks were not run: the probe runs in 64-bit mode.

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
RDPID r32 not in 64-bit mode RDPID r64 64-bit mode only
r32/64explicitwrite
IA32_TSC_AUXimplicitread

Flags

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

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to RDPID, 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
_rdpid_u32 unsigned int _rdpid_u32(void)

RDPID r64 Legacy -mrdpid

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.

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. 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.
  4. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-548 (RDPID)
  6. Linux arch/x86/include/asm/segment.h: the CPU and node number in IA32_TSC_AUX
  7. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (325384-093, September 2026)
  8. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  9. Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP

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.