Unify x86/x86-64 ABI handling in SIMD prologues and CPU-feature probes#69
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralizes the x86-64 ABI decision behind a single
HASHLIB_SYSV_X64_ABIdefine, deduplicates non-volatile register save/restore across SIMD
assembly bodies, trims branches not reachable in practice, and tightens
the CPU-feature probe shim. No algorithmic changes.
Key changes
HashLib.incdefinesHASHLIB_SYSV_X64_ABIwhenHASHLIB_X86_64 AND NOT HASHLIB_MSWINDOWS.All SIMD prologues and CPU-feature shims now gate SysV remapping on
this symbol, decoupling ABI from compiler vendor and fixing the
previously-broken assumption that "non-Windows ⇒ FPC."
SimdProc{1..6}Begin_x86_64.inccollapse their nested{$IFDEF FPC}/
{$IFDEF MSWINDOWS}structure to two flat axes (frame directive,ABI). MS-ABI stack-load lines in files 5 and 6 are now written once.
SimdProc{1..6}Begin_i386.inccollapse the identical FPC andDelphi-Win32 branches (files 1–3) and drop dead Delphi-non-Windows
branches (files 4–6).
Keccak, SHA-NI) now save/restore XMM6+, RDI, RSI unconditionally
rather than under
{$IFDEF MSWINDOWS}. Comments updated accordingly.this is defensive (i386 has no caller-saved XMM contract).
CpuIdQuery.inc/XGetBvQuery.incswitch toHASHLIB_SYSV_X64_ABI,rewrite the IA-32 entry-state comments to show registers at entry
rather than mid-shuffle, and gain inline ABI-normalization comments.
TX86SimdFeatures:TCpuIdResultmoved to implementation-sectiontype;
CpuIdQuery/XGetBvQueryforward declarations take typedoutparameters instead ofPointer; six identical kill-blocks inApplyBuildOverridesfactored intoDisableAllExtraFeatures.Blake3_HashMany_Scalarcomment reworded — the routine is correct onany little-endian target, not specifically x86.
What didn't change
TX86SimdFeatures.