Commit Graph
170 Commits
Author SHA1 Message Date
Dean bf77a9e9cb Merge pull request #10742 from 00xDisaster/feat/libc-lcosh
feat(libc): implement _LCosh and _LSinh
2026-10-27 02:28:15 +13:00
Dean cbee224804 Merge pull request #10316 from JJenkx/windows/libc-tanh-msun
fix(libc): compute tanh with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-26 21:48:43 +13:00
Dean Galvin 42a75519e3 Merge branch 'main' into windows/libc-tanh-msun 2026-10-26 18:37:39 +13:00
Dean Galvin 7461106f53 Merge branch 'main' into fix/libc-acoshf-domain-fenv 2026-10-26 17:40:43 +13:00
JJenkxandClaude Opus 5.5 ca1b62a3bd fix(libc): compute tanh with FreeBSD msun's algorithm, as titles' libc.prx does
tanh returned the host's tanh, whose last bit differs from the titles' copy
on Windows. The titles' copy is FreeBSD msun's s_tanh.c over msun's expm1,
and it sets no errno. tanh now computes that algorithm over this file's
Expm1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:26:16 -04:00
JJenkxandClaude Opus 5.5 f91f0450b5 fix(libc): quiet signalling NaNs in trunc, ceil, floor and nearbyint as titles' libc.prx does
trunc, ceil, floor and nearbyint and their float forms returned the
host's result, which on Windows passes a signalling NaN through
unchanged. The titles' copies follow FreeBSD msun, which returns x + x
for a NaN, so the NaN comes back quieted with its payload and sign; these
functions now do the same before calling the host for other arguments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:26:12 -04:00
JJenkx 60f3dcc5db test(libc): check acoshf domain errno and exception flags 2026-10-25 22:06:00 -04:00
Dean 732ab06f41 Merge pull request #10354 from JJenkx/windows/libc-nextafter-msun
fix(libc): compute nextafter and nextafterf with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-26 14:30:57 +13:00
Dean Galvin f4d5420b4b Merge branch 'main' into feat/libc-lcosh 2026-10-26 12:28:05 +13:00
Adrià 710cf9c035 Merge pull request #9668 from rooklz/fix/libc-acosf-msun
fix(libc): compute acosf with FreeBSD msun's algorithm, as the console's libc.prx does
2026-10-26 00:14:55 +01:00
JJenkx 2fc4ca2fd0 test(libc): reject host log fallback in large acoshf inputs 2026-10-25 07:53:43 -04:00
JJenkx 0e895b55be test(libc): cover acoshf positive results across rounding modes 2026-10-25 07:53:11 -04:00
Dean Galvin 80fea7b598 Merge branch 'main' into pr10354 2026-10-25 23:26:47 +13:00
JJenkxandClaude Opus 5.5 185098a39d fix(libc): compute log1p with FreeBSD msun's algorithm, as titles' libc.prx does
log1p returned the host's log1p, whose last bit differs from the titles'
copy on Windows on 24,477,433 of 320 million random arguments. The titles'
copy is FreeBSD msun's s_log1p.c, and it sets EDOM at msun's NaN return,
for arguments below -1, -inf and negative NaNs, but not for log1p(-1).
log1p now computes that algorithm and sets EDOM there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 02:56:59 -04:00
Disaster e0547ee7c5 feat(libc): implement _LCosh and _LSinh
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.
2026-10-25 04:16:26 +03:00
Dean Galvin 83b63bfbb5 Merge main into windows/libc-exp2f-msun 2026-10-25 12:09:10 +13:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Dean 9018bc438a Merge pull request #10003 from MarcZX10/codex/libc-acoshf-msun
fix(libc): follow msun for acoshf
2026-10-25 00:24:44 +13:00
Dean e9a551d6f4 Merge pull request #9857 from JJenkx/windows/libc-trigf-msun
fix(libc): compute sinf, cosf, tanf and sincosf with FreeBSD msun's algorithms, as titles' libc.prx does
2026-10-24 22:12:11 +13:00
JJenkxandClaude Opus 5.5 e7d3411eea fix(libc): compute nextafter and nextafterf with FreeBSD msun's algorithm, as titles' libc.prx does
nextafter and nextafterf returned the host's functions. On Windows they
set ERANGE for a step from zero to the smallest subnormal, which the
titles' copies do not, and pick a different NaN when both arguments are
NaNs. The titles' copies are FreeBSD msun's s_nextafter.c and
s_nextafterf.c with ERANGE at msun's overflow and underflow returns; both
functions now compute that, choosing the NaN explicitly so the compiler
cannot reorder msun's x + y.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 03:23:18 -04:00
JJenkxandClaude Opus 5.5 7488308bb9 Merge main into PR #9844
Additive conflicts with main's newer libc math changes: the debt list keeps
both sides' entries (per entry), the GuestMath.cpp test functions and calls
from both sides are kept, and Math.cpp keeps both sides' independent changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 03:19:24 -04:00
Dean Galvin c3a9a613c7 Merge main into codex/libc-acoshf-msun 2026-10-24 20:00:35 +13:00
JJenkxandClaude Opus 5.5 99abd2604d fix(libc): compute expm1 with FreeBSD msun's algorithm, as titles' libc.prx does
expm1 returned the host's expm1, whose last bit differs from the titles'
copy on Windows on 35,152,346 of 320 million random arguments. The titles'
copy is FreeBSD msun's s_expm1.c, and it sets ERANGE only when a finite
argument overflows to infinity. expm1 now computes that algorithm and sets
ERANGE there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 00:43:08 -04:00
Dean d7f0c005a9 Merge pull request #9862 from JJenkx/windows/libc-cbrtf-msun
fix(libc): compute cbrtf with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-24 15:23:06 +13:00
Dean 72641c92f6 Merge pull request #9841 from JJenkx/windows/libc-logf-msun
fix(libc): compute logf with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-24 14:19:40 +13:00
JJenkxandClaude Opus 5.5 8b83c68aad fix(libc): compute exp2f with FreeBSD msun's algorithm, as titles' libc.prx does
exp2f returned the host exp2, so its last bit and errno depended on the
host: on Windows the bits differ from the libc.prx that titles ship on
213,306,266 of the 2^32 floats. That libc.prx is msun's s_exp2f.c, setting
ERANGE only in its overflow and underflow branches. The port gives the same
bits and errno as PPSA07923's, PPSA05916's and PPSA13934's copies for every
argument.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 20:16:32 -04:00
Dean d284c98b2e Merge pull request #10001 from MarcZX10/codex/libc-coshf-msun
fix(libc): follow msun for coshf
2026-10-24 12:52:24 +13:00
Dean 097a9514a0 Merge pull request #8865 from hypermoist/fix/libc-strtof-sign-hex-range
fix(libc): keep the sign of a failed strtof and match libc.prx strtof ERANGE
2026-10-24 11:56:01 +13:00
Dean 2e5a125982 Merge pull request #9777 from JJenkx/windows/libc-atanf-msun
fix(libc): compute atanf with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-24 07:27:14 +13:00
MarcZX10 116aff1d80 test(libc): cover acoshf range boundaries 2026-10-23 03:45:26 +00:00
MarcZX10 af343b1601 test(libc): cover coshf range boundaries 2026-10-23 03:35:47 +00:00
hypermistandClaude Opus 5.5 d2927e0ec1 fix(libc): follow libc.prx for strtof signs and hexadecimal round-up ERANGE
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SNqSvnFwRBz3D76n476yw6
2026-10-23 14:19:46 +13:00
hypermist bda7105405 Merge remote-tracking branch 'upstream/main' into fix/libc-strtof-sign-hex-range 2026-10-23 14:15:39 +13:00
JJenkxandClaude Opus 5.5 ac92cc6281 fix(libc): compute cbrtf with FreeBSD msun's algorithm, as titles' libc.prx does
cbrtf returned the host cbrt, so its result depended on the host: on
Windows it differs from the libc.prx that titles ship on 1,303,357,444 of
the 2^32 floats. That libc.prx is msun's s_cbrtf.c, which gives the same
bits as PPSA07923's, PPSA05916's and PPSA13934's copies for every argument.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:22:49 -04:00
JJenkxandClaude Opus 5.5 e601dbd7a4 fix(libc): compute sinf, cosf, tanf and sincosf with FreeBSD msun's algorithms, as titles' libc.prx does
They returned the host sin, cos and tan, so their last bit and errno
depended on the host: on Windows sinf differs from the libc.prx that titles
ship on 3,349,410 of the 2^32 floats, cosf on 3,382,210 and tanf on
303,874,018. That libc.prx is msun's s_sinf.c, s_cosf.c and s_tanf.c over
the double-precision kernels and e_rem_pio2f.c with k_rem_pio2.c; its
sincosf returns the same pair, and only an infinite argument sets EDOM.
The ports give the same bits and errno as PPSA07923's, PPSA05916's and
PPSA13934's copies for every argument.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:22:31 -04:00
JJenkxandClaude Opus 5.5 a22e959cd8 fix(libc): compute logf with FreeBSD msun's algorithm, as titles' libc.prx does
logf returned the host log, so its last bit and errno depended on the host:
on Windows the bits differ from the libc.prx that titles ship on 13,225,175
of the 2^32 floats. That libc.prx is msun's e_logf.c, setting ERANGE for
+-0 and EDOM for every argument with the sign bit set. The port gives the
same bits and errno as PPSA07923's and PPSA05916's copies for every
argument; the FMA-contracted copy of PPSA13934 differs by 1 ulp on 961,881.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:21:35 -04:00
JJenkxandClaude Opus 5.5 5e03230c28 fix(libc): compute atanf with FreeBSD msun's algorithm, as titles' libc.prx does
atanf returned the host atan, so its last bit depended on the host: on
Windows it differs from the libc.prx that titles ship on 6,481,820 of the
2^32 floats. That libc.prx is msun's s_atanf.c, which gives the same bits
as PPSA07923's, PPSA05916's and PPSA13934's copies for every argument.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:20:38 -04:00
Braxton Atkinson ee057ea155 fix(libc): preserve errno across fmodf domain errors 2026-10-22 14:59:20 -05:00
Rookie 4951eee5ed fix(libc): compute acosf with FreeBSD msun's algorithm, as the console's libc.prx does 2026-10-22 14:33:15 +01:00
hypermistandClaude Opus 5.5 d811e7abf0 fix(libc): set strtof ERANGE as the titles' libc.prx does
strtof and wcstof now set ERANGE for a decimal input whose nonzero
subnormal result is inexact, never for a hexadecimal nonzero subnormal,
and keep it for underflow to zero and overflow. This is what the libc.prx
bundled with PPSA08427 (J03547016) and PPSA03671 (J03848509) do when run
side by side with this libc. The earlier commit followed
libSceLibcInternal's _Stof, which leaves errno alone for hexadecimal under-
and overflow, but titles import these NIDs from their own libc.prx.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-23 02:15:34 +13:00
hypermist 0139f95bd8 Merge remote-tracking branch 'upstream/main' into fix/libc-strtof-sign-hex-range 2026-10-23 02:04:52 +13:00
MarcZX10 72316ad618 fix(libc): scale large finite cosh inputs 2026-10-21 22:59:10 +00:00
MarcZX10 c9b80f0304 feat(libc): implement _Cosh 2026-10-21 22:58:44 +00:00
hypermistandClaude Opus 5.5 34a729529a fix(libc): keep the sign of a failed strtof and drop hex ERANGE like the console
- strtof, strtold, wcstof and wcstold return -0.0 when nothing converts
  after a minus sign, unless the next character starts an inf or nan
  spelling; strtod, wcstod and atof keep +0.0.
