Skip to content

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Zend/zend_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

ZEND_API void zend_init_fpu(void) /* {{{ */
{
#if XPFPA_HAVE_CW
/* under __SSE__ the FPCW is irrelevant; no need to change it */
#if XPFPA_HAVE_CW && !defined(__SSE__)
XPFPA_DECLARE

if (!EG(saved_fpu_cw_ptr)) {
Expand All @@ -38,7 +39,7 @@ ZEND_API void zend_init_fpu(void) /* {{{ */

ZEND_API void zend_shutdown_fpu(void) /* {{{ */
{
#if XPFPA_HAVE_CW
#if XPFPA_HAVE_CW && !defined(__SSE__)
if (EG(saved_fpu_cw_ptr)) {
XPFPA_RESTORE_CW(EG(saved_fpu_cw_ptr));
}
Expand All @@ -49,8 +50,10 @@ ZEND_API void zend_shutdown_fpu(void) /* {{{ */

ZEND_API void zend_ensure_fpu_mode(void) /* {{{ */
{
#ifndef __SSE__
XPFPA_DECLARE

XPFPA_SWITCH_DOUBLE();
#endif
}
/* }}} */