Commit Graph
664 Commits
Author SHA1 Message Date
Dean 711c4eca09 Merge pull request #11785 from ionut27001/fix/libc-hardware-concurrency
fix(libc): return the CPU count of the default thread mask from std::thread::hardware_concurrency
2026-10-29 12:16:46 +13:00
Dean 3e3fa79116 Merge pull request #12229 from Danigamer05/feat/libc-stdc-one-runs
feat(libc): add C23 leading and trailing one counts
2026-10-29 12:10:46 +13:00
Dean 34ae0d5e9e Merge pull request #12193 from Danigamer05/feat/libc-stdc-zero-runs
feat(libc): add C23 leading and trailing zero counts
2026-10-29 12:09:21 +13:00
Dean b76d41ea82 Merge pull request #11979 from xXPBSXx/carry/6713-default-heap-no-procparam
fix(libc): use the default heap for an executable without process parameters
2026-10-29 11:49:55 +13:00
Dean 91f495595f Merge pull request #12289 from fogydes/fix/bsearch-s-zero-size
fix(libc): invoke constraint handler on zero element size in bsearch_s
2026-10-29 11:47:28 +13:00
Dean 1f52200308 Merge pull request #11333 from Danigamer05/feat/libc-signed-max32
feat(libc): implement signed 32-bit maximum value helper
2026-10-29 07:27:25 +13:00
Dean 45f40b505d Merge pull request #12291 from B-Howell/claude/fix-issue-9691-hex-strtod-erange
fix(libc): match title libc.prx for hexadecimal strtod underflow
2026-10-29 07:26:33 +13:00
Adrià 7fea87746b Merge pull request #11737 from xXPBSXx/libm/asinh-msun
fix(libc): compute asinh with FreeBSD msun's algorithm
2026-10-28 17:58:59 +01:00
Adrià 8c621aa276 Merge pull request #11729 from iAbdulrrahman/feat/libc-fetch-64-bit-atomics
feat(libc): implement 64-bit atomic fetch helpers
2026-10-28 17:35:48 +01:00
Dean 3070a25d9e Merge pull request #12319 from JJenkx/windows/libc-acosf-edom
fix(libc): store EDOM and raise FE_INVALID from acosf and asinf domain errors
2026-10-29 03:34:51 +13:00
Adrià 31646b6e17 Merge pull request #12259 from B-Howell/docs/libc-rename-source-lookup-debt
docs(libc): drop the rename dot-destination gap that 308848e1a6 closed
2026-10-28 14:47:59 +01:00
Dean 14a269cfef Merge pull request #12187 from Danigamer05/feat/libc-stdc-count-zeros
feat(libc): add C23 count-zeros exports
2026-10-28 22:50:41 +13:00
Dean f653b562a9 Merge pull request #12037 from JJenkx/windows/libc-fexp-titles
fix(libc): compute _Exp and _FExp as titles do
2026-10-28 22:40:19 +13:00
B-HowellandClaude Opus 5.5 a252638976 docs(libc): cite the strtod measurement by title ID in the debt entries
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 05:24:35 -04:00
JJenkxandClaude Opus 5.5 8b5c02ca61 fix(libc): store EDOM and raise FE_INVALID from acosf and asinf domain errors
For |x| > 1, the infinities and NaN, titles' libc.prx stores EDOM and
raises FE_INVALID from acosf, quiet NaN included, and asinf also
raises FE_INVALID for a quiet NaN. acosf returned the same NaN bits
without either, and asinf set errno but raised nothing for a quiet NaN.
Both now call _Feraise with the invalid exception, which stores EDOM
and raises the flag in both units; the results are unchanged.

The acosf test asserted the old errno-preserving behaviour from a
FreeBSD reading; it now checks the titles' EDOM and FE_INVALID.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 05:17:22 -04:00
fogydes 1af5f0735f fix(libc): invoke constraint handler on zero element size in bsearch_s 2026-10-28 13:31:49 +05:30
B-HowellandClaude Opus 5.5 82c8a51391 fix(libc): saturate the hexadecimal strtod exponent past any digit run
The explicit binary exponent stopped accumulating near 1e9 while the
digits add 4 per character without bound, so a subject with a few
hundred million digits was classified against the wrong exponent:
0x1 followed by 3e8 zeros and p-1200000005000 kept errno, and a long
zero fraction with p+1000000000000 underflowed instead of overflowing.
Saturate the explicit exponent at 2^62, beyond what any addressable
digit run can offset, so the sum never overflows or changes sign.

