https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4d50f8141925c1fb3cb1c37b94fe7c8ddc464dcc

commit 4d50f8141925c1fb3cb1c37b94fe7c8ddc464dcc
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Sun Jun 12 20:01:53 2022 +0200
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Thu Dec 1 15:21:59 2022 +0200

    [CRT] Implement _set_statfp
---
 sdk/lib/crt/math/amd64/_set_statfp.c | 15 +++++++++++++++
 sdk/lib/crt/math/math.cmake          |  1 +
 2 files changed, 16 insertions(+)

diff --git a/sdk/lib/crt/math/amd64/_set_statfp.c 
b/sdk/lib/crt/math/amd64/_set_statfp.c
new file mode 100644
index 00000000000..0bf0f62973e
--- /dev/null
+++ b/sdk/lib/crt/math/amd64/_set_statfp.c
@@ -0,0 +1,15 @@
+/*
+ * PROJECT:     ReactOS CRT library
+ * LICENSE:     MIT (https://spdx.org/licenses/MIT)
+ * PURPOSE:     x64 implementation of _set_statfp
+ * COPYRIGHT:   Copyright 2022 Timo Kreuzer <[email protected]>
+ */
+
+#include <xmmintrin.h>
+
+__ATTRIBUTE_SSE__
+void _set_statfp(uintptr_t mask)
+{
+    unsigned int csr = _mm_getcsr();
+    _mm_setcsr((mask & _MM_EXCEPT_MASK) | csr);
+}
diff --git a/sdk/lib/crt/math/math.cmake b/sdk/lib/crt/math/math.cmake
index 7cc7a795447..e50d2bfa680 100644
--- a/sdk/lib/crt/math/math.cmake
+++ b/sdk/lib/crt/math/math.cmake
@@ -53,6 +53,7 @@ if(ARCH STREQUAL "i386")
     )
 elseif(ARCH STREQUAL "amd64")
     list(APPEND LIBCNTPR_MATH_SOURCE
+        math/amd64/_set_statfp.c
         math/ceil.c
         math/cos.c
         math/sin.c

Reply via email to