Repository navigation
perf: SIMD support for ARM - #14
Merged
Merged
Conversation
This uses NEON instructions for ___cpc_find_first_of, the logic is mostly equivalent to the SSE2 one. With the difference that NEON doesn't have a movemask instruction so we use a loop to inspect results.
steve-chavez
commented
Oct 18, 2026
Comment on lines
+532
to
+537
| // Unlike SSE2, NEON has no movemask instruction, so inspect the matching lanes | ||
| // after the vector comparisons identify a block containing a stop byte. | ||
| uint8_t match_lanes[simd_width]; | ||
| vst1q_u8(match_lanes, match); | ||
| for (size_t lane = 0; lane < simd_width; ++lane) | ||
| if (match_lanes[lane] != 0) return i + lane; |
Member
Author
There was a problem hiding this comment.
I'm not seeing the same gains in performance as SSE2 on CI results. This may be related to this loop, right now I'm unsure how to optimize it so I'll leave it as TODO.
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.
This uses NEON instructions for ___cpc_find_first_of, the logic is mostly equivalent to the SSE2 one. With the difference that NEON doesn't have a movemask instruction so we use a loop to inspect results.