fix(libc): choose the acosf NaN bits instead of the host libm #5256
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5256"
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 adriadam10 on 2026-10-13T15:46:33Z.
What
guest_mathhas failed on everymainpush build since #3688:CheckAcosfErrnopinsacosf(2.0f)to0xffc00000, andacosfhanded the NaN to the hoststd::acos. Our glibc 2.44 returns0xffc00000, but the runner's glibc 2.39 doesn't.This change picks the bits explicitly, following FreeBSD msun
e_acosf.c, which returns(x-x)/(x-x)for|x| > 1and for NaN inputs:|x| > 1(including ±inf), it returns the x86 default NaN0xffc00000.In-domain inputs still go to
std::acos, and errno stays untouched.Tested
The change is a 6-line rewrite of the NaN path only. Merged without waiting for CI to unblock
main; the next push build onmainis the check.