feat(libc): implement nextafter and tgammaf exports #1806
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1806"
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 Prophet069 on 2026-10-08T19:52:57Z.
What
Add the missing
nextafterf,nextafterandtgammaflibc exports. Titles importing these functions currently fail import resolution because their NIDs are absent from the built library.The exports delegate to the matching float/double overloads of
std::nextafterandstd::tgamma, following the existingMath.cppconvention. Each usesextern "C",APS5_VABIand the_nid_postfixnaming mechanism. No fallback values, title-specific behavior or new dependencies are introduced.Add
guest_math_exports, a CTest regression test for neighboring IEEE-754 values, equal arguments, signed zeros, subnormals, NaNs, infinities, gamma values, poles, domain errors and overflow/underflow. Floating-point exception and errno checks follow the host's advertisedmath_errhandlingcapabilities.This PR contains only the three exports, their behavior test and its CMake registration. It is independent of the subsequent local developments.
Tested
Windows x86-64, MinGW-w64 GCC 15.2.0 UCRT, Release, CMake/Ninja. Built the full
libctarget,guest_math_exports_tests,guest_math_testsandnid_patcherfrom this PR's separate worktree, using at most four parallel jobs. Bothguest_math_exportsandguest_mathpassed; individual test durations were 0.12 s and 0.03 s.Patched the freshly built
libc.prxwith the project's NID patcher and independently verified all three PE exports:nextafterf:3m2ro+Di+Cknextafter:h+J60RRlfnktgammaf:B2ZbqV9geCMReviewed ABI declarations: Windows uses the existing System-V
APS5_VABIbridge; Linux uses its native System-V ABI. The implementation and regression test use portable C++20 facilities. Linux compilation and runtime tests were not performed because no usable Linux environment is available on this host; Linux CI validation remains outstanding. No converted title was started for this PR validation.The official
tools/check_conventions.py --base origin/maincheck was run with the planned title and this description supplied through--titleand--body. It passed. The complete three-file diff was reviewed andgit diff --check origin/main...HEADpassed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T05:32:40Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/CMakeLists.txtL44-77core/libs/prx/libc/CMakeLists.txtL48core/libs/prx/libc/CMakeLists.txtL48core/libs/prx/libc/CMakeLists.txtL48core/libs/prx/libc/CMakeLists.txtL48Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:55:38Z.
Closing: no title is shown to reach
nextafterf,nextafterortgammafon main. Reopen with the title ID and the log line where it stops if you find one.Pull request closed