fix(relinker): lower legacy packed reciprocal register instructions #2377
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2377"
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 Scramblrrrr on 2026-10-09T16:50:48Z.
What
--to-intelleaves legacy SSE register forms ofRSQRTPSandRCPPSnative, although it already replaces their VEX.128 equivalents to avoid reciprocal approximation differences. This PR extends the existing lowering to those legacy register forms, including REX-extended registers and equal source/destination operands.The gap is recorded in TechnicalDebt: legacy forms retain the host approximation. The same entry documents why the existing VEX lowering uses division and square root: an approximate reciprocal square root of
1.0can remain below1.0after refinement. This change applies the existing policy to SSE code; it does not reproduce AMD's approximation tables.RSQRTPSSQRTPSthenDIVPSlowering; upper YMM bits preservedRCPPSDIVPSlowering; upper YMM bits preservedFor example, a supported legacy
RSQRTPSwith all input lanes equal to1.0now produces exactly1.0in every lane, through the same arithmetic used for its VEX equivalent.Implementation:
DecodeReciprocal, accept legacy register encodings with an optional REX prefix, and record whether the instruction uses VEX.ReciprocalLoweringand the existing scratch-register spill/restore path. Emit a legacy result move forRCPPS, and avoid the final VEX move for legacyRSQRTPS, so upper YMM bits remain intact.RSQRTPS/RCPPSseparately from their VEX equivalents in conversion diagnostics. Support mixed legacy/VEX sequences through the existing out-of-line sequence builder.The substitution remains optional. Sites shorter than the five-byte jump absorb movable following instructions, or stay native when a jump cannot fit safely. Scalar, memory and 256-bit forms retain their existing behavior. No new dependencies or system-library exports are added.
Tested
Rebased onto upstream
a29ef592190d0450eacbde15ec8e228e379ed753; branch headaeb97f5b1282c5ff4821aa59c2c7d800da2a393e. Windows 11, Ryzen 7 7800X3D, RTX 5070 Ti, Release MinGW GCC 15.2, SPIRV-Tools OFF.The relevant checks (amd64_only_converter and amd64_only_windows) pass in a combined validation checkout containing the independently rebased reciprocal, shared-loop-exit, vertex-fetch-aliasing, table-store, SRT-depth, constant-phi and deferred-specialization topics. All 10 selected CTest cases passed in 2.31 seconds, with Vulkan required for the table-store execution regression. Each public branch contains its own topic only; these are combined-checkout results, not seven separate full builds. Conventions and diff checks pass for each branch.
No fresh game run, visible frame or playable gameplay is claimed for these rebased heads. Earlier reduced-regression and local-title observations motivated the original change; title code and captures remain local. Linux and macOS were not rerun locally for this rebase.
Checklist
a29ef592; one topic per branchGitHub refuses reopening this existing PR with
state cannot be changed. The branch was force-pushed or recreated. The public topic branch above contains the rebased/tested head; this closed PR retains its historical head. No replacement upstream PR was opened because current intake still applies automatically to newly opened PRs.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T16:50:59Z.
Спасибо за ваш интерес к проекту! Извините, сейчас накопилось слишком много открытых PR. Пока мы разбираемся с ними, приём PR от новых участников - авторов, чьих коммитов ещё нет в
main, - временно приостановлен. Поэтому этот PR автоматически закрыт. Это не оценка качества ваших изменений.Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-09T17:17:31Z.
Thank you for your interest in the project! Sorry, there are currently too many open PRs. While we sort them out, accepting PRs from new contributors—authors whose commits haven't yet made it into main—is temporarily suspended. Therefore, this PR is automatically closed. This is not a quality review of your changes.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T13:58:51Z.
Refreshed the public topic branch onto current main
a11c8f7f70: new head363d17985e, codex/legacy-sse-reciprocals. Resolved the matcher conflict by retaining main's Rosetta RDPID optional handling alongside the extended reciprocal decoder; retained the Rosetta technical-debt entry.Fresh standalone Windows Release build: amd64_only_converter + amd64_only_windows, 2/2 pass, 0.61 seconds. Conventions and diff checks pass. No game run or Linux/macOS validation claimed for this topic. This closed PR retains its historical head; the refreshed fork branch is the current cross-test reference. AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T14:08:30Z.
The current tested branch is now submitted as #3601, replacing this historical intake-closed PR. Author commits are now on main; this is the same topic rebased and independently Windows-tested, with main Rosetta behavior retained.
Pull request closed