Repository navigation
feat(libc): implement __fpclassifyf - #1987
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
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 show action_required, so a maintainer must approve them before the checks can validate this head.
|
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 |
MarcZX10
left a comment
There was a problem hiding this comment.
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.
d5b231b to
e53d4d9
Compare
e53d4d9 to
eb20ba1
Compare
|
Checked on Linux: build and |
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.mainf145139app.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)