fix(libc): powf(1, y) returns 1 for any y #3602
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3602"
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 CouchRiv on 2026-10-11T14:08:48Z.
What
powf(1.0f, y)withythe signalling NaN0x7f800001returns the quieted NaN0x7fc00001and raisesFE_INVALIDonmain; FreeBSD msun returns1.0f(0x3f800000) for everyy, NaN included, and raises nothing (e_powf.c#L71-L75). A quiet NaNyalready gives1.0fonmain.powfnow returns1.0fwhenever the base is1.0f, without calling the host function, so the signalling-NaN case no longer raisesFE_INVALIDeither (as in msun). Every other input still goes to the host function.Also changes: flags (
powf(1.0f, sNaN)no longer raisesFE_INVALID, as in msun).Tested
CachyOS Linux, RTX 4070 Ti (NVIDIA) and Radeon 610M (RADV), lavapipe for CI parity.
powf_nid_postfixchecks fail onmainand pass with the change; 1/1 on NVIDIA, RADV and lavapipe.tools/check_conventions.py --base origin/mainandgit diff --check: clean.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)AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:20:11Z.
Independent pre-review on Linux (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.tools/check_conventions.py --base origin/mainpasses.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:18:55Z.
Conflicts with main in
core/libs/tests/GuestMath.cppsince #3599; please rebase.Imported from boykopovar/AnyPS5. Originally posted by CouchRiv on 2026-10-13T00:38:13Z.
Rebased onto
mainat1c5e62878. The conflict was two new test functions next to each other inGuestMath.cpp; both are kept (CheckExp2Errnofrom main andCheckPowfSpecialValue). The fix is unchanged.Tested: Release, gcc,
ctest -R guest_mathpassed on NVIDIA, RADV and lavapipe;tools/check_conventions.pypasses.