-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix #79595: zend_init_fpu() alters FPU precision #5602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
On startup, PHP deliberately changes the floating point control word to enforce binary64 format for the calculations for best consistency across platforms. However, this is unnessary when compiling under `__SSE__`, because in this case the x87 instructions are not used. Therefore, we can skip the modification, which has the benefit that system libraries are free to work in the mode of their liking.
I suggest to apply this as bug fix. Maybe we should postpone to master. |
I'm okay with landing this on 7.4, at least I don't see any obvious complications this would cause. |
There are failures on master due to this change. The issue is that we compile with |
I've temporarily reverted this change. I think the basic approach here is still right, but we need to be smarter about detecting whether the FPU will be used or not. I don't think there is any macro that tells us, so probably the next best thing is to check whether we're on x86_64, which always has SSE2. In that case it's still possible to opt-in to x87 using |
Thanks, Nikita, I'll have a look. |
Superseded by PR #5621. |
Just checking an idea of @nikic.