Repository navigation
feat(libc): implement the __std vectorized algorithm helpers - #6339
Merged
adriadam10 merged 1 commit intoOct 19, 2026
Merged
Conversation
__std_find_trivial(_unsized), __std_count_trivial, __std_min/max/minmax_element, __std_reverse_trivially_swappable, __std_reverse_copy_trivially_copyable and __std_swap_ranges_trivially_swappable_noalias for 1-, 2-, 4- and 8-byte elements, matching the libc.prx bundled with PPSA08427 including the rescan of the first aligned block in the unsized find. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
Progress report (f7a90d6 → 6103a3e)📈 System libraries: 88.8% (+0.1%, +33 implemented functions) ✅ 33 implemented
|
This was referenced Oct 15, 2026
Closed
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
This was referenced Oct 15, 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.
What
Implements the 33 MSVC-STL-style vectorized algorithm helpers that the system
libc.prxexports and AnyPS5 did not have, in a newsrc/VectorAlgorithms.cpp:__std_find_trivial_N,__std_find_trivial_unsized_N,__std_count_trivial_N__std_min_element_N,__std_max_element_N,__std_minmax_element_N((first, last, bool signed); first minimum, first maximum, and for minmax the first minimum and last maximum, returned as two pointers)__std_reverse_trivially_swappable_N,__std_reverse_copy_trivially_copyable_N__std_swap_ranges_trivially_swappable_noalias(declaredvoid, as in MSVC's STL; the console leaves an unrelated value inrax)for N = 1, 2, 4, 8, as scalar loops.
The console's
__std_find_trivial_unsized_Nhas a quirk that is reproduced: when nothing matches betweenfirstand the end of its 32-byte-aligned block, it rescans that whole block without masking, so it can return a match up to 31 bytes beforefirst. Recorded indocs/dev/debt/libc.md.Tested
Linux (CachyOS, GCC Release build, plus a clang
-Wall -Wextrasyntax check): newguest_vector_algorithmstest passes.tools/check_conventions.pypasses;tools/pr_overlap.py --branchreports no line overlap.Differential test against the console: the PPSA08427
libc.prxwas mapped into a Linux process and every helper was run side by side with this implementation on 30,000 random arrays per element size (lengths 0-100, element-aligned start offsets, small value ranges so ties are frequent, both signedness flags), plus 30,000 randomswap_rangescalls; returned pointers, counts and memory agree everywhere.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu