feat(libcinternal): implement float and double min/max vector helpers #15581
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15581"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ashwin280802 on 2026-11-03T20:09:47Z.
What
Implements the 12 float and double
__std_min*/__std_max*/__std_minmax*vector helpers of libSceLibcInternal (value forms and element forms) and removes them from the recovered inventory. The integer variants are still throwing stubs and will follow in a separate PR.Source: the scalar paths of Microsoft STL
vector_algorithms.cppate1ed302683:<, the first equal element wins, for the minimum, the maximum andminmaxalike.minmax_elementreturns the last largest (<=).bool(L3666-L3674).No console measurement and no Sony build was checked.
Deliberate divergences and unknowns, recorded in
docs/dev/debt/libSceLibcInternal.md:_mm_min_ps/_mm_max_ps, so their result for a NaN depends on lane order, length and CPU, and the STL defines no NaN handling.+0.0and-0.0returns the scalar-path result; Sony's vector path may return the other zero or a different tie index.firstfor an empty range, including two null pointers, and throw for the other invalid ranges.Open-PR overlap: the comparison finds no other open PR that exports any of these 12 names. #15460, #15577 and #15657 edit the same inventory, header and debt entry for other exports, and #13782, #15822, #15931, #16005, #16343, #16356 and #16434 touch the same CMake list, so expect textual conflicts in the libSceLibcInternal
CMakeLists.txtand debt file. The comparison could not be completed for #5021, #13778, #13881, #14212, #14834 and #16004 because they conflict withmain; I have not compared them.Tested
At 7eb3c06a2c (this patch before the last rebase onto
main) on Windows 11 with MinGW GCC,ctest --test-dir build-full -R ^guest_libc_internal_vector_algorithms$ --output-on-failure:python3 tools/check_conventions.py --base origin/main: no violations.I changed 20 conditions and statements in the new code one at a time and the test failed on all 20.
On Linux (Docker, lavapipe, at 7eb3c06a2c):
Other tests failed on this machine in code this change does not touch and are not investigated here. Windows:
select_tests_MissingCommandTests,vulkan_validation_gate_commandsandagc_driver_direct_write_completion. Linux:guest_mmap_executableaborts atGuestMemory.cpp:3576. I did not run these onmainfor this change.Not verified: behaviour on a console; the tests named above on
main.Not covered by a test: none.
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