- strtof, strtold, wcstof and wcstold leave errno alone for hexadecimal
  text that overflows or underflows.
- strtod and wcstod set ERANGE for hexadecimal text whose value lies
  below the smallest subnormal and rounds up to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-21 16:40:09 +13:00
hypermistandClaude Opus 5.5 8e46144d48 fix(libc): follow the console for integer bases and 0x prefixes
- strtol, strtoul, strtoll, strtoull and strtouq return 0 for a base
  outside 0 and 2 to 36, leave the end at the start and set EINVAL;
  strtoimax, strtoumax, _Stoull, _Stoul and the wide forms do the same
  without errno.
- A 0x prefix with no hexadecimal digit after it (base 0 or 16) is no
  conversion: the end stays at the start of the string.
- wcstol, wcstoll and wcstoimax take one sign, convert the rest with
  wcstoull and clamp to the signed range with ERANGE, so "- 1" is -1
  and "+\t-1" overflows.
- atoi, atol and atoll truncate strtoull's result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-21 16:05:00 +13:00
Dean 1ffe979127 Merge pull request #8576 from priyanshrv-netizen/feat/libc-float-characteristics
feat(libc): export the Dinkumware float characteristic tables
2026-10-21 14:06:48 +13:00
Dean 21a57ff5c0 Merge pull request #8570 from priyanshrv-netizen/feat/libc-dinkumware-constants
feat(libc): export the remaining Dinkumware floating-point constants
2026-10-21 13:29:16 +13:00
Dean 5b59fbc553 Merge pull request #8389 from SwetabhSingh17/feat/libc-math-significand
feat(libc): implement significand
2026-10-21 12:40:42 +13:00
Dean 1bf237cc33 Merge pull request #8379 from hypermoist/fix/libc-strtod-subnormal-errno
fix(libc): leave errno alone for subnormal strtod results
2026-10-21 12:14:17 +13:00
Dean 542c65d74c Merge pull request #8023 from Ondra97/codex/fix-scaled-hyperbolic
fix(libc): avoid premature scaled hyperbolic overflow
2026-10-21 06:26:06 +13:00