fix(relinker): zero dst[127:64] in EXTRQ and INSERTQ lowerings #433
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/433"
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 adriadam10 on 2026-10-03T06:22:04Z.
What
The
--to-intelEXTRQ/INSERTQ lowerings kept the olddst[127:64]. Hardware zeroes it.movq dst, dstfor that reason. KytyPS5 does the same in its EXTRQ trampolines (KytyPS5/KytyPS5#839).extrq xmm0, xmm1 ; insertq xmm14, xmm0, the stub produced a different low qword inxmm14than the hardware does.Fix:
movq dst, dst.dst == srcand index 0, EXTRQ with length 64 and index 0) now emitmovq dst, dst.movqin a 6-7 byte site, so those sites now take a stub.Tested
Linux x86-64 (Ryzen 5 7535HS, Zen 3+, has SSE4a), no title.
Amd64OnlyConverterTests.cpp:immediateFormExecution: runs EXTRQ, INSERTQ and INSERTQ with equal operands for 9 length/index pairs, covering every in-place form and every stub path. It checks the low qword against the reference anddst[127:64] == 0, starting from a non-zero high qword.registerFormExecution: the EXTRQ cases also check the high qword now.main. Negative checks: removing each of the threemovqin the stubs, or either of the two in-placemovq, makes the test fail again.MatchSequence. 313 420 runs:main: 15-17k mismatches per SSE4a form (dst[127:64]), plus 1 511 sequence runs with a wrong low qword.ctest: 125/125.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (n/a).mdfiles or images added to the repository (attach them to this PR)