feat(relinker): lower SHA-1 instructions for --to-intel #430
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/430"
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-03T05:40:53Z.
What
Addresses the SHA-1 part of the
--to-intelitem indocs/dev/TechnicalDebt.md. SHA1RNDS4, SHA1NEXTE, SHA1MSG1 and SHA1MSG2 were passed through unchanged, so a relinked title that executes them dies with an illegal instruction on Intel CPUs without SHA-NI (Haswell to Comet Lake). This is the follow-up announced in #200. No title is currently known to use them.imm8[1:0]) are lowered out of line inSha1Lowering, next toSha256Lowering, through the sharedStubBodyBuilder. Only SSE2 is used (pshufd,shufpd, dword/byte shifts,padddwith a RIP-relative round constant), so upper YMM halves, RFLAGS and the general-purpose registers are untouched.rol(W16, 1)into lane 0 for W19.MatchSequencenow accepts SHA-1 next to SSE4a, SHA-256 and CLZERO; other following instructions are copied after the body as before.DecodedInstruction::IsSha1(0F 38 C8/C9/CA,0F 3A CC, no 66/F2/F3 prefix) andDecodeSha1.TechnicalDebt.md: the item now names only the SHA-1/SHA-256 memory forms and RDPRU/MCOMMIT.Tested
libs,ctest125/125.amd64_only_converter:nop, failure before aret, and the file offset of the memory-form failure.shufpdimmediate, SHA1MSG2 without the W19 fold, SHA1MSG2 shift, and a missing restore (crash)._mm_sha1rnds4_epu32(all four functions),_mm_sha1nexte_epu32,_mm_sha1msg1_epu32and_mm_sha1msg2_epu32on 100,000 random inputs each (700,000 results).MatchSequence× 100 images: 379,200 runs, 0 mismatches. A wrong K2 gives 3,050 mismatches in the same harness.amd64_only_windowsis not extended here.Overlap: no open PR touches SHA-1. The
TechnicalDebt.mdline sits next to the executable-icon line that #350 removes, so whichever lands second needs a trivial rebase.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (memory forms throw).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-03T06:35:23Z.
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.mdL57-58