Repository navigation
feat(libc): export std::setprecision(int) - #11233
Conversation
Dinkumware's setprecision returns the same two-register manipulator as setw: the function pointer in RAX and the precision value in RDX. The function stores the argument at ios_base offset 0x1c, leaving flags and width alone. Disassembled from the libc.prx bundled in PPSA02530's sce_module, where _ZSt12setprecisioni (NID 1h8hFQghR7w) returns a pointer to 'mov %esi,0x1c(%rdi); ret' and has the same 10-byte export shape as _ZSt4setwi. Negative and zero values are stored unchanged; a null stream throws.
Progress report (b90d009 → 93b0c59)➖ System libraries: 50.09% (+0.0%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 93b0c598706ac58645f7db2c7558859c70aaf19f. The new export follows the existing setw manipulator representation and updates only the measured IosBase::precision field; the focused test covers preservation of adjacent state, guard bytes, zero/negative inputs, and null-stream failure. git diff --check and current-main conventions pass; Linux register-context and relinker/ASan checks pass, with macOS and Windows jobs still pending. I could not run the full product target locally: the available build is relinker-only, and the repository rejected the manual full-build dispatch with HTTP 403. The author reports the focused guest_locale test passing on Linux; I did not independently rerun it.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows run of this head
AI-assisted: yes (Claude Code) |
What
Export
std::setprecision(int)(_ZSt12setprecisioni, NID1h8hFQghR7w). Dinkumware'ssetprecisionreturns the same 16-byte manipulator assetw: the setter goes in RAX and the 32-bit precision in RDX. The setter writesios_base::precisionat offset 0x1c, leaving flags and width alone.Evidence: disassembled the
libc.prxbundled in PPSA02530'ssce_module.1h8hFQghR7wis a 10-byte export that returnsmov %esi,0x1c(%rdi); retin RAX and the argument in EDX._ZSt4setwihas the same shape and writes 0x20 (width); both offsets are now pinned withstatic_assertinGuestLocale.hpp.Tested
ctest -R '^guest_locale$'(Linux, CachyOS, GCC 16.2.1): passed.CheckStreamPrecisioncovers the manipulator pair, the precision write, flags/width untouched, zero and negative values, guard bytes and the null-stream throw.nm -D --defined-only build/core/libs/libs/libc.prx | grep 1h8hFQghR7w: exported.main(base0a0ed7216), Minecraft Legends PPSA05510 used to stop atundefined symbol: 1h8hFQghR7w; it then stopped atundefined symbol: 8SDojuZyQaY(std::error_category::default_error_condition), so this import resolves and the title reaches the next known gap.python3 tools/check_conventions.py --base origin/main: pass.python3 tools/pr_overlap.py --branch feat/libc-setprecision --jobs 32: no overlap. Four open PRs share files but could not be compared because they conflict with the base (fix(libs): share Sony CRT handler and lconv state between libc and libSceAmpr #7081, feat(libc): add std::__sce_v2::_Random_device, _Fiopen and setw #9526, refactor(libSceLibcInternal): serve siginterrupt from libSceLibcInternal #10749, feat(libc): implement _Thrd_lt #10788); checked by hand, none implements or declaressetprecision.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)