Record that _Stod and _Stodx follow the title libc.prx rule for
hexadecimal underflow, unverified for libSceLibcInternal.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
B-HowellandClaude Opus 5.5 33c69417e4 docs(libc): trim the hexadecimal strtod debt entry to what is open
Keep only the gaps: the rule is measured on one title-bundled libc.prx,
and on Linux glibc 2.35's strtod rounds some hexadecimal subnormal
results a unit low.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
B-HowellandClaude Opus 5.5 6084ed65b4 fix(libc): match title libc.prx for hexadecimal strtod underflow
Classify hexadecimal strtod and wcstod input from its own digits rather
than a long double approximation. As measured on God of War Ragnarok's
bundled libc.prx, ERANGE is set only on overflow or when the exact value
is below 2^-1074, and a value between 2^-1075 and 2^-1074 becomes the
smallest subnormal only from 2^-1075 * (1 + 2^-52) up.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
Dean da6b0ea8dd Merge pull request #11884 from JJenkx/windows/libc-strtof-nan-payload
fix(libc): keep NaN payloads in strtof and wcstof as titles' libc.prx does
2026-10-28 20:11:27 +13:00
B-HowellandClaude Opus 5.5 dbea3c9c0c docs(libc): drop the rename dot-destination gap that 308848e1a6 closed
rename and sceKernelRename now look the source up before they reject a
dot destination, as FreeBSD 11.4's kern_renameat does, so a missing
source onto dir/. fails with ENOENT. guest_filesystem covers it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 01:46:12 -04:00
Dean 5ab8acf45f Merge pull request #11309 from Danigamer05/feat/libc-signed-min32
feat(libc): implement signed 32-bit minimum value helper
2026-10-28 17:50:21 +13:00
Dean c9cc3b34db Merge pull request #11304 from Danigamer05/feat/libc-unsigned-max32
feat(libc): implement unsigned 32-bit maximum
2026-10-28 17:50:05 +13:00
Dean 24795c0f56 Merge pull request #10529 from JJenkx/fix/libc-expm1-scaling-association
fix(libc): preserve expm1 rounding during exponent scaling
2026-10-28 17:49:49 +13:00
Dean dbbe99aeb0 Merge pull request #9772 from UnhealthyKraken/feat/libc-floating-prefix
feat(libc): implement floating-point prefix helpers
2026-10-28 17:49:14 +13:00
Adrià 0c5401dcbd Merge pull request #9735 from mazen320/feat/libc-ctype-vtable
feat(libc): export the ctype facet vtable as data
2026-10-28 05:36:29 +01:00
Danigamer05 d7986b1fb6 feat(libc): add C23 leading and trailing one counts 2026-10-28 04:54:42 +01:00
Adrià 439d03db38 Merge pull request #11663 from Danigamer05/feat/libc-stdc-count-ones
feat(libc): add C23 count-ones exports
2026-10-28 04:19:47 +01:00
Adrià f1f1737371 Merge pull request #11647 from B-Howell/codex/libc-strtoq
feat(libc): implement strtoq
2026-10-28 04:06:20 +01:00
Danigamer05 504111f10c feat(libc): add C23 leading and trailing zero counts 2026-10-28 03:54:03 +01:00
Danigamer05 e5835d6866 feat(libc): add C23 count-zeros exports 2026-10-28 03:09:35 +01:00
Dean 4c6fcfcb5c Merge pull request #9763 from rooklz/fix/libc-freopen-closed-stream
fix(libc): reopen a closed stream in freopen instead of aborting
2026-10-28 13:48:50 +13:00
xXPBSXxandClaude Sonnet 5.5 893250cf72 Merge main (951399570d) into libm/asinh-msun
The only conflict was in GuestMath.cpp, where main's sinh tests and this
branch's asinh tests were inserted at the same place. Keep both: the asinh
checks follow the sinh ones.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 01:31:59 +01:00
Dean 057de19313 Merge pull request #11556 from xXPBSXx/libm/sinh-msun
fix(libc): compute sinh with FreeBSD msun's algorithm
2026-10-28 13:03:47 +13:00
Dean 9f605c98d2 Merge pull request #10283 from JJenkx/windows/libc-cbrt-msun
fix(libc): compute cbrt with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-28 13:01:01 +13:00
Dean 46b9aa3768 Merge pull request #9648 from JJenkx/windows/libc-rand-console
fix(libc): follow the console's rand, srand and rand_r
2026-10-28 13:00:35 +13:00
Dean 6e9b9134f6 Merge pull request #11846 from heditrigui/feat/libc-reallocarray
feat(libc): implement reallocarray
2026-10-28 12:10:58 +13:00
xXPBSXxandClaude Sonnet 5.5 944b4d753e Merge main (f5fefb982c) into carry/6713-default-heap-no-procparam
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 22:29:34 +01:00
Adrià e274546099 Merge pull request #11302 from Danigamer05/feat/libc-signed-max64
feat(libc): implement signed 64-bit maximum
2026-10-27 22:26:29 +01:00
Adrià 6d99bf4ccb Merge pull request #11300 from Danigamer05/feat/libc-signed-min64
feat(libc): implement signed 64-bit minimum
2026-10-27 22:16:40 +01:00
Adrià 4a6005955f Merge pull request #10898 from imellag/feat/libkernel-memory-protection-macos
feat(libkernel): guest memory protection and VirtualQuery on macOS hosts
2026-10-27 21:42:24 +01:00
Adrià 80b209d984 Merge pull request #11295 from Danigamer05/feat/libc-unsigned-min32
feat(libc): implement unsigned 32-bit minimum
2026-10-27 21:20:30 +01:00
Dean ab6a87a163 Merge pull request #10460 from Danigamer05/feat/libc-unsigned-max64
feat(libc): implement unsigned 64-bit maximum
2026-10-28 06:53:22 +13:00
JJenkxandClaude Opus 5.5 79d65956a1 fix(libc): compute _Exp and _FExp as titles do
The libc.prx that titles ship evaluates the rational step as
((Q(z) + g*P(z)) + 1) / ((Q(z) - g*P(z)) + 1), with its own ln 2 split
and coefficients in the double case, and returns 1 only for arguments
within half an epsilon of zero. main used a different rational form
with a doubling step and an epsilon-wide shortcut, which left about one
result in five one ulp away from titles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 13:18:32 -04:00
xXPBSXxandClaude Sonnet 5.5 e914dd269c fix(libc): return a zeroed parameter block for an executable without process parameters
Callers of ApplicationProcessParameters_nid_no_patch read the compiled SDK
version at offset 16 without a null check, so the null result for the
no-parameters record would crash them. The lookup now returns a static
zeroed 0x40-byte block for that record, and the heap recognises it by
address and keeps registering its default allocator.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 16:04:22 +01:00
Danigamer05 f139bcf1fc feat(libc): implement signed 32-bit maximum value helper 2026-10-27 15:46:15 +01:00
Karim Ibrahim fc80fa90ff fix(libc): use the default heap for an executable without process parameters
An ELF without a PT_SCE_PROCPARAM segment, such as a ps5-payload-dev
SDK program, had no .procpar section after relinking, so the first
allocation stopped with "process metadata is missing; relink the
executable".

The Windows relinker now writes a .procpar section that records no
parameters for such an ELF, and the application heap registers its
default allocator when it finds that record. An executable without
any .procpar section still gets the relink message.
2026-10-27 14:09:27 +01:00
JJenkxandClaude Opus 5.5 bece5871e2 fix(libc): keep NaN payloads in strtof and wcstof as titles' libc.prx does
strtof and wcstof returned the default quiet NaN for any NAN(...)
sequence. The libc.prx bundled with eleven titles reads the payload as
its strtod does, but into one 32-bit word: a blank after the first group
of digits ends it, the first 8 digits are kept and cut to 24 bits, the
result goes under the quiet bit with the sign, and a zero payload
becomes 1. HexNanPayload now takes the word count, two for double and
one for float, and the NaN table test checks the measured float bits
and end for all 64 inputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 07:13:19 -04:00
Maz d4a25e115a feat(libc): export the ctype facet vtable as data
Titles that import ctype<char>'s vtable as a 112-byte object need the fourteen-slot STT_OBJECT measured on PPSA16833 libc.prx.
2026-10-27 15:06:56 +04:00
Adrià 6a5950b5ce Merge pull request #10903 from imellag/test/libc-update-env-macos
test(libc): run the feupdateenv checks on macOS and under Rosetta 2
2026-10-27 12:00:19 +01:00