Commit Graph
652 Commits
Author SHA1 Message Date
Adrià c4669c9ca2 Merge pull request #9958 from JJenkx/windows/printf-long-double-hex
fix(libc): format %La like titles' libc.prx does
2026-10-26 16:30:58 +01:00
Adrià b0f1183ca1 Merge pull request #9973 from JJenkx/windows/swscanf-float-errno
fix(libc): leave errno alone for out-of-range float and double in swscanf
2026-10-26 16:20:08 +01:00
Adrià 14803835de Merge pull request #10176 from orezraey/docs/libc-memmem-memccpy-exports
docs(libc): record that libSceLibcInternal does not export memmem or memccpy
2026-10-26 16:14:39 +01:00
JJenkx c48ed84d47 fix(libc): preserve modf decomposition and floating-point status 2026-10-26 09:34:58 -04: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
JJenkxandClaude Opus 5.5 afa58432f3 fix(libc): format %La like titles' libc.prx does
A long double %La went to the host, which on Windows (MinGW) prints the
64-bit significand with its integer bit as the leading digit:
0xc.ccccccccccccccdp-7 for 0.1L. The libc.prx that titles ship
normalises it like a double, with a leading 1 and the remaining 63 bits
as 16 hexadecimal digits, 0x1.999999999999999ap-4, and rounds a shorter
precision half up with the carry kept in the leading digit. Share
HexFloat's digit and rounding code between double and long double and
use it for finite long double %a and %A in the narrow and wide families.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 08:52:35 -04:00
Maz e8aef0f1d8 fix(libc): size the num_put facet vtable to 112 bytes
Titles that import the vtable as data expect fourteen slots (st_size 112 on
PPSA16833 libc.prx); twelve left the object short.
2026-10-26 16:42:42 +04:00
Adrià 2cce8bc51d Merge pull request #9927 from JJenkx/windows/wprintf-float-console
fix(libc): format wide %a, %e, %f and %g with the narrow console rules
2026-10-26 13:25:22 +01:00
JJenkx f5f4f7fbf8 fix(libc): preserve nextafter floating-point environment behavior 2026-10-26 08:24:29 -04:00
Maz 1f27ca0c49 feat(libc): export the wide num_get facet vtable as data
Console libSceLibcInternal exports Y9C9GeKyZ3A as a 136-byte STT_OBJECT;
titles that resolve the wide num_get vtable as data need a zeroed 17-slot
object matching the narrow num_get layout on console.
2026-10-26 11:37:08 +01:00
Adrià cbf76e7a6e Merge pull request #9408 from rursache/feat/macos-trace-imports
feat(relinker): trace function imports on macOS
2026-10-26 11:27:51 +01:00
Adrià c8a3b25882 Merge pull request #9464 from mazen320/feat/libc-time-get-w-vtable
feat(libc): export the wide time_get facet vtable as data
2026-10-26 11:19:39 +01:00
Dean c3db979cd3 Merge pull request #10128 from orezraey/fix/libc-gethostname-measured-ps5
fix(libc): report the empty host name measured on a PS5
2026-10-26 22:00:35 +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 3d2b7c0673 Merge pull request #10610 from JJenkx/fix/libc-acoshf-domain-fenv
fix(libc): preserve acoshf domain errno and exception flags
2026-10-26 20:14:11 +13:00
Dean 8022d448e6 Merge pull request #10786 from 00xDisaster/feat/libc-dinkumware-math
feat(libc): implement _Exp and _FExp
2026-10-26 20:02:47 +13:00
Dean Galvin 42a75519e3 Merge branch 'main' into windows/libc-tanh-msun 2026-10-26 18:37:39 +13:00
Dean Galvin 92db947130 Merge branch 'main' into feat/libc-thread-gaps 2026-10-26 17:41:29 +13:00
Dean Galvin 7461106f53 Merge branch 'main' into fix/libc-acoshf-domain-fenv 2026-10-26 17:40:43 +13:00
Dean a401865a1a Merge pull request #9269 from UnhealthyKraken/test/libc-crt-exit-lifecycle
test(libc): cover CRT exit and TLS cleanup lifecycle
2026-10-26 17:38:22 +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 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
JJenkxandClaude Opus 5.5 035d9c0821 fix(libc): compute cbrt with FreeBSD msun's algorithm, as titles' libc.prx does
cbrt returned the host's cbrt, whose last bit differs from the titles' copy
on Windows on 99,933,841 of 320 million random arguments, about 31%. The
titles' copy is FreeBSD msun's s_cbrt.c, and cbrt now computes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:18:40 -04:00
JJenkx ad111b3ce1 fix(libc): preserve acoshf domain errno and exception flags 2026-10-25 22:07:34 -04:00
GruzzberryandClaude Sonnet 5.5 4ccb760d12 fix(libc): realpath resolves symbolic links like FreeBSD
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 01:59:58 +00: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
JJenkxandClaude Opus 5.5 0f7056d67b fix(libc): compute logb and logbf with FreeBSD msun's algorithm, as titles' libc.prx does
logb and logbf returned the host's logb, which sets ERANGE for a zero
argument on Windows and returns signalling NaNs unquieted. The titles'
copies are FreeBSD msun's s_logb.c and s_logbf.c, which set no errno and
quiet a NaN through x * x; both functions now compute that algorithm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 20:50:11 -04:00
Adrià 97d33464c5 Merge pull request #9527 from AlxcBTW/pr/libc-annex-k-stream-io
feat(libc): add the Annex K stream printf, scanf and freopen_s functions
2026-10-26 01:21:26 +01:00
Adrià 898a7fef4f Merge pull request #9631 from UnhealthyKraken/feat/libc-fetch-seqcst
feat(libc): implement sequential bitwise fetch helpers
2026-10-26 01:11:55 +01:00
Danigamer05 94e88881d4 feat(libc): implement unsigned 64-bit minimum 2026-10-26 01:01:08 +01:00
Kraken 8df45c965d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	core/libs/tests/GuestLibcThreads.cpp
2026-10-25 23:41:36 +00:00
Kraken 90496dd15b Merge remote-tracking branch 'origin/main' into HEAD 2026-10-25 23:37:41 +00: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
JJenkxandClaude Opus 5.5 171d767382 fix(libc): format wide %a, %e, %f and %g with the narrow console rules
The wide printf family still formatted floating-point conversions
through the host, while the libc.prx that titles ship gives swprintf the
same text as snprintf: on 199,948 random formats the copy bundled with
PPSA07923 printed identical narrow and wide output, and this build's
wide output differed from it on 23,893. Use the narrow DecimalFloat and
HexFloat for finite values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:06:20 -04:00
orezraeyandClaude Opus 5.5 18e69a439f docs(libc): record reallocalign to size 0 as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 19:50:05 -03:00
Alexandre Figueiredo f75ede7a7f docs(debt): close the __isfinitel entry with the bundled libc.prx code 2026-10-25 22:27:46 +00:00
Eduardo Ruiz e859215335 feat(libc): export the error_category members and std::future_error
The libc.prx bundled with PPSA02530 keeps error_code values in the second
dword: the shared error_category::default_error_condition shifts the value
into the high half and the equivalent overloads compare that dword and the
category. Export the type info, the base destructor and the three base
members, so titles that import them resolve to the same code the generic
and system category vtables already use.

