Repository navigation
feat(libc): implement _LCosh and _LSinh - #10742
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 59d3e69221fb7dc593176205796b7709749ef38c. The scaled finite-input paths in _LCosh and _LSinh preserve 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 changed Math.cpp, GuestMath.cpp, and GuestLibc.cpp translation 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 Linux guest_math and guest_math_exact tests 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.
|
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.
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.
|
|
@adriadam10 all checks are green and this PR is |
59d3e69 to
11ef50d
Compare
|
Rebased onto current main after #10706 ( |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact rebased head 11ef50d50285c7b7d32946bc5739ea899d9a7286 against current main f26434afa36e58778a9ff4b948aea52dff19eb0c. The rebase moves the two declarations into libc's canonical Api.hpp; the implementation, boundary vectors, and debt statement remain focused and consistent. I compiled the exact Math.cpp translation 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 --check passed. 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 reports guest_math and guest_math_exact passing 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.
|
@boykopovar #10742 is approved at |
Add the long-double siblings of _Cosh and _Sinh with the same scaled finite-input path, signed-zero handling and Dinkumware two-argument contracts. The reductions use a long-double ln2 split, and the scaled-range tests pin 64-bit results instead of the intermediate writer's output. Cover known values, signs and non-finite inputs in guest_math; record the unverified console results and exception behavior in the libc debt list.
11ef50d to
e0547ee
Compare
|
@MarcZX10 I rebased this onto current main |
MarcZX10
left a comment
There was a problem hiding this comment.
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/_FCosh evidence on main. I compiled the exact Math.cpp and 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.
|
Windows run of this head
AI-assisted: yes (Claude Code) |
|
@00xDisaster this conflicted with |
|
@MarcZX10 oneandonlydean merged current I reran |
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)