Rebase against 65d917402f43d6c061668cff811f5fd6729d5750.

This commit is contained in:
Alistair Leslie-Hughes 2020-11-19 14:27:17 +11:00
parent 0192a7b36c
commit 7734f7a808
3 changed files with 39 additions and 38 deletions

View File

@ -1,4 +1,4 @@
From 478753ef290789114c84c9c7a037206e4d5443f0 Mon Sep 17 00:00:00 2001
From e4fa62af575322bf44df531caaaf92fe6b0e7329 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 10 Apr 2015 07:51:16 +0200
Subject: [PATCH] msvcrt: Calculate sinh/cosh/exp/pow with higher precision.
@ -6,16 +6,17 @@ Subject: [PATCH] msvcrt: Calculate sinh/cosh/exp/pow with higher precision.
Based on a patch by Zheng Chen.
---
dlls/msvcrt/math.c | 61 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 58 insertions(+), 3 deletions(-)
dlls/msvcrt/math.c | 2 ++
dlls/msvcrt/unixlib.c | 61 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 59b6a984878..11ba649a947 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -69,6 +69,61 @@ static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
static BOOL sse2_supported;
static BOOL sse2_enabled;
diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c
index edc3d96af4a..ec2a313b892 100644
--- a/dlls/msvcrt/unixlib.c
+++ b/dlls/msvcrt/unixlib.c
@@ -41,6 +41,61 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+
@ -72,36 +73,36 @@ index 59b6a984878..11ba649a947 100644
+
+#endif
+
void msvcrt_init_math(void)
{
sse2_supported = sse2_enabled = IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE );
@@ -557,7 +612,7 @@ double CDECL MSVCRT_cos( double x )
/*********************************************************************
* acosh
*/
double CDECL MSVCRT_cosh( double x )
@@ -165,7 +220,7 @@ static float CDECL unix_ceilf( float x )
*/
static double CDECL unix_cos( double x )
{
- double ret = cosh(x);
+ double ret = precise_cosh(x);
if (isnan(x)) return math_error(_DOMAIN, "cosh", x, 0, ret);
return ret;
- return cos( x );
+ return precise_cosh( x );
}
@@ -567,7 +622,7 @@ double CDECL MSVCRT_cosh( double x )
/*********************************************************************
@@ -253,7 +308,7 @@ static float CDECL unix_erfcf(float x)
*/
double CDECL MSVCRT_exp( double x )
static double CDECL unix_exp( double x )
{
- double ret = exp(x);
+ double ret = precise_exp(x);
if (isnan(x)) return math_error(_DOMAIN, "exp", x, 0, ret);
if (isfinite(x) && !ret) return math_error(_UNDERFLOW, "exp", x, 0, ret);
if (isfinite(x) && !isfinite(ret)) return math_error(_OVERFLOW, "exp", x, 0, ret);
@@ -638,7 +693,7 @@ double CDECL MSVCRT_sin( double x )
*/
double CDECL MSVCRT_sinh( double x )
{
- double ret = sinh(x);
+ double ret = precise_sinh(x);
if (isnan(x)) return math_error(_DOMAIN, "sinh", x, 0, ret);
return ret;
- return exp( x );
+ return precise_exp( x );
}
/*********************************************************************
@@ -860,7 +915,7 @@ static float CDECL unix_sinf( float x )
*/
static double CDECL unix_sinh( double x )
{
- return sinh( x );
+ return precise_sinh( x );
}
/*********************************************************************
--
2.27.0
2.29.2

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "764a93f121c6b0f88c3444454ebb85eb7cb63295"
echo "65d917402f43d6c061668cff811f5fd6729d5750"
}
# Show version information
@ -2843,7 +2843,7 @@ fi
# | * [#37149] Calculate msvcrt exponential math operations with higher precision
# |
# | Modified files:
# | * dlls/msvcrt/math.c
# | * dlls/msvcrt/math.c, dlls/msvcrt/unixlib.c
# |
if test "$enable_msvcrt_Math_Precision" -eq 1; then
patch_apply msvcrt-Math_Precision/0001-msvcrt-Calculate-sinh-cosh-exp-pow-with-higher-preci.patch

View File

@ -1 +1 @@
764a93f121c6b0f88c3444454ebb85eb7cb63295
65d917402f43d6c061668cff811f5fd6729d5750