future_category returns a static _Future_error_category derived from
_Generic_error_category and named "future". Its message maps 1..4 to
"broken promise", "future already retrieved", "promise already satisfied"
and "no state", and falls back to the generic table. future_error is 0x40
bytes: a GuestLocale::String at 0x8 and the 16-byte error_code at 0x30; its
0x30-byte vtable carries the console's _Doraise slot. _Throw_future_error
allocates that size and throws it with the console type info, and
_Rethrow_future_exception delegates to rethrow_exception.
2026-10-25 23:27:36 +01:00
Dean b90d009d9f Merge pull request #10665 from JJenkx/fix/libc-acoshf-positive-rounding-20261024
fix(libc): match acoshf positive-range evaluation
2026-10-26 11:14:24 +13:00
JJenkxandClaude Opus 5.5 c228d7a459 docs(libc): record the wide scanner's float errno contract
swscanf restores errno around strtof and strtod, as the bundled
libc.prx does, while long double conversions keep host strtold's
errno and the narrow sscanf family keeps the host's ERANGE. Record
both gaps in the existing swscanf debt entry, as review asked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:12:05 -04:00
Dean 6cc5ec671d Merge pull request #10394 from JJenkx/windows/libc-drand48-upper-bits
fix(libc): return the upper 32 bits of the state from drand48 and erand48 as titles' libc.prx does
2026-10-26 11:05:43 +13:00
JJenkxandClaude Opus 5.5 e54e3569f3 fix(libc): compute atan2f with FreeBSD msun's algorithm, as titles' libc.prx does
atan2f returned the host atan2, so its last bit depended on the host: on
Windows it differs from the libc.prx that titles ship on 7,126,466 of
200,001,024 sampled argument pairs. That libc.prx is msun's e_atan2f.c over
its atanf; with two NaN arguments it returns y's. The port gives the same
bits as PPSA07923's, PPSA05916's and PPSA13934's copies on every pair.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:04:28 -04:00
Alexandre Figueiredo eb943993a7 docs(debt): cut the long-double Dinkumware entry to _LLog with the bundled libc.prx code 2026-10-25 21:58:34 +00:00
orezraeyandClaude Opus 5.5 61ae4c52df fix(libc): save the random state on a short initstate and take any setstate rear as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:47:19 -03:00
Dean 88f99678bf Merge pull request #10648 from edubox/feat/libc-pad-launch-attr
feat(libc): forward pthread attributes in _Pad::_Launch
2026-10-26 10:42:58 +13:00
Dean Galvin 4f5b9951c8 Merge branch 'main' into feat/libc-thread-gaps 2026-10-26 10:15:04 +13:00
Adrià 26ba9b6b71 Merge pull request #9499 from EagleBearerYS/fix/libkernel-signal-handler-mask
fix(libkernel): block a signal while its handler runs and honour SA_RESETHAND
2026-10-25 22:05:12 +01:00
orezraeyandClaude Opus 5.5 ff667ba3b7 fix(libc): give strerror_s the strerror texts and return 0 on truncation as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:01:11 -03:00
orezraeyandClaude Opus 5.5 373027da36 fix(libc): reject strerror_r buffers under 23 bytes and cut longer texts
The libc.prx that PPSA31872 ships returns ERANGE for a buffer shorter than
23 bytes and otherwise strncpy's length - 1 bytes and terminates the last
one. This matches the firmware 13.60 log, where error 0 with a 16-byte
buffer returned 34 although "No error" fits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 17:59:49 -03:00