https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7277e269440cb0474629e…
commit 7277e269440cb0474629e8cb9d60b6c06cba094a
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Fri Jun 24 20:21:17 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Dec 1 15:21:59 2022 +0200
[LIBM] Fix ldexp.c / ldexpf.c
---
sdk/lib/crt/math/libm_sse2/ldexp.c | 14 +++++++++++---
sdk/lib/crt/math/libm_sse2/ldexpf.c | 14 +++++++++++---
sdk/lib/crt/math/libm_sse2/libm_util.h | 8 ++++++++
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/sdk/lib/crt/math/libm_sse2/ldexp.c b/sdk/lib/crt/math/libm_sse2/ldexp.c
index 3724e7d6bdc..95cc0f0025f 100644
--- a/sdk/lib/crt/math/libm_sse2/ldexp.c
+++ b/sdk/lib/crt/math/libm_sse2/ldexp.c
@@ -25,9 +25,17 @@
*
*/
-#include "fn_macros.h"
-#include "libm_util_amd.h"
-#include "libm_special.h"
+#include "libm.h"
+#include "libm_util.h"
+#include "libm_new.h"
+
+#define FN_PROTOTYPE_REF FN_PROTOTYPE
+#define __amd_handle_error _handle_error
+#define __amd_ldexp OP_LDEXP
+
+//#include "fn_macros.h"
+//#include "libm_util.h"
+//#include "libm_special.h"
double FN_PROTOTYPE_REF(ldexp)(double x, int n)
{
diff --git a/sdk/lib/crt/math/libm_sse2/ldexpf.c b/sdk/lib/crt/math/libm_sse2/ldexpf.c
index 49b9ac1b396..989f368c06d 100644
--- a/sdk/lib/crt/math/libm_sse2/ldexpf.c
+++ b/sdk/lib/crt/math/libm_sse2/ldexpf.c
@@ -25,9 +25,17 @@
*
*/
-#include "fn_macros.h"
-#include "libm_util_amd.h"
-#include "libm_special.h"
+#include "libm.h"
+#include "libm_util.h"
+#include "libm_new.h"
+
+#define FN_PROTOTYPE_REF FN_PROTOTYPE
+#define __amd_handle_errorf _handle_errorf
+#define __amd_ldexp OP_LDEXP
+
+//#include "fn_macros.h"
+//#include "libm_util_amd.h"
+//#include "libm_special.h"
float FN_PROTOTYPE_REF(ldexpf)(float x, int n)
{
diff --git a/sdk/lib/crt/math/libm_sse2/libm_util.h
b/sdk/lib/crt/math/libm_sse2/libm_util.h
index 0dde14a3637..c59a4940aff 100644
--- a/sdk/lib/crt/math/libm_sse2/libm_util.h
+++ b/sdk/lib/crt/math/libm_sse2/libm_util.h
@@ -32,6 +32,14 @@
#include <float.h>
+#define MULTIPLIER_SP 24
+#define MULTIPLIER_DP 53
+
+static const double VAL_2PMULTIPLIER_DP = 9007199254740992.0;
+static const double VAL_2PMMULTIPLIER_DP = 1.1102230246251565404236316680908e-16;
+static const float VAL_2PMULTIPLIER_SP = 16777216.0F;
+static const float VAL_2PMMULTIPLIER_SP = 5.9604645e-8F;
+
/* Definitions for double functions on 64 bit machines */
#define SIGNBIT_DP64 0x8000000000000000
#define EXPBITS_DP64 0x7ff0000000000000