feat(libSceLibcInternal): implement __truncdfhf2 #15822
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15822"
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 user236404 on 2026-11-04T18:02:31Z.
What
Implements
__truncdfhf2(libSceLibcInternal), compiler-rt's double-to-half conversion, which threw as a parameterless placeholder inRecoveredInventory.cpp. It converts as LLVM 19.1.7's compiler-rttruncdfhf2.candfp_trunc_impl.incdo:compiler-rt returns the result as
_Float16in XMM0 when built withCOMPILER_RT_HAS_FLOAT16and asuint16_tin AX otherwise (fp_trunc.h), and the console's module was not read. The export is therefore a short assembly entry, built likesigsetjmpinSignalSets.cpp, that calls the C++ conversion and returns the result in both AX and XMM0, so a caller built with either convention gets it.RecoveredInventory.hpptoinclude/Api.hppasstd::uint16_t __truncdfhf2(double).docs/dev/debt/libSceLibcInternal.md: new entry (return register unverified, both are set), recovered-inventory placeholder count cut from 21 to 20 (recounted fromRecoveredInventory.cpp).Tested
Rebased onto
main32b292ba38. Linux x86_64 (Fedora 45, i7-9700K), Release build with tests on. Titles, console and macOS: not run. Windows: see the two Windows runs in the comments (on the earlier heads).libSceLibcInternal/CMakeLists.txtregisters pass, including the newguest_libc_internal_half_precision(0.1 s); all 65public_headers*tests pass.tools/check_conventions.py --base upstream/main,tools/check_test_registration.pyandtools/check_main_sync.py --strictpass.tools/pr_overlap.py: no other open PR changes__truncdfhf2. #15577 (debt list line) and #15931 (CMakeLists.txtline) conflict only on neighbouring lines. #15581 shows the__truncdfhf2placeholder only as unchanged context.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)🤖 Generated with Claude Code