Commit Graph
466 Commits
Author SHA1 Message Date
JJenkxandClaude Opus 5.5 1f206b59c4 fix(libc): accept any setlocale category and only the C locale, as titles' libc.prx does
setlocale returned a null pointer for a category outside 0 to 6 and
accepted "POSIX" as a name for "C". The libc.prx that titles ship
ignores the category, so setlocale(-1, NULL) and setlocale(7, "C")
return "C", and returns a null pointer for "POSIX" as for any name other
than "C" or the empty string.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 20:36:58 -04:00
hypermist 3563fa21c4 Merge remote-tracking branch 'upstream/main' into fix/libc-utf8-multibyte 2026-10-23 13:27:39 +13:00
orezraeyandClaude Opus 5.5 2151929559 docs(libc): record nearbyintf, getw, putw, __isfinitel and _FSinh measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:18:27 -03:00
orezraeyandClaude Opus 5.5 8bb01531d1 docs(libc): record that libSceLibcInternal does not export memmem or memccpy
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 20:41:18 -03:00
orezraeyandClaude Opus 5.5 a814ef3f9a fix(libc): return fetestexcept's unmasked status bits as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 20:40:57 -03:00
orezraeyandClaude Opus 5.5 62ce458120 fix(libc): format strftime and asctime fields as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 20:36:58 -03:00
Yunus Shaikh b463132a56 Merge main into fix/libkernel-signal-handler-mask
# Conflicts:
#	core/libs/prx/libkernel/System/src/Signals.cpp
#	docs/dev/debt/libkernel.md
2026-10-22 16:27:25 -07:00
valenciana-nc 1d0c48d1ee fix(libc): preserve exception flags for zero-argument float Bessel calls 2026-10-22 16:34:38 -06:00
Dean 9e568a389b Merge pull request #8376 from hypermoist/feat/libc-dinkumware-dispatchers
feat(libc): implement the Dinkumware _Stod, _Stoll, _Sin and _Log helpers
2026-10-23 09:51:54 +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
JJenkxandClaude Opus 5.5 ea6aa0a809 fix(libc): follow the console fgetws for short buffers and read errors
The fgetws in the libc.prx that titles ship (the same 133 bytes in the
copies of PPSA13934, PPSA07923 and PPSA05916, read from disassembly)
differs from this one in two cases:

- A size below 2 returns null at once, without writing the buffer,
  errno or the stream (cmp $0x2,%esi; jge, else the null result). Here a
  size of 1 stored a NUL and returned the buffer, and a size of 0 or less
  set the stream error and errno 22.
- When fgetwc returns -1 after characters were stored, the console
  null-terminates and returns the buffer; it returns null only when
  nothing was stored, and never checks ferror. Here a read error after
  some characters returned null.

The rest already matches: each fgetwc result is stored as its low 16 bits
(mov %ax,(%rbx)), and the newline test compares all 32 bits. A null buffer
or stream, which the console dereferences, keeps failing with errno 22.

