Skip to content

extract shared x86-64 SIMD nonvolatile XMM save/restore includes#93

Merged
Xor-el merged 1 commit into
masterfrom
enhancements/extract-non-volatile
Jul 6, 2026
Merged

extract shared x86-64 SIMD nonvolatile XMM save/restore includes#93
Xor-el merged 1 commit into
masterfrom
enhancements/extract-non-volatile

Conversation

@Xor-el

@Xor-el Xor-el commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Add SimdNonVolatileSave_x86_64.inc / SimdNonVolatileRestore_x86_64.inc (mirroring CryptoLib) and route every x86-64 SIMD kernel that clobbers xmm6..xmm15 through them (27 kernels: CRC, SHA1/256/512, SHA3/Keccak, Blake2, Blake3, Adler32, Argon2).

The shared save is a fixed 160-byte, legacy-movups block guarded by HASHLIB_SYSV_X64_ABI, so it emits only on the Win64 ABI and is a no-op on Linux/macOS where xmm6..15 are volatile. Per kernel the nonvolatile XMM saves are pulled out of the combined stack frame into the shared block; each GPR/scratch frame is re-sized to reclaim the freed slots (no dead space) while keeping rsp 16-byte aligned, so existing aligned movdqa scratch access is preserved.

Add SimdNonVolatileSave_x86_64.inc / SimdNonVolatileRestore_x86_64.inc
(mirroring CryptoLib) and route every x86-64 SIMD kernel that clobbers
xmm6..xmm15 through them (27 kernels: CRC, SHA1/256/512, SHA3/Keccak,
Blake2, Blake3, Adler32, Argon2).

The shared save is a fixed 160-byte, legacy-movups block guarded by
HASHLIB_SYSV_X64_ABI, so it emits only on the Win64 ABI and is a no-op
on Linux/macOS where xmm6..15 are volatile. Per kernel the nonvolatile
XMM saves are pulled out of the combined stack frame into the shared
block; each GPR/scratch frame is re-sized to reclaim the freed slots
(no dead space) while keeping rsp 16-byte aligned, so existing aligned
movdqa scratch access is preserved.
@Xor-el Xor-el merged commit 68f0424 into master Jul 6, 2026
24 checks passed
@Xor-el Xor-el deleted the enhancements/extract-non-volatile branch July 6, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant