Commit Graph

31 Commits

Author SHA1 Message Date
Achraf Reyani ffeb263654 feat(libc): implement fabs, trunc and fma
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:54:23 +09:00
Dean 043aac6a4d
Merge pull request #3191 from AchrafReyani/feat/libc-rand-r
feat(libc): implement rand_r
2026-10-11 19:05:27 +13:00
Dean 7be5ce3de8
Merge pull request #3190 from AchrafReyani/feat/libc-hyperbolic
feat(libc): implement the hyperbolic functions
2026-10-11 19:05:17 +13:00
Adrià Franch 660abec2d3 feat(libc): implement sqrt and sqrtf
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-11 04:44:39 +02:00
Adrià Franch 3cd36b0135 feat(libc): implement acosl and frexpl
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-11 03:58:47 +02:00
Achraf Reyani 86db61ca30 feat(libc): implement rand_r
Share rand's generator step with rand_r, which advances the caller's
state instead of the global one, as FreeBSD's rand and rand_r share
do_rand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:48:07 +09:00
Achraf Reyani 1191ed3eaa feat(libc): implement the hyperbolic functions
Export sinh, cosh, coshf, asinh, asinhf, acosh, acoshf and atanh,
forwarding to the C++ standard library like tanh and tanhf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:38:33 +09:00
Dean ea6661cce8
Merge pull request #2934 from AchrafReyani/feat/libc-nextafterf
feat(libc): implement nextafterf
2026-10-11 09:09:09 +13:00
Dean 230ce25b97
Merge pull request #2933 from AchrafReyani/feat/libc-llroundf
feat(libc): implement llroundf
2026-10-11 09:09:00 +13:00
Achraf Reyani fc828e19e7 feat(libc): implement nextafterf
Export it next to remainderf, stepping to the adjacent float in the
direction of the second argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:25:24 +09:00
Achraf Reyani 3c43198943 feat(libc): implement llroundf
Export it next to lroundf and llround, rounding halfway cases away
from zero into the 64-bit guest long long.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:25:23 +09:00
Achraf Reyani e7311656c9 feat(libc): implement __isinf
Export the double version next to __isnan and __isfinite, returning
1 for either infinity like __isinff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:25:21 +09:00
Adrià 593001d8fd
Merge pull request #1818 from journaltraces/feat/libc-ldiv
feat(libc): implement ldiv
2026-10-10 00:02:42 +02:00
Hannah Lyons eb20ba1aaa feat(libc): implement __fpclassifyf 2026-10-09 15:30:00 -04:00
journaltraces 668a1e6f72 feat(libc): implement ldiv
RetroArch (PPSA99169) imports ldiv from libSceLibcInternal, one of the
absent imports #1578 lists for it. The guest long is 64-bit, so the
export takes std::int64_t and returns lldiv_t, which has the guest
ldiv_t layout; std::ldiv would truncate on Windows, where long is 32-bit.
2026-10-09 00:22:57 +03:00
Claude 2a253b376b
fix(libc): raise FE_INVALID from hypotf for a signaling NaN with infinity
hypotf now widens both arguments to double and calls the double hypot.
The float-to-double conversion raises FE_INVALID for a signaling NaN and
quiets it, so hypotf(sNaN, inf) returns +inf with the invalid flag set in
either argument order, matching the PS5 libc routine. Before, MinGW UCRT's
hypotf returned +inf without the flag and glibc's returned NaN.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scr6DkuJDqiUcJHr9mJv6T
2026-10-08 02:27:31 +00:00
MathiasDevelopes e84f43aceb feat(libc): implement hypot and hypotf
Both forward to std::hypot, which computes without intermediate
overflow and returns infinity when either argument is infinite, even
if the other is NaN. The math test checks those cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 19:10:07 +02:00
Nicolas Abosch 7789c0a57b feat(libs): implement homebrew libc and kernel runtime exports 2026-10-05 22:40:16 -03:00
Dean 66db1930c7
Merge pull request #729 from adriadam10/feat/libc-fdtest-finf-fnan
feat(libc): implement _FDtest, _FInf and _FNan
2026-10-06 08:02:17 +13:00
Adrià Franch 68b71c971a feat(libc): implement _FDtest, _FInf and _FNan
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 20:10:34 +02:00
Adrià Franch ce4bdbf2eb feat(libc): strtoimax and logbf
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:22:12 +02:00
Pouare514 1c724c0228 feat(libs): Cyberpunk 2077 loading support (REDGalaxy + stubs)
# Conflicts:
#	core/libs/prx/libSceContentExport/Export.cpp
#	core/libs/prx/libScePlayGoDialog/Export.cpp
2026-10-02 23:14:04 +03:00
devilismyfriend a503d0b617 Merge remote-tracking branch 'origin/main' into feat/demons-souls-boot
Brings in main up to 9958d26 (homebrew runtime, POSIX wrappers in
libkernel, sce_module guest modules and --skip-sce-module, the --to-intel
general pipeline, libSceRandom, libSceRtc, libScePosixForWebKit,
libRenoirCore, test wiring).

Resolutions where both sides implemented the same thing:
- libkernel pthread: main's structure (lazy static initialisation,
  destroyed markers, MutexOperations/CondOperations, mutex protocol and
  condattr clock) with this branch's TimedWait deadlines and condition
  (precise timed lock/wait on Windows), wait tracing, the adaptive mutex
  type 4, POSIX default ERRORCHECK mutexes, EDEADLK/EPERM results instead
  of throws, and condition clocks honoured for absolute timeouts.
- libc locale: the guest Dinkumware ABI (_Locimp, facet vtables, short
  ctype/case tables, locale ids, stream storage) is kept because guest code
  inlines those layouts; main's C character functions are kept on top.
- libc stdio/strings/math: main's stream functions (guest FILE status
  sync), strerror/perror, remove, formatting, string and math exports win
  over this branch's duplicates.
- libc paths: main's working directory with this branch's path aliases
  resolved on the normalised guest path.
- libkernel file: this branch's sceKernel* results as SCE errors, main's
  POSIX wrappers and both fstat helpers.
- relinker: this branch's stub lowering keeps its trampolines through the
  main executable path; guest modules refuse lowerings that need stubs.
- AGC driver: main's rendering wait is executed by this branch's workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 10:52:21 -07:00
devilismyfriend f3ac61000d feat(runtime): guest arena, kernel thread/sync/file APIs, crash hooks
- libc: reserve guest memory in one arena below the PS5 map limit with
  MEM_WRITE_WATCH (GuestArena) and a caching guest heap; the allocation
  registry gains a generation counter, an invalidator callback for the
  driver's page cache and a pin waiter for leased ranges. This replaces
  the fault-based GuestMemoryTracking/GuestMemoryBacking layer, whose
  files are removed.
- libkernel: mmap/mprotect/munmap on the arena, flexible memory budget,
  real sceKernelVirtualQuery; POSIX pthread layer, rwlocks, timed locks,
  TSD, event flags; 0.5 ms scheduler tick and high-resolution sleeps;
  TSC/clock/time functions; file APIs return SCE errno codes; the APR
  file-streaming API.
- libc: vectored crash reporter with backtraces for fatal exceptions,
  SIGABRT, UCRT invalid parameters and process exit; SSE4a EXTRQ/INSERTQ
  emulation for Intel hosts; %ls/%lc/%S/%C with the guest's 16-bit
  wchar_t; hand-written setjmp/longjmp for the guest jmp_buf; a path
  alias table for short save-data mount points; more string, stdio and
  math exports.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-25 16:27:49 -07:00
SamG-Coder c7d26dda5e feat(libc): add missing guest math exports and 64-bit rounding 2026-09-25 06:54:49 +10:00
boykopovar 9a4c8eab8b fix(libc): update locale signatures + add sysv abi to math funcs 2026-09-24 22:57:49 +03:00
boykopovar 67b778055a refactor(libs): use local cmakelists in libc 2026-09-11 12:22:19 +03:00
boykopovar abc72da741 feat(libs): define vabi macros + add to declarations 2026-09-10 08:07:03 +03:00
boykopovar 6123893998 feat(libs): throw not impl ex in every stub 2026-09-06 15:05:04 +03:00
boykopovar 9ac0798c09 feat(libc): add new std functions 2026-09-05 19:13:39 +03:00
boykopovar 5a1d7525f9 feat(libs): libc impl (wip) 2026-08-22 16:00:29 +03:00