feat(libc): implement floating-point prefix helpers #9772
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9772"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by UnhealthyKraken on 2026-10-22T14:08:34Z.
What
Implement
_Stopfxand_WStopfxin the common libc provider. They classify a floating-point prefix and update the input cursor without converting the number or consuming its digits. Decimal/hexadecimal paths leave the optional end pointer unchanged; NaN/infinity update it, including rollback on an incomplete keyword. NaN discards a leading minus flag; infinity retains it.Names/NIDs are in the PS5 3.20 inventory. Behavior follows pinned Dinkumware V6 xstopfx.c and xwstopfx.c. Sony signatures/configuration, locale equivalence and module/library versions remain unmeasured; the wide helper uses the existing 16-bit guest string ABI. Unknown null-input behavior remains unsupported.
The review revision removes CheckUnsupported and its calls, retaining valid-prefix, cursor/end-pointer, case/payload, guarded-read and concurrent coverage. Public declarations now live once in libc's API header; the implementation uses that header for its classifiers as required by current main.
Tested
Review revision
14b096d3d68406aeccc7b56f510f0d8616447cb1, based on main47f9cee2cd77by history-preserving merge.Hosted Linux actual project configure/focused build passed with matching source-built libraries: all four narrow/wide raw/patched tests pass once plus two repetitions each. Conventions, whitespace, public-header audit and standalone libc/kernel header compilation pass. Linux job. Windows final-head actual project configure/affected-target build passed on hosted WinLibs GCC 15.2 Release with matching runtime libraries: 4/4 focused tests, followed by two repetitions each. Windows job. Git-only mergeability against later fetched main
504ea3b53b23is clean; that later combined tree was not built.Original Windows regression-first evidence used identical executables: four missing-export failures/three existing passes on baseline, then 7/7 on candidate, plus a NaN-sign negative control and restored pass. The reference/guest locale and firmware-equivalence limitations remain in debt.
No local builds/runtime tests, games, proprietary modules or physical-console execution were performed for this revision. The full repository suite was not run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:39:45Z.
Review: APPROVED
I compared
ParsePrefixwith the pinned Dinkumware_Stopfxand_WStopfximplementations: sign flags, decimal/hex lookahead, special-token rollback, NaN payload handling and the end-pointer write cases match. The narrow classifier receives an unsigned byte; the wide helper uses the documented guest UTF-16 path. The test covers malformed and mixed-case prefixes, cursor/end-pointer behavior, all narrow payload bytes, guard-page reads and concurrent calls, with a negative control and a separately compiled reference harness.Current-main merge-tree, diff-check and conventions are clean; the intervening main commits do not touch these parser or registration paths. Hosted conventions, relinker/ASan, write-watch and the register-context matrix pass. To be precise, the register-context job is a separate test suite and does not run
guest_floating_prefix; Linux/Windows product jobs are skipped. The Windows raw/patched focused run and Linux reference comparison in the PR are author-reported. I did not run a local libc build because there is no configured build here and less than 1 GB free on disk. I found no implementation duplicate or actionable code issue.Imported from boykopovar/AnyPS5. Originally posted by UnhealthyKraken on 2026-10-22T14:43:40Z.
Thank you for the source review and precise validation boundaries. I have kept the pinned Dinkumware contract separate from unmeasured Sony behavior, and the focused author-run raw/patched regression results separate from hosted register-context/relinker checks. No additional code change is needed for this review. The full Linux/Windows product jobs remain skipped; your review did not claim a local libc build. This completes the current follow-up pass before the requested wider-audit pause.