Repository navigation
Conversation
RDPRU reads the host time-stamp counter and returns zero for unsupported ECX values, MCOMMIT runs as SFENCE with rFLAGS.CF forced to one. Semantics from the AMD APM (24594, Rev 3.38, RDPRU and MCOMMIT sections) and LLVM's RDPRU definition; remaining deltas are recorded in the technical debt.
This was referenced Oct 9, 2026
Collaborator
|
Closing: no title is known to reach RDPRU or MCOMMIT, and the lowering isn't exact (TSC instead of MPERF/APERF). Reopen when a title stops on one of them under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
--to-intellowers the two remaining AMD-only system instructions instead of failing the relink:0F 01 FD) reads the host time-stamp counter and returns zero for unsupported ECX values, with every rFLAGS bit preserved (RdpruLowering.cpp).F3 0F 01 FA) runs as SFENCE with CF set to one and OF, SF, ZF, AF and PF cleared (McommitLowering.cpp).mcommitbefore a conditional branch) fails the relink. Prefixed forms (66, F2, F3 on RDPRU; LOCK, 66, F2 on MCOMMIT and other0F 01 FAforms) are reported as unsupported; other prefixed0F 01 FAforms report as MONITORX.Sources: RDPRU and MCOMMIT sections of the AMD64 Architecture Programmer's Manual Volume 3 (24594, Rev 3.38, July 2026); MCOMMIT's SFENCE ordering and rFLAGS table, RDPRU's ECX register selection and zero result for unsupported values. LLVM's
RDPRUdefinition (Uses=[ECX],Defs=[EAX,EDX], no EFLAGS) agrees. The APM rFLAGS table for RDPRU shows the arithmetic flags cleared and CF modified, but RDPRU measured on hardware leaves every flag unchanged, so the stub preserves the flags and the difference is recorded in the technical debt with the measurement. The remaining deltas (TSC values instead of MPERF/MAPERF, no host mechanism for MCOMMIT's delayed store errors, unmeasured prefixed forms) are recorded in TechnicalDebt.md.Tested
Arch Linux, Ryzen 9 5900XT (Zen 3). Relinker-only build, Release and Debug configurations: full
ctestsuite (38/38), including new converter, matcher, golden-encoding and hardware-execution tests (the RDPRU stub runs against the host RDTSC; flag preservation, unsupported-ECX zeroing, ECX preservation, upper-half zeroing and red-zone sentinels are checked on real execution; golden stub bytes verified against GNU as).tools/check_conventions.py --base origin/mainpasses. No title run: no title in the compatibility list is known to use RDPRU or MCOMMIT.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)