feat(relinker): lower register-form INSERTQ #185
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/185"
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 ljkx on 2026-09-30T13:22:32Z.
What
Addresses an item from
docs/dev/TechnicalDebt.md:--to-intelfailed the relink on register-form INSERTQ (F2 0F 79). It is now lowered out of line with SSE2 only, following the register-form EXTRQ lowering from #54.No title is currently known to use this form; this removes the listed relink failure.
psrldq 8): length = bits 69:64 (0 means 64), index = bits 77:72, as inSse4aEmulation.hpp.(~0 >> ((64 - length) & 63)) << indexis built from all-ones restricted to the low qword, and the destination is merged asdst ^= ((src << index) ^ dst) & hole.dst[127:64]is zeroed withmovq dst, dst. The APM leaves it undefined, but on Zen 4 hardware both INSERTQ forms and EXTRQ zero it (see Tested). The existing lowerings and the libc emulation keep it; I left them unchanged since that is a separate topic, and can send a follow-up if wanted.MatchSequenceno longer reject the form, so short sites absorb the following instructions the same way register-form EXTRQ does.TechnicalDebt.md: INSERTQ register form is removed from the item. The remaining instructions are rejected by the matcher, so the link now points there.Tested
amd64_only_windows: register-form INSERTQ is executed for every length/index pair with length + index ≤ 64, rotating over the existing register pairs (equal operands and xmm8–xmm15 included), with random bits in the unused control bits. Results are checked against the transcribed reference and againstsse4a::Execute, which decodes the control from the register itself, plus the existing clobber / RFLAGS / rsp / red-zone checks. Runtime went from 13 s to 15 s.amd64_only_converter(x86-64 Linux): the stub is executed with distinct and with equal operands. The matcher test now expects a trampoline named "INSERTQ register form".insertqon all 128 bits of all 16 XMM registers, the status flags and rsp.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository