feat(relinker): lower RDPRU and MCOMMIT for --to-intel #1756
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1756"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by jonesy827 on 2026-10-08T18:34:01Z.
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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T05:32:11Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/TechnicalDebt.mdL300-306Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:55:26Z.
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
--to-intel.Pull request closed