Skip to content

Optional SIMD strchrnul #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2025
Merged

Optional SIMD strchrnul #594

merged 2 commits into from
Jul 17, 2025

Conversation

ncruces
Copy link
Contributor

@ncruces ncruces commented Jul 11, 2025

Continuing #580. strchrnul is used by strchr, strcspn and many other places in libc. The implementation is a matchup between strlen and memchr.

@ncruces
Copy link
Contributor Author

ncruces commented Jul 15, 2025

The test for memchr needed a fix: the unsigned to signed pos < length + 2 comparison meant that, depending on compile flags, the inner loop might not run.

@abrown abrown merged commit 4525255 into WebAssembly:main Jul 17, 2025
17 checks passed
ncruces added a commit to ncruces/wasi-libc that referenced this pull request Jul 18, 2025
Continuing WebAssembly#580. `strchrnul` is used by `strchr`, `strcspn` and many
other places in libc. The implementation is a matchup between `strlen`
and `memchr`.
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.

2 participants