Repository navigation
fix(libc): retain finite scaled hyperbolic results - #2050
Closed
STUPIDCONTEM wants to merge 1 commit into
Closed
STUPIDCONTEM wants to merge 1 commit into
STUPIDCONTEM wants to merge 1 commit into
Conversation
MarcZX10
approved these changes
Oct 9, 2026
MarcZX10
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the full diff and the referenced Microsoft CRT behavior. The implementation keeps the scale-before-narrowing behavior, handles the documented special cases, and adds direct regression coverage for finite results, signed zero, errno, and overflow. I built the exact head on Linux with GCC 12; guest_scaled_hyperbolic passed (1/1). Conventions and diff checks pass. Upstream Build, Conventions, and Progress workflows are still action_required, so they have not run on this PR.
9 tasks done
9 tasks done
12 tasks done
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.
Evidence review (2026-10-09)
Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness.
Game/title ID: none verified. No PS5 title execution is claimed.
What
_FSinhand_FCoshevaluated the unscaled float hyperbolic function before multiplication, so representable scaled results overflowed. For example,_FSinh(100.0f, 0x1p-40f)returned infinity instead of a finite result near1.22e31.Evaluate finite intermediates in double and narrow only after scaling. Handle zero, NaN and infinite arguments explicitly according to the scaled CRT routines, including signed-zero behavior, and report ERANGE for actual final float overflow. Tiny products that round to zero preserve errno.
Semantics are sourced from Microsoft's primary CRT implementations xsinh.cpp, _FSinh and xcosh.cpp, _FCosh, whose stated scale domain is
|y| <= 1. No implementation code or polynomial tables were copied. PS5 hardware behavior has not been measured.Tested
Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT/posix/SEH r7, Ninja Release, BUILD_TESTING=ON, SPIRV-Tools disabled. Independent branch from
f145139676a48306681d3a4d5fabf83938759daf. Open #1844 adds ordinary libm test coverage without changing these implementations; this regression has a separate test file and target.guest_scaled_hyperbolicbuilt and run against unchanged upstream: failed finite scaled-result, errno, and special-value assertions.libsbuilds passed.Linux and PS5 hardware/titles were not run. Tests use the default floating-point rounding mode; alternate rounding modes were not validated.
Checklist
main; no other open PR implements the same change (historical base; current readiness not asserted)