From: Piotr Caban piotr@codeweavers.com
--- dlls/msvcp140_2/msvcp140_2.spec | 132 +++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 44 deletions(-)
diff --git a/dlls/msvcp140_2/msvcp140_2.spec b/dlls/msvcp140_2/msvcp140_2.spec index c59da9aba9c..0c10d213c4b 100644 --- a/dlls/msvcp140_2/msvcp140_2.spec +++ b/dlls/msvcp140_2/msvcp140_2.spec @@ -1,44 +1,88 @@ -@ stub __std_smf_assoc_laguerre -@ stub __std_smf_assoc_laguerref -@ stub __std_smf_assoc_legendre -@ stub __std_smf_assoc_legendref -@ stub __std_smf_beta -@ stub __std_smf_betaf -@ stub __std_smf_comp_ellint_1 -@ stub __std_smf_comp_ellint_1f -@ stub __std_smf_comp_ellint_2 -@ stub __std_smf_comp_ellint_2f -@ stub __std_smf_comp_ellint_3 -@ stub __std_smf_comp_ellint_3f -@ stub __std_smf_cyl_bessel_i -@ stub __std_smf_cyl_bessel_if -@ stub __std_smf_cyl_bessel_j -@ stub __std_smf_cyl_bessel_jf -@ stub __std_smf_cyl_bessel_k -@ stub __std_smf_cyl_bessel_kf -@ stub __std_smf_cyl_neumann -@ stub __std_smf_cyl_neumannf -@ stub __std_smf_ellint_1 -@ stub __std_smf_ellint_1f -@ stub __std_smf_ellint_2 -@ stub __std_smf_ellint_2f -@ stub __std_smf_ellint_3 -@ stub __std_smf_ellint_3f -@ stub __std_smf_expint -@ stub __std_smf_expintf -@ stub __std_smf_hermite -@ stub __std_smf_hermitef -@ stub __std_smf_hypot3 -@ stub __std_smf_hypot3f -@ stub __std_smf_laguerre -@ stub __std_smf_laguerref -@ stub __std_smf_legendre -@ stub __std_smf_legendref -@ stub __std_smf_riemann_zeta -@ stub __std_smf_riemann_zetaf -@ stub __std_smf_sph_bessel -@ stub __std_smf_sph_besself -@ stub __std_smf_sph_legendre -@ stub __std_smf_sph_legendref -@ stub __std_smf_sph_neumann -@ stub __std_smf_sph_neumannf +@ stub -arch=i386 ___std_smf_assoc_laguerre@16 +@ stub -arch=!i386 __std_smf_assoc_laguerre +@ stub -arch=i386 ___std_smf_assoc_laguerref@12 +@ stub -arch=!i386 __std_smf_assoc_laguerref +@ stub -arch=i386 ___std_smf_assoc_legendre@16 +@ stub -arch=!i386 __std_smf_assoc_legendre +@ stub -arch=i386 ___std_smf_assoc_legendref@12 +@ stub -arch=!i386 __std_smf_assoc_legendref +@ stub -arch=i386 ___std_smf_beta@16 +@ stub -arch=!i386 __std_smf_beta +@ stub -arch=i386 ___std_smf_betaf@8 +@ stub -arch=!i386 __std_smf_betaf +@ stub -arch=i386 ___std_smf_comp_ellint_1@8 +@ stub -arch=!i386 __std_smf_comp_ellint_1 +@ stub -arch=i386 ___std_smf_comp_ellint_1f@4 +@ stub -arch=!i386 __std_smf_comp_ellint_1f +@ stub -arch=i386 ___std_smf_comp_ellint_2@8 +@ stub -arch=!i386 __std_smf_comp_ellint_2 +@ stub -arch=i386 ___std_smf_comp_ellint_2f@4 +@ stub -arch=!i386 __std_smf_comp_ellint_2f +@ stub -arch=i386 ___std_smf_comp_ellint_3@16 +@ stub -arch=!i386 __std_smf_comp_ellint_3 +@ stub -arch=i386 ___std_smf_comp_ellint_3f@8 +@ stub -arch=!i386 __std_smf_comp_ellint_3f +@ stub -arch=i386 ___std_smf_cyl_bessel_i@16 +@ stub -arch=!i386 __std_smf_cyl_bessel_i +@ stub -arch=i386 ___std_smf_cyl_bessel_if@8 +@ stub -arch=!i386 __std_smf_cyl_bessel_if +@ stub -arch=i386 ___std_smf_cyl_bessel_j@16 +@ stub -arch=!i386 __std_smf_cyl_bessel_j +@ stub -arch=i386 ___std_smf_cyl_bessel_jf@8 +@ stub -arch=!i386 __std_smf_cyl_bessel_jf +@ stub -arch=i386 ___std_smf_cyl_bessel_k@16 +@ stub -arch=!i386 __std_smf_cyl_bessel_k +@ stub -arch=i386 ___std_smf_cyl_bessel_kf@8 +@ stub -arch=!i386 __std_smf_cyl_bessel_kf +@ stub -arch=i386 ___std_smf_cyl_neumann@16 +@ stub -arch=!i386 __std_smf_cyl_neumann +@ stub -arch=i386 ___std_smf_cyl_neumannf@8 +@ stub -arch=!i386 __std_smf_cyl_neumannf +@ stub -arch=i386 ___std_smf_ellint_1@16 +@ stub -arch=!i386 __std_smf_ellint_1 +@ stub -arch=i386 ___std_smf_ellint_1f@8 +@ stub -arch=!i386 __std_smf_ellint_1f +@ stub -arch=i386 ___std_smf_ellint_2@16 +@ stub -arch=!i386 __std_smf_ellint_2 +@ stub -arch=i386 ___std_smf_ellint_2f@8 +@ stub -arch=!i386 __std_smf_ellint_2f +@ stub -arch=i386 ___std_smf_ellint_3@24 +@ stub -arch=!i386 __std_smf_ellint_3 +@ stub -arch=i386 ___std_smf_ellint_3f@12 +@ stub -arch=!i386 __std_smf_ellint_3f +@ stub -arch=i386 ___std_smf_expint@8 +@ stub -arch=!i386 __std_smf_expint +@ stub -arch=i386 ___std_smf_expintf@4 +@ stub -arch=!i386 __std_smf_expintf +@ stub -arch=i386 ___std_smf_hermite@12 +@ stub -arch=!i386 __std_smf_hermite +@ stub -arch=i386 ___std_smf_hermitef@8 +@ stub -arch=!i386 __std_smf_hermitef +@ stub -arch=i386 ___std_smf_hypot3@24 +@ stub -arch=!i386 __std_smf_hypot3 +@ stub -arch=i386 ___std_smf_hypot3f@12 +@ stub -arch=!i386 __std_smf_hypot3f +@ stub -arch=i386 ___std_smf_laguerre@12 +@ stub -arch=!i386 __std_smf_laguerre +@ stub -arch=i386 ___std_smf_laguerref@8 +@ stub -arch=!i386 __std_smf_laguerref +@ stub -arch=i386 ___std_smf_legendre@12 +@ stub -arch=!i386 __std_smf_legendre +@ stub -arch=i386 ___std_smf_legendref@8 +@ stub -arch=!i386 __std_smf_legendref +@ stub -arch=i386 ___std_smf_riemann_zeta@8 +@ stub -arch=!i386 __std_smf_riemann_zeta +@ stub -arch=i386 ___std_smf_riemann_zetaf@4 +@ stub -arch=!i386 __std_smf_riemann_zetaf +@ stub -arch=i386 ___std_smf_sph_bessel@12 +@ stub -arch=!i386 __std_smf_sph_bessel +@ stub -arch=i386 ___std_smf_sph_besself@8 +@ stub -arch=!i386 __std_smf_sph_besself +@ stub -arch=i386 ___std_smf_sph_legendre@16 +@ stub -arch=!i386 __std_smf_sph_legendre +@ stub -arch=i386 ___std_smf_sph_legendref@12 +@ stub -arch=!i386 __std_smf_sph_legendref +@ stub -arch=i386 ___std_smf_sph_neumann@12 +@ stub -arch=!i386 __std_smf_sph_neumann +@ stub -arch=i386 ___std_smf_sph_neumannf@8 +@ stub -arch=!i386 __std_smf_sph_neumannf
From: Alex Henrie alexhenrie24@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56078 --- dlls/msvcp140_2/Makefile.in | 3 +++ dlls/msvcp140_2/math.c | 26 ++++++++++++++++++++++++++ dlls/msvcp140_2/msvcp140_2.spec | 4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 dlls/msvcp140_2/math.c
diff --git a/dlls/msvcp140_2/Makefile.in b/dlls/msvcp140_2/Makefile.in index 5b4865db844..0f75819198f 100644 --- a/dlls/msvcp140_2/Makefile.in +++ b/dlls/msvcp140_2/Makefile.in @@ -1 +1,4 @@ MODULE = msvcp140_2.dll + +SOURCES = \ + math.c diff --git a/dlls/msvcp140_2/math.c b/dlls/msvcp140_2/math.c new file mode 100644 index 00000000000..d2909745a9d --- /dev/null +++ b/dlls/msvcp140_2/math.c @@ -0,0 +1,26 @@ +/* + * Special math functions + * + * Copyright 2024 Alex Henrie + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <math.h> + +double __stdcall __std_smf_hypot3(double x, double y, double z) +{ + return hypot(hypot(x, y), z); +} diff --git a/dlls/msvcp140_2/msvcp140_2.spec b/dlls/msvcp140_2/msvcp140_2.spec index 0c10d213c4b..fbc63fa5e28 100644 --- a/dlls/msvcp140_2/msvcp140_2.spec +++ b/dlls/msvcp140_2/msvcp140_2.spec @@ -58,8 +58,8 @@ @ stub -arch=!i386 __std_smf_hermite @ stub -arch=i386 ___std_smf_hermitef@8 @ stub -arch=!i386 __std_smf_hermitef -@ stub -arch=i386 ___std_smf_hypot3@24 -@ stub -arch=!i386 __std_smf_hypot3 +@ stdcall -arch=i386 ___std_smf_hypot3@24(double double double) __std_smf_hypot3 +@ stdcall -arch=!i386 __std_smf_hypot3(double double double) @ stub -arch=i386 ___std_smf_hypot3f@12 @ stub -arch=!i386 __std_smf_hypot3f @ stub -arch=i386 ___std_smf_laguerre@12
From: Piotr Caban piotr@codeweavers.com
--- dlls/msvcp140_2/math.c | 5 +++++ dlls/msvcp140_2/msvcp140_2.spec | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcp140_2/math.c b/dlls/msvcp140_2/math.c index d2909745a9d..aa8726d6b3e 100644 --- a/dlls/msvcp140_2/math.c +++ b/dlls/msvcp140_2/math.c @@ -24,3 +24,8 @@ double __stdcall __std_smf_hypot3(double x, double y, double z) { return hypot(hypot(x, y), z); } + +float __stdcall __std_smf_hypot3f(float x, float y, float z) +{ + return hypotf(hypotf(x, y), z); +} diff --git a/dlls/msvcp140_2/msvcp140_2.spec b/dlls/msvcp140_2/msvcp140_2.spec index fbc63fa5e28..bcc3ecfa7fd 100644 --- a/dlls/msvcp140_2/msvcp140_2.spec +++ b/dlls/msvcp140_2/msvcp140_2.spec @@ -60,8 +60,8 @@ @ stub -arch=!i386 __std_smf_hermitef @ stdcall -arch=i386 ___std_smf_hypot3@24(double double double) __std_smf_hypot3 @ stdcall -arch=!i386 __std_smf_hypot3(double double double) -@ stub -arch=i386 ___std_smf_hypot3f@12 -@ stub -arch=!i386 __std_smf_hypot3f +@ stdcall -arch=i386 ___std_smf_hypot3f@12(float float float) __std_smf_hypot3f +@ stdcall -arch=!i386 __std_smf_hypot3f(float float float) @ stub -arch=i386 ___std_smf_laguerre@12 @ stub -arch=!i386 __std_smf_laguerre @ stub -arch=i386 ___std_smf_laguerref@8
From: Piotr Caban piotr@codeweavers.com
--- configure.ac | 1 + dlls/msvcp140_2/tests/Makefile.in | 4 ++ dlls/msvcp140_2/tests/math.c | 80 +++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 dlls/msvcp140_2/tests/Makefile.in create mode 100644 dlls/msvcp140_2/tests/math.c
diff --git a/configure.ac b/configure.ac index 9488b3263cc..da661323375 100644 --- a/configure.ac +++ b/configure.ac @@ -2876,6 +2876,7 @@ WINE_CONFIG_MAKEFILE(dlls/msvcp140/tests) WINE_CONFIG_MAKEFILE(dlls/msvcp140_1) WINE_CONFIG_MAKEFILE(dlls/msvcp140_1/tests) WINE_CONFIG_MAKEFILE(dlls/msvcp140_2) +WINE_CONFIG_MAKEFILE(dlls/msvcp140_2/tests) WINE_CONFIG_MAKEFILE(dlls/msvcp140_atomic_wait) WINE_CONFIG_MAKEFILE(dlls/msvcp140_atomic_wait/tests) WINE_CONFIG_MAKEFILE(dlls/msvcp140_codecvt_ids) diff --git a/dlls/msvcp140_2/tests/Makefile.in b/dlls/msvcp140_2/tests/Makefile.in new file mode 100644 index 00000000000..3024ebdd358 --- /dev/null +++ b/dlls/msvcp140_2/tests/Makefile.in @@ -0,0 +1,4 @@ +TESTDLL = msvcp140_2.dll + +SOURCES = \ + math.c diff --git a/dlls/msvcp140_2/tests/math.c b/dlls/msvcp140_2/tests/math.c new file mode 100644 index 00000000000..0e2a28a981f --- /dev/null +++ b/dlls/msvcp140_2/tests/math.c @@ -0,0 +1,80 @@ +/* + * Special math functions + * + * Copyright 2024 Piotr Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/test.h" +#include <math.h> + +static double (__stdcall *p___std_smf_hypot3)(double x, double y, double z); + +#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp, y) +#define SET(x,y) do { SETNOFAIL(x, y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) +static BOOL init(void) +{ + HMODULE msvcp = LoadLibraryA("msvcp140_2.dll"); + + if (!msvcp) + { + win_skip("msvcp140_2.dll not installed\n"); + return FALSE; + } + +#ifdef __i386__ + SET(p___std_smf_hypot3, "___std_smf_hypot3@24"); +#else + SET(p___std_smf_hypot3, "__std_smf_hypot3"); +#endif + + return TRUE; +} + +static inline BOOL compare_double(double f, double g, unsigned int ulps) +{ + ULONGLONG x = *(ULONGLONG *)&f; + ULONGLONG y = *(ULONGLONG *)&g; + + if (f < 0) + x = ~x + 1; + else + x |= ((ULONGLONG)1) << 63; + if (g < 0) + y = ~y + 1; + else + y |= ((ULONGLONG)1) << 63; + + return (x > y ? x - y : y - x) <= ulps; +} + +static void test_hypot3(void) +{ + double r; + + r = p___std_smf_hypot3(0, 0, 0); + ok(compare_double(r, 0.0, 1), "r = %.23e\n", r); + + r = p___std_smf_hypot3(9, 12, 20); + ok(compare_double(r, 25.0, 1), "r = %.23e\n", r); +} + +START_TEST(math) +{ + init(); + + test_hypot3(); +}
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=142044
Your paranoid android.
=== w8 (32 bit report) ===
msvcp140_2: 0bec:math: unhandled exception c0000005 at 00000000
=== w8adm (32 bit report) ===
msvcp140_2: 0ac4:math: unhandled exception c0000005 at 00000000
=== w864 (32 bit report) ===
msvcp140_2: 0bf8:math: unhandled exception c0000005 at 00000000
=== w1064v1507 (32 bit report) ===
msvcp140_2: 0bd0:math: unhandled exception c0000005 at 00000000
=== w1064v1809 (32 bit report) ===
msvcp140_2: 1fb0:math: unhandled exception c0000005 at 00000000
=== w1064_tsign (32 bit report) ===
msvcp140_2: 1928:math: unhandled exception c0000005 at 00000000
=== w7pro64 (64 bit report) ===
msvcp140_2: 08f8:math: unhandled exception c0000005 at 0000000000000000
=== w864 (64 bit report) ===
msvcp140_2: 0b38:math: unhandled exception c0000005 at 0000000000000000
=== w1064v1507 (64 bit report) ===
msvcp140_2: 0984:math: unhandled exception c0000005 at 0000000000000000
=== w1064v1809 (64 bit report) ===
msvcp140_2: 1f80:math: unhandled exception c0000005 at 0000000000000000
=== w1064_2qxl (64 bit report) ===
msvcp140_2: 1cc4:math: unhandled exception c0000005 at 0000000000000000
=== w1064_adm (64 bit report) ===
msvcp140_2: 1c50:math: unhandled exception c0000005 at 0000000000000000
=== w1064_tsign (64 bit report) ===
msvcp140_2: 1f1c:math: unhandled exception c0000005 at 0000000000000000