feat(libc): implement __fpclassifyf #1987
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1987"
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 babyhuey on 2026-10-09T03:43:14Z.
What
Implements
__fpclassifyf(z7aCCd9hMsI) in libc, as FreeBSDlib/libc/gen/fpclassify.cdoes: it classifies the IEEE single by its exponent and fraction bits and returns FreeBSD's<math.h>values,FP_INFINITE0x01,FP_NAN0x02,FP_NORMAL0x04,FP_SUBNORMAL0x08 andFP_ZERO0x10, not the host's. Titles import it fromlibSceLibcInternal.Why
It is a title's next stop on current
main: PPSA99764 Porpoise stops on it on Linux and Windows.mainf1451396app.elf: symbol lookup error: app.elf: undefined symbol: z7aCCd9hMsIundefined symbol: 7p7kTAJcuGg(__inet_addr, #1972)FAIL: unresolved ELF import z7aCCd9hMsI from libSceLibcInternal.prxTested
Linux (Ubuntu 24.04, GCC 13, Release):
guest_mathpasses with--repeat until-fail:3. The existing_FDtestcase table (both zeros, the smallest and largest subnormals, normals, both infinities, quiet and signalling NaNs) now also checks__fpclassifyfagainst the FreeBSD constants. The test fails when the zero and subnormal results are swapped.check_conventions.pypasses. Windows:Math.cppcompiles with MinGW-w64 GCC 13 (-Wall -Wextra -fsyntax-only).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T04:05:49Z.
Review: COMMENTED
Reviewed the full diff: the bit masks correctly distinguish signed zero/subnormal/normal/infinity/NaN and return the FreeBSD constants rather than host
FP_*values. The test reuses the existing IEEE boundary table, including both zero signs, subnormal endpoints, both infinities, and quiet/signalling NaNs. No code issue found. All three upstream workflows currently showaction_required, so a maintainer must approve them before the checks can validate this head.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-09T04:28:31Z.
Until the upstream workflows are approved: the same build.yml passes on my fork for this exact head (d5b231b): https://github.com/babyhuey/AnyPS5/actions/runs/37880560237
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T06:06:54Z.
Review: APPROVED
Reviewed the full diff and confirmed the classification masks return the FreeBSD values independently of the host FP_* constants. The test checks signed zeros, subnormal boundaries, normal values, infinities, and quiet/signaling NaNs. I built and ran the exact head on Linux with GCC 12: guest_math passed (1/1); conventions and diff checks pass. PR #1784 changes the double/long-double classifiers in the same files but adds different exports, so this is not duplicate work. Upstream checks have no results yet; the fork workflow evidence in the description is not an upstream check.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T08:55:20Z.
Progress report (
8b393b6→eb20ba1)📈 System libraries: 84.7% (+0.01%, +1 implemented functions)
✅ 1 implemented
__fpclassifyf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:53:46Z.
Checked on Linux: build and
guest_mathpass; without the change the test doesn't link. The masks and the returned constants (0x01 infinite, 0x02 NaN, 0x04 normal, 0x08 subnormal, 0x10 zero) match FreeBSDfpclassify.c, and the test reuses the existing_FDtestboundary table (both zeros, subnormal limits, infinities, quiet/signalling NaN). Merging.