Commit Graph
182 Commits
Author SHA1 Message Date
Dean 1eb876b63a Merge pull request #10907 from imellag/test/libc-math-standard-exception-flags
test(libc): compare the C exception flags in the scaled hyperbolic checks
2026-10-27 18:28:30 +13:00
Dean 1a13c2969f Merge pull request #9833 from MarcZX10/codex/libc-strtod-decimal-subnormal-erange
fix(libc): set ERANGE for decimal strtod subnormals
2026-10-27 18:21:37 +13:00
Dean 304bea47ca Merge pull request #9771 from JJenkx/windows/libc-asinf-msun
fix(libc): compute asinf with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-27 14:58:25 +13:00
Adrià c9a6013f4d Merge pull request #10468 from JJenkx/fix/libc-nextafter-fenv
fix(libc): preserve nextafter exception flags and denormal modes
2026-10-26 19:50:43 +01:00
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
JJenkx ef0afbb731 test(libc): make nextafter environment coverage portable 2026-10-26 08:24:29 -04:00
JJenkx f5f4f7fbf8 fix(libc): preserve nextafter floating-point environment behavior 2026-10-26 08:24:29 -04: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
JJenkxandClaude Opus 5.5 6d9fd5d1e7 fix(libc): store EDOM from asinf where titles' libc.prx does
asinf left errno unchanged for |x| > 1, the infinities and NaN, following
included, stores EDOM there and leaves it alone for |x| <= 1; asinf now
does the same, and the test expects it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:18:51 -04:00
JJenkxandClaude Opus 5.5 ebc8bcc106 fix(libc): compute asinf with FreeBSD msun's algorithm, as titles' libc.prx does
asinf returned the host asin, so its last bit depended on the host: on
Windows it differs from the libc.prx that titles ship on 5,413,834 of the
floats in (-1, 1). That libc.prx is msun's e_asinf.c, which gives the same
bits as PPSA07923's and PPSA05916's copies for all 2^32 arguments. errno
is still left unchanged for |x| > 1 and NaN.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:18:51 -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
Emanuele 476b63dd45 test(libc): compare the C exception flags in the scaled hyperbolic checks
The _FSinh and _FCosh special-value checks read the raised flags with
fetestexcept(FE_ALL_EXCEPT). On macOS FE_ALL_EXCEPT also holds the x86
denormal-operand flag, which an SSE operation on a subnormal input such
as 0x1p-149 raises, so the check saw 0x2e where it expects 0x2c. glibc
and FreeBSD leave that flag out of FE_ALL_EXCEPT. The checks now read
the five C exception flags.
2026-10-25 10:16:29 +01: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 c071f3d240 Merge main (check commit for the public_headers fix) 2026-10-25 12:43:32 +13: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
MarcZX10 1ed9a97a6b test(libc): reset errno before strtof after strtod underflow 2026-10-24 16:49:00 +00:00
MarcZX10 89a15f16d4 fix(libc): set ERANGE for decimal strtod subnormals 2026-10-24 16:41:33 +00: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