fix: remove AVX dependency from SSE x1 implementation#64
Merged
Conversation
The Win64 epilog in sha256_sse_x1.S used vmovdqa (AVX) to restore callee-saved XMM registers while the prolog used movdqa (SSE). This would fault on CPUs with SSE but no AVX. Replace with movdqa to match. Also fix the CPU detection in hashtree.c where the SSE fallback had a duplicate bit_AVX check (dead code), replacing it with bit_SSSE3 which is what the SSE x1 implementation actually requires (pshufb, palignr). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
james-prysm
previously approved these changes
Mar 26, 2026
ce0432e to
e2746cf
Compare
james-prysm
previously approved these changes
Mar 26, 2026
james-prysm
approved these changes
Mar 26, 2026
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.
Summary
vmovdqa(AVX) withmovdqa(SSE) in the XMM register restore ofsha256_sse_x1.S. The prolog already usedmovdqa; the epilog was inconsistent and would fault on CPUs with SSSE3 but no AVX.hashtree.chad a duplicatebit_AVXcheck, making it dead code. Changed tobit_SSSE3, which is the actual minimum requirement for the SSE x1 implementation (pshufb,palignr).🤖 Generated with Claude Code