Skip to content

Commit c0920e6

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #79595: zend_init_fpu() alters FPU precision
2 parents f4b4631 + 88dfc47 commit c0920e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Zend/zend_float.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
ZEND_API void zend_init_fpu(void) /* {{{ */
2424
{
25-
#if XPFPA_HAVE_CW
25+
/* under __SSE__ the FPCW is irrelevant; no need to change it */
26+
#if XPFPA_HAVE_CW && !defined(__SSE__)
2627
XPFPA_DECLARE
2728

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

3940
ZEND_API void zend_shutdown_fpu(void) /* {{{ */
4041
{
41-
#if XPFPA_HAVE_CW
42+
#if XPFPA_HAVE_CW && !defined(__SSE__)
4243
if (EG(saved_fpu_cw_ptr)) {
4344
XPFPA_RESTORE_CW(EG(saved_fpu_cw_ptr));
4445
}
@@ -49,8 +50,10 @@ ZEND_API void zend_shutdown_fpu(void) /* {{{ */
4950

5051
ZEND_API void zend_ensure_fpu_mode(void) /* {{{ */
5152
{
53+
#ifndef __SSE__
5254
XPFPA_DECLARE
5355

5456
XPFPA_SWITCH_DOUBLE();
57+
#endif
5558
}
5659
/* }}} */

0 commit comments

Comments
 (0)