feat(libc): implement _LCosh and _LSinh #10742
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10742"
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 00xDisaster on 2026-10-24T20:25:49Z.
What
Add
_LCoshand_LSinh, the long-double Dinkumware helpersy * cosh(x)andy * sinh(x). The finite large-input path scales throughfrexp/scalbnand an ln2 split, preserving signed zero and the non-finite behavior of the existing_Cosh/_Sinhhelpers. The public Dinkumwareymath.hconfirms the two-argument signatures. Exact console results, range-error thresholds and floating-point exception behavior remain unverified and are recorded in the libc debt entry.Following #10706, the canonical declarations are in
core/libs/prx/libc/include/Api.hpp; this PR no longer adds localextern "C"declarations. It changes four files:Api.hpp,Math.cpp,GuestMath.cppand the libc debt entry.Tested
Linux CachyOS 7.3.0-2-cachyos, GCC 16.2.1. Base
upstream/main5b5d24cb22; headf4d5420b4b.oneandonlydean merged current
mainafter #9668 addedCheckAcosfMsun; main's independent check and this PR'sCheckLongDoubleHyperbolicare both preserved, and the implementation and tests are otherwise unchanged.cmake --build build --target guest_math_tests guest_math_exact_tests --parallel 2: passed.ctest --test-dir build -R '^guest_math(_exact)?$' --output-on-failure: 2/2 passed in 0.04 s.guest_mathcovers known values, signs, signed zero, infinities/NaN and scaled large-finite inputs for both helpers.guest_math_exactis the neighboring long-double suite and passes unchanged.tools/check_conventions.py --base upstream/main --head HEADandgit diff --check: clean.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T20:34:03Z.
Review: APPROVED
Reviewed exact head
59d3e69221fb7dc593176205796b7709749ef38c. The scaled finite-input paths in_LCoshand_LSinhpreserve the sign behavior around zero and avoid overflowing the intermediate hyperbolic value for the large finite vectors covered by the new test. I compiled the changedMath.cpp,GuestMath.cpp, andGuestLibc.cpptranslation units with GCC 12.2, then linked and ran a small harness against the PR implementations for representative finite inputs, signed zero, infinities, NaN, and the reported 11357/11360 large-input vectors; all passed. This is a focused local check, not the full project build or CTest suite. The PR reports the Linuxguest_mathandguest_math_exacttests passing under GCC 16, and hosted Linux, Windows relinker, ASan, conventions, and policy checks pass. macOS relinker/register-context/write-watch jobs are still pending; the hosted Linux and Windows product jobs are skipped. Exact console thresholds and floating-point exception behavior remain explicitly unverified in the PR description, so this approval covers the implemented helper behavior and available evidence, not those console-specific details.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T22:58:05Z.
Review: APPROVED
Reviewed exact rebased head
11ef50d50285c7b7d32946bc5739ea899d9a7286against currentmainf26434afa36e58778a9ff4b948aea52dff19eb0c. The rebase moves the two declarations into libc's canonicalApi.hpp; the implementation, boundary vectors, and debt statement remain focused and consistent. I compiled the exactMath.cpptranslation unit with GCC 12.2 under-Wall -Wextra -Werror, then linked and ran a focused harness against that object for ordinary signed values, infinities, signed zero, and the large scaled inputs; it passed.git diff --checkpassed. The refreshed hosted relinker matrix, ASan, conventions, eligibility, labels, and other applicable checks pass. Hosted Linux and Windows product jobs are skipped by path policy; the author reportsguest_mathandguest_math_exactpassing 2/2 after the rebase. The console-specific thresholds and floating-point exception behavior remain explicitly unverified as recorded in the PR. I found no blocker in the current diff.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T04:22:24Z.
Review: APPROVED
Re-reviewed exact head
e0547ee7c53024d41d75217e0f61380174c8a4cc. Compared with the previous reviewed head, the implementation and tests are unchanged; the rebase only reconciles the libc debt entry with the new_FSinh/_FCoshevidence on main. I compiled the exactMath.cppand ran a focused host harness covering normal values, signs, signed zero, NaN/infinity, large finite scaling, and overflow for both functions; it passed. The hosted conventions, eligibility, labels, Linux/Windows/macOS relinker matrix, ASan, register-context and write-watch checks pass. Product Linux/Windows test jobs are skipped by workflow policy. Console-specific results and exception behavior remain explicitly documented as unverified.