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.
. Fixed bug #79489 (.user.ini does not inherit). (cmb)
. Fixed bug #79600 (Regression in 7.4.6 when yielding an array based
generator). (Nikita)
+ . Fixed bug #79595 (zend_init_fpu() alters FPU precision). (cmb, Nikita)
- FFI:
. Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb)
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)) {
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));
}
ZEND_API void zend_ensure_fpu_mode(void) /* {{{ */
{
+#ifndef __SSE__
XPFPA_DECLARE
XPFPA_SWITCH_DOUBLE();
+#endif
}
/* }}} */