guest_standard_streams now expects the console results for sizes 1, 0
and -1 and for an invalid byte after a stored character; its fgetwc error
indicator check is unchanged. The libc debt entry cites the reading and
what it leaves unverified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:19:24 -04:00
Braxton Atkinson 07bec523ad docs(libc): separate byte-case compatibility note 2026-10-22 15:00:23 -05:00
Braxton Atkinson ee057ea155 fix(libc): preserve errno across fmodf domain errors 2026-10-22 14:59:20 -05:00
Kraken 5dfd50502a chore(libc): refresh feupdateenv and preserve debt entries 2026-10-22 20:27:31 +01:00
Braxton Atkinson 9b40e1e9b6 fix(libs): keep byte case comparisons in the guest C locale 2026-10-22 14:10:45 -05:00
Adrià 8580e7e214 Merge pull request #9331 from MarcZX10/codex/wide-scan-reported-edge-cases
fix(libc): match reported wide scanf edge cases
2026-10-22 20:36:35 +02:00
Adrià cbcb083086 Merge pull request #9296 from superhe11/codex/fix-snprintf-size-overflow
fix(libc): reject snprintf capacities above INT_MAX + 1
2026-10-22 20:29:27 +02:00
Adrià FranchandClaude e8c73627f6 fix(libc): keep %% at end of input an input failure in the wide scanner
Co-Authored-By: Claude <[email protected]>
2026-10-22 20:11:40 +02:00
MarcZX10 0d70810529 docs(libc): record remaining wide scanner evidence gap 2026-10-22 20:11:32 +02:00
bluandClaude Opus 5.5 0017ed2660 Merge branch 'boykopovar:main' into feat/libc-siginterrupt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:56:17 -07:00
Adrià a6646f8464 Merge pull request #9071 from MarcZX10/marc/libc-cosh-9062
feat(libc): implement _Cosh
2026-10-22 19:52:15 +02:00
Adrià 9062485ebe Merge pull request #8880 from ycbuzi/feat/libc-num-get-objects
feat(libc): export the num_get and time_get locale objects as data
2026-10-22 19:44:08 +02: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
mugurc 100148f762 fix(tests): expect the SSE traps the host keeps in the floating-point trap checks
The trap checks unmask exceptions with feenableexcept and its relatives
and expect MXCSR to hold the new masks, and the enable and disable
results to report the traps enabled on both units. Under Rosetta 2
MXCSR keeps its six exception masks set, so no SSE trap is ever enabled
and every result reports none. The test now asks the host once whether
it keeps an unmasked MXCSR exception and, where it does not, expects
all six SSE masks set and no trap on both units; on other hosts the
expectations are the same as before. A debt entry records that the
trap functions change only the x87 masks under Rosetta.
2026-10-22 13:00:10 +03:00
mugurc 65ba3a665f fix(tests): compare the floating-point exception masks with the ones the host keeps
Under Rosetta 2 the six MXCSR exception masks always read back set: a
write that unmasks an SSE exception is not kept, while the x87 masks and
the other MXCSR bits are. guest_floating_point unmasked the overflow
exception on both units and then expected MXCSR to equal the value it
wrote, so it failed on macOS although fesetexceptflag and feclearexcept
left the masks alone. The test now compares with the environment read
back after the write, which on other hosts is the value written. The
debt entry for the floating-point functions notes the Rosetta behaviour.
2026-10-22 13:00:10 +03:00
hypermistandClaude Opus 5.5 a37f8c630a docs(libc): record the bundled libc.prx UTF-8 default for the multibyte debt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-22 22:09:31 +13:00
hypermist 62feb8bfcc Merge remote-tracking branch 'upstream/main' into fix/libc-utf8-multibyte 2026-10-22 22:08:17 +13:00
Yunus Shaikh 280849ebde Merge main into fix/libkernel-signal-handler-mask 2026-10-21 22:33:02 -07:00
Dean 746bdd8041 Merge pull request #8550 from Retr0G28/fix/fopen-directory-read-windows
fix(libc): open a directory with fopen in a read mode on Windows
2026-10-22 17:22:22 +13:00
Kang, Harry Zixuan 726edc503b feat(windows): support MSYS2 GCC runtime builds 2026-10-21 20:29:55 -07:00
blu b440d11cbb Merge branch 'boykopovar:main' into feat/libc-siginterrupt 2026-10-21 19:03:47 -07:00
hypermistandClaude Opus 5.5 d1e66e95ca docs(libc): shorten the char16/char32 conversion entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-22 14:42:24 +13:00
hypermist 193d3c000d Merge remote-tracking branch 'upstream/main' into fix/libc-utf8-multibyte 2026-10-22 14:30:27 +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
Yunus Shaikh e607ba1b41 Merge main into fix/libkernel-signal-handler-mask 2026-10-21 15:52:33 -07:00
bluandClaude Opus 5.5 6287af9657 docs(libc): name the num_get<char> vtable's slots from the console
mazen320 mapped the relocated slots of KfcTPbeaOqg in the console's
libSceLibcInternal: offset-to-top, typeinfo, the two destructors,
locale::facet::_Incref and _Decref, and the eleven do_get. The debt
entry now says so instead of leaving the two extra entries unknown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 14:56:43 -07:00
bluandClaude Opus 5.5 428e9cb5f3 fix(libc): size the num_get<char> vtable to the console's 17 slots
mazen320 read KfcTPbeaOqg from the console's libSceLibcInternal.sprx
symbol table: an object of 136 bytes, 17 pointer slots. Export that
size instead of the 15 derived from Dinkumware's crt.vc12 xlocnum, and
say in the debt entry that which two virtual functions are added is
not known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 13:45:04 -07:00
bluandClaude Opus 5.5 a946c469d6 Merge upstream main into feat/libc-num-get-objects
Resolves the conflict with #8867 in EntryStubTests.cpp: keep its two
kernel-variant tests and the BufferUtils include, and this branch's
libSceAmpr-to-libc fallback test, with all three called from main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 12:33:11 -07:00
Kraken 7462ce5c1c feat(libc): implement gets line input 2026-10-21 19:47:17 +01:00
Adrià 6b6c701636 Merge pull request #8941 from xXPBSXx/docs/debt-snwprintf-s-handler
docs(debt): say that snwprintf_s does not invoke the exported constraint handler
2026-10-21 20:12:23 +02:00
Superhe11 595dcacdf2 docs(libc): avoid competing debt insertions at the section start 2026-10-21 21:08:18 +03:00
Superhe11 eecffc924b test(libc): cover snprintf size bounds and formatting side effects 2026-10-21 20:34:41 +03:00
Kraken c22483ac33 feat(libc): implement feupdateenv 2026-10-21 16:51:00 +01:00
Felipebmaitan 18213e0f3a feat(libc): implement fegetexcept 2026-10-21 12:24:14 -03:00