···5959#define _PC_24 0x00020000
6060#define _PC_53 0x00010000
6161#define _PC_64 0x00000000
6262+#define _DN_SAVE 0x00000000
6363+#define _DN_FLUSH 0x01000000
6464+#define _DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000
6565+#define _DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000
62666367/* These are also defined in Mingw math.h, needed to work around
6468 GCC build issues. */
+23
sdk/lib/crt/float/amd64/_clearfp.c
···11+/*
22+ * PROJECT: ReactOS CRT
33+ * LICENSE: MIT (https://spdx.org/licenses/MIT)
44+ * PURPOSE: x64 implementation of _clearfp
55+ * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer@reactos.org>
66+ */
77+88+#include <float.h>
99+#include <xmmintrin.h>
1010+1111+unsigned int __cdecl _clearfp(void)
1212+{
1313+ unsigned int retval;
1414+1515+ /* Get current status value */
1616+ retval = _statusfp();
1717+1818+ /* Clear the exception mask */
1919+ _mm_setcsr(_mm_getcsr() & ~_MM_EXCEPT_MASK);
2020+2121+ /* Return the previous state */
2222+ return retval;
2323+}
+39
sdk/lib/crt/float/amd64/_control87.c
···11+/*
22+ * PROJECT: ReactOS CRT
33+ * LICENSE: MIT (https://spdx.org/licenses/MIT)
44+ * PURPOSE: Implementation of _control87
55+ * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer@reactos.org>
66+ */
77+88+#include <xmmintrin.h>
99+#include <float.h>
1010+1111+unsigned int _get_native_fpcw(void);
1212+void _set_native_fpcw(unsigned int value);
1313+unsigned int _fpcw_native_to_abstract(unsigned int native);
1414+unsigned int _fpcw_abstract_to_native(unsigned int abstract);
1515+1616+unsigned int __cdecl _control87(unsigned int newval, unsigned int mask)
1717+{
1818+ unsigned int native, oldval, updated;
1919+2020+ /* Sanatize the mask */
2121+ mask &= _MCW_DN | _MCW_EM | _MCW_RC;
2222+2323+ /* Get native control word */
2424+ native = _get_native_fpcw();
2525+2626+ /* Convert to abstract */
2727+ oldval = _fpcw_native_to_abstract(native);
2828+2929+ /* Update it according to the given parameters */
3030+ updated = (oldval & ~mask) | (newval & mask);
3131+3232+ /* Convert back to native */
3333+ native = _fpcw_abstract_to_native(updated);
3434+3535+ /* Set the native value */
3636+ _set_native_fpcw(native);
3737+3838+ return updated;
3939+}
+13
sdk/lib/crt/float/amd64/_controlfp.c
···11+/*
22+ * PROJECT: ReactOS CRT
33+ * LICENSE: MIT (https://spdx.org/licenses/MIT)
44+ * PURPOSE: x64 implementation of _controlfp
55+ * COPYRIGHT: Copyright 2022 Timo Kreuzer <timo.kreuzer@reactos.org>
66+ */
77+88+#include <float.h>
99+1010+unsigned int __cdecl _controlfp(unsigned int newval, unsigned int mask)
1111+{
1212+ return _control87(newval, mask & ~_EM_DENORMAL);
1313+}