Repository navigation
feat(libc): implement extended-precision math exports - #2271
Closed
obojeoboje wants to merge 2 commits into
Closed
obojeoboje wants to merge 2 commits into
obojeoboje wants to merge 2 commits into
Conversation
9 tasks done
This was referenced Oct 9, 2026
Collaborator
|
Closing: none of these 43 functions is shown to be reached by a title on main; the list comes from the aerolib table, and library functions go in when a title needs them. Reopen with the title ID and the log line where it stops if you find one. |
9 tasks done
ycbuzi
pushed a commit
to ycbuzi/AnyPS5
that referenced
this pull request
Oct 10, 2026
…and neighbor exceptions Harvested from upstream (closed unmerged); library completion 2733/3151 -> 2776/3194. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011krDVCnnMQPaEFEqCDnKmA
Contributor
|
@obojeoboje PokeMMO (PPSA98001) now stops at |
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.
What
Add 43 missing libc
long doublemath exports in a dedicated translation unit, preserving the guest x87 extended format rather than narrowing inputs, outputs or pointer results todouble.Trigonometric and hyperbolic:
acosl,asinl,atanl,atan2l,tanl,acoshl,asinhl,atanhl,coshl,sinhl,tanhl.Exponentials, logarithms and roots:
expl,exp2l,expm1l,log10l,log1pl,log2l,logbl,sqrtl,cbrtl,hypotl.Arithmetic and rounding:
fabsl,copysignl,fdiml,fmaxl,fminl,fmal,ceill,floorl,roundl,lroundl,llroundl,nearbyintl.Remainders, neighbors and decomposition:
fmodl,remainderl,remquol,nextafterl,nexttowardl,frexpl,ldexpl,modfl,scalbnl,scalblnl.Guest
lroundlreturns 64 bits on Windows through the hostllroundoverload.scalblnlaccepts a 64-bit guest exponent and bounds it before using the native int-exponent operation, avoiding Windowslongtruncation. Bounds exceed the entire representable x87 exponent range.Normalize native runtime differences found by the tests: signed-zero fractional results for infinite
modflinputs; domain/pole exception flags and errno foracoshl,atanhlandsqrtl; and missing overflow/zero-underflow flags for finite exponential/hyperbolic inputs. Preserve FreeBSD signed-zero ordering forfmaxl/fminl, and normalize neighbor-operation underflow/overflow flags andERANGE. Use-frounding-mathonly for the new implementation and test translation units.Contracts and signatures follow FreeBSD fmax(3), math(3), modf(3), and ldexp(3). All 43 export names are present in the shadPS4 aerolib table. Transcendental results use native extended-precision math; bit-identical results across host runtimes are not claimed.
Checked open PR descriptions and the relevant libc patches in #2193, #2213, #2166, #2167, #2173, #2192 and #2037. This branch excludes their functions and the rounding exports in #2235. Shared CMake insertion points may need both independent source/test additions preserved when rebasing.
The progress scanner changes from 2578/3044 (84.69%) to 2621/3087 (84.90%). Both counts grow because these are newly declared exports.
Tested
Windows, WinLibs GCC 15.2, Release with testing enabled: full default build and
libstarget passed.Full CTest run, four workers, 30-second per-test limit: 507 passed, one skipped (
guest_video_out_wqhd_detection_no_vulkan), zero failures; 39.68 seconds total on the final head91f4371b.New runtime fixture exercises all 43 exports using fixed numerical expectations, extended precision beyond double, exponents beyond the double range, subnormal decomposition/scaling, all four rounding modes, signed zero, NaNs/infinities, exception flags, fused rounding, quotient bits and 64-bit integer boundaries/exponents.
Linux, Ubuntu 24.04 under WSL, GCC 13.3: built
ExtendedMath.cppas a separate optimized shared library and linked/ran the same complete fixture with UndefinedBehaviorSanitizer successfully on the final head91f4371b. This was a focused runtime check, not a full Linux project build or NID-patched library run.Test registration, conventions and whitespace checks passed. No game tested.
Full Linux/Windows Build and the relinker matrix still require a collaborator to dispatch the workflow for this PR head.
Checklist
Based on current
main; no other open PR implements the same functionsOne topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (
NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebtNo notes, investigation
.mdfiles or images added to the repository (attach them to this PR)New third-party code is a submodule built from source: none added
Generic behaviour, not specific to one title
Depends on: none
AI-assisted: yes