fix(libc): return the x86 default NaN from acosf for |x| > 1 #5154
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5154"
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 coltken95 on 2026-10-13T13:03:29Z.
What
guest_mathfails on Linux at currentmain(0f2683cb7):CheckAcosfErrnofrom #3688 pinsacosf(±2.0f)to0xffc00000, FreeBSD's(x-x)/(x-x)on x86, butacosfpassed out-of-range arguments to the host, and glibc 2.39 (ubuntu-latest) returns0x7fc00000.acosfnow raisesFE_INVALIDand returns the negative quiet NaN for |x| > 1, asasindoes.Tested
Linux x86-64 (Ubuntu 24.04, glibc 2.39, GCC 13, Release):
guest_mathaborts with main'sMath.cppand passes with this change; the test now also covers ±infinity andFE_INVALID.guest_*tests matchmain.Windows not tested.
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 repositoryguest_mathonmain)Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T13:13:17Z.
Windows check, since the description covers Linux only: Windows 11 (26300), WinLibs GCC 15.2.0 (UCRT), Release. Head
c8872b450merged ontomain0f2683cb7with a clean merge.ctest -R '^guest_math$': 1/1 passed. That includes the new ±infinity andFE_INVALIDchecks.ctest -R '^guest_' -j 4: 379/379 passed.On unmodified
main,guest_mathalready passes here, because UCRT'sacosreturns0xffc00000for |x| > 1. So the redmainis Linux-only, and with this PR both hosts agree.Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T18:22:27Z.
Superseded by #5256, which merged the same fix (FreeBSD's 0xffc00000 for |x| > 1, plus the quieted input NaN) into main. Closing.
AI-assisted: yes (Claude Code)
Pull request closed