Skip to content

RDTSCP

Architecture referenceFeex

RDTSCP reads the x86 time-stamp counter and an auxiliary processor identifier value with defined ordering properties. It is not a fully serializing instruction or an automatic benchmark harness.

What you need to know

RDTSCP reads the x86 time-stamp counter and an auxiliary processor identifier value with defined ordering properties. It is not a fully serializing instruction or an automatic benchmark harness.

How it works

RDTSCP returns the counter in EDX:EAX and the IA32_TSC_AUX value in ECX. Its ordering rules constrain some prior operations, but later instructions may begin before the read completes, and prior stores have additional visibility considerations. The correct fence sequence depends on what the measurement intends to bound.

Where it is useful

Low-level timing code can use the auxiliary value to help detect a processor change when the OS configures it appropriately. A robust benchmark still controls compilation, workload warmup, interrupts, scheduling, counter calibration and the operations being ordered.

How to check support and enablement

CPUID.80000001H:EDX bit 27 enumerates RDTSCP. Verify counter policy in the actual OS or hypervisor and use a documented timing method with the required fences. Prefer the OS monotonic clock for application elapsed time.

Choose a clock according to the question: elapsed time, thread CPU time and cycles are different measurements. The operating system's clock interfaces incorporate platform policy that a raw instruction sample may bypass.

What the feature does not establish

RDTSCP support does not establish invariant or synchronized TSC behavior. The auxiliary value's interpretation is OS-defined. Subtracting two samples without understanding ordering can measure a different interval than intended.

Compatibility and performance in practice

A benchmark also needs correct compiler boundaries, warmup, representative data and an understanding of migration and scheduling. Repeating a poorly ordered measurement does not make it accurate. Report the environment and uncertainty with any result.

A practical verification checklist

  1. Record the exact processor or platform model and the application, OS and runtime versions involved. Preserve the wording of the actual error or requirement.
  2. Check the manufacturer reference for that exact model, then inspect the effective capability and enabled state in the environment where the program runs.
  3. Compare every requirement of the selected binary or backend. A similarly named feature, alias or broad technology label is not enough.
  4. Confirm the application selected the intended implementation. Use its documented diagnostics and a supported fallback when requirements are not met.
  5. Make one supported change at a time and repeat the same workload. Keep the original configuration and recovery path available.

If the feature is listed but software cannot use it

Start with the exact failing component. A hardware database describes recorded capability; the operating system or hypervisor can expose a different effective environment. An illegal-instruction error also needs investigation of the actual faulting instruction and binary build, because corruption or an unrelated unsupported instruction can produce a similar symptom.

Install the application, driver or runtime version supported for the exact platform, and use the vendor's documented baseline or fallback build if needed. A software update cannot create an instruction that the processor lacks. Firmware and security-policy changes should follow the system manufacturer's procedure and a recovery plan rather than a generic optimization recipe.

Sources and scope of this explanation

Intel 64 and IA-32 Architectures Software Developer's Manual

These references establish architectural behavior and software requirements. They do not independently verify every feature value on a linked hardware model page. For model support, use that page's manufacturer evidence and check the effective system configuration. This article does not supply a benchmark, certification or independent review date.

Sources and verification

Editorial ownership: Feex. No independent review date is recorded. How we research.

Report a correction to Feex

Was this article useful?

A yes or no is enough. Pick a reason if you want, or add a short note.

Was this article useful?