This is one of the new -f suffixed C99 math functions that actually are available on all architectures, even on i386.
Signed-off-by: Martin Storsjo [email protected] --- .../api-ms-win-crt-math-l1-1-0.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcrt/math.c | 32 +++++++++---------- dlls/ucrtbase/ucrtbase.spec | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index 3a5991f124..bc281ca530 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -242,7 +242,7 @@ @ cdecl floor(double) ucrtbase.floor @ cdecl -arch=arm,x86_64,arm64 floorf(float) ucrtbase.floorf @ cdecl fma(double double double) ucrtbase.fma -@ cdecl -arch=arm,x86_64,arm64 fmaf(float float float) ucrtbase.fmaf +@ cdecl fmaf(float float float) ucrtbase.fmaf @ stub fmal @ cdecl fmax(double double) ucrtbase.fmax @ cdecl fmaxf(float float) ucrtbase.fmaxf diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 97072112af..dc887b7f1c 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2165,7 +2165,7 @@ @ cdecl floor(double) MSVCRT_floor @ cdecl -arch=arm,x86_64,arm64 floorf(float) MSVCRT_floorf @ cdecl fma(double double double) MSVCRT_fma -@ cdecl -arch=arm,x86_64,arm64 fmaf(float float float) MSVCRT_fmaf +@ cdecl fmaf(float float float) MSVCRT_fmaf @ stub fmal @ cdecl fmax(double double) MSVCR120_fmax @ cdecl fmaxf(float float) MSVCR120_fmaxf diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 9b7727e233..c56d1a92d6 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1831,7 +1831,7 @@ @ cdecl floor(double) msvcr120.floor @ cdecl -arch=arm,x86_64,arm64 floorf(float) msvcr120.floorf @ cdecl fma(double double double) msvcr120.fma -@ cdecl -arch=arm,x86_64,arm64 fmaf(float float float) msvcr120.fmaf +@ cdecl fmaf(float float float) msvcr120.fmaf @ stub fmal @ cdecl fmax(double double) msvcr120.fmax @ cdecl fmaxf(float float) msvcr120.fmaxf diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 63744e33e3..c29539e0e2 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -387,22 +387,6 @@ float CDECL MSVCRT_floorf( float x ) return floorf(x); }
-/********************************************************************* - * fmaf (MSVCRT.@) - */ -float CDECL MSVCRT_fmaf( float x, float y, float z ) -{ -#ifdef HAVE_FMAF - float w = fmaf(x, y, z); -#else - float w = x * y + z; -#endif - if ((isinf(x) && y == 0) || (x == 0 && isinf(y))) *MSVCRT__errno() = MSVCRT_EDOM; - else if (isinf(x) && isinf(z) && x != z) *MSVCRT__errno() = MSVCRT_EDOM; - else if (isinf(y) && isinf(z) && y != z) *MSVCRT__errno() = MSVCRT_EDOM; - return w; -} - /********************************************************************* * frexpf (MSVCRT.@) */ @@ -895,6 +879,22 @@ double CDECL MSVCRT_fma( double x, double y, double z ) return w; }
+/********************************************************************* + * fmaf (MSVCRT.@) + */ +float CDECL MSVCRT_fmaf( float x, float y, float z ) +{ +#ifdef HAVE_FMAF + float w = fmaf(x, y, z); +#else + float w = x * y + z; +#endif + if ((isinf(x) && y == 0) || (x == 0 && isinf(y))) *MSVCRT__errno() = MSVCRT_EDOM; + else if (isinf(x) && isinf(z) && x != z) *MSVCRT__errno() = MSVCRT_EDOM; + else if (isinf(y) && isinf(z) && y != z) *MSVCRT__errno() = MSVCRT_EDOM; + return w; +} + /********************************************************************* * fabs (MSVCRT.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 567f2009eb..e290c14f3b 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2306,7 +2306,7 @@ @ cdecl floor(double) MSVCRT_floor @ cdecl -arch=arm,x86_64,arm64 floorf(float) MSVCRT_floorf @ cdecl fma(double double double) MSVCRT_fma -@ cdecl -arch=arm,x86_64,arm64 fmaf(float float float) MSVCRT_fmaf +@ cdecl fmaf(float float float) MSVCRT_fmaf @ stub fmal @ cdecl fmax(double double) MSVCR120_fmax @ cdecl fmaxf(float float) MSVCR120_fmaxf
Signed-off-by: Martin Storsjo [email protected] --- dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index bc281ca530..9eb3059b0d 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -243,7 +243,7 @@ @ cdecl -arch=arm,x86_64,arm64 floorf(float) ucrtbase.floorf @ cdecl fma(double double double) ucrtbase.fma @ cdecl fmaf(float float float) ucrtbase.fmaf -@ stub fmal +@ cdecl fmal(double double double) ucrtbase.fmal @ cdecl fmax(double double) ucrtbase.fmax @ cdecl fmaxf(float float) ucrtbase.fmaxf @ cdecl fmaxl(double double) ucrtbase.fmaxl diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index dc887b7f1c..26d698317e 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2166,7 +2166,7 @@ @ cdecl -arch=arm,x86_64,arm64 floorf(float) MSVCRT_floorf @ cdecl fma(double double double) MSVCRT_fma @ cdecl fmaf(float float float) MSVCRT_fmaf -@ stub fmal +@ cdecl fmal(double double double) MSVCRT_fma @ cdecl fmax(double double) MSVCR120_fmax @ cdecl fmaxf(float float) MSVCR120_fmaxf @ cdecl fmaxl(double double) MSVCR120_fmax diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index c56d1a92d6..3ca90c32ea 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1832,7 +1832,7 @@ @ cdecl -arch=arm,x86_64,arm64 floorf(float) msvcr120.floorf @ cdecl fma(double double double) msvcr120.fma @ cdecl fmaf(float float float) msvcr120.fmaf -@ stub fmal +@ cdecl fmal(double double double) msvcr120.fmal @ cdecl fmax(double double) msvcr120.fmax @ cdecl fmaxf(float float) msvcr120.fmaxf @ cdecl fmaxl(double double) msvcr120.fmaxl diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index e290c14f3b..6609683a4a 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2307,7 +2307,7 @@ @ cdecl -arch=arm,x86_64,arm64 floorf(float) MSVCRT_floorf @ cdecl fma(double double double) MSVCRT_fma @ cdecl fmaf(float float float) MSVCRT_fmaf -@ stub fmal +@ cdecl fmal(double double double) MSVCRT_fma @ cdecl fmax(double double) MSVCR120_fmax @ cdecl fmaxf(float float) MSVCR120_fmaxf @ cdecl fmaxl(double double) MSVCR120_fmax
Signed-off-by: Piotr Caban [email protected]
Signed-off-by: Martin Storsjo [email protected] --- configure.ac | 2 ++ .../api-ms-win-crt-math-l1-1-0.spec | 6 ++--- dlls/msvcr120/msvcr120.spec | 6 ++--- dlls/msvcr120_app/msvcr120_app.spec | 6 ++--- dlls/msvcrt/math.c | 26 +++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 6 ++--- 6 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac index a7c45ace73..086357be5e 100644 --- a/configure.ac +++ b/configure.ac @@ -2677,6 +2677,8 @@ AC_CHECK_FUNCS(\ rintf \ round \ roundf \ + tgamma \ + tgammaf \ trunc \ truncf \ y0 \ diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index 9eb3059b0d..736ffc6cc2 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -333,9 +333,9 @@ @ cdecl -arch=arm,x86_64,arm64 tanf(float) ucrtbase.tanf @ cdecl tanh(double) ucrtbase.tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) ucrtbase.tanhf -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) ucrtbase.tgamma +@ cdecl tgammaf(float) ucrtbase.tgammaf +@ cdecl tgammal(double) ucrtbase.tgammal @ cdecl trunc(double) ucrtbase.trunc @ cdecl truncf(float) ucrtbase.truncf @ cdecl truncl(double) ucrtbase.truncl diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 26d698317e..0204982533 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2405,9 +2405,9 @@ @ cdecl -arch=arm,x86_64,arm64 tanf(float) MSVCRT_tanf @ cdecl tanh(double) MSVCRT_tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) MSVCRT_tanhf -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) MSVCR120_tgamma +@ cdecl tgammaf(float) MSVCR120_tgammaf +@ cdecl tgammal(double) MSVCR120_tgamma @ cdecl tmpfile() MSVCRT_tmpfile @ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s @ cdecl tmpnam(ptr) MSVCRT_tmpnam diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 3ca90c32ea..499beeae5f 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -2067,9 +2067,9 @@ @ cdecl -arch=arm,x86_64,arm64 tanf(float) msvcr120.tanf @ cdecl tanh(double) msvcr120.tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) msvcr120.tanhf -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) msvcr120.tgamma +@ cdecl tgammaf(float) msvcr120.tgammaf +@ cdecl tgammal(double) msvcr120.tgammal @ cdecl tmpfile() msvcr120.tmpfile @ cdecl tmpfile_s(ptr) msvcr120.tmpfile_s @ cdecl tmpnam(ptr) msvcr120.tmpnam diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index c29539e0e2..3295c87c45 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -3380,6 +3380,32 @@ LDOUBLE CDECL MSVCR120_lgammal(LDOUBLE x) return MSVCR120_lgamma(x); }
+/********************************************************************* + * tgamma (MSVCR120.@) + */ +double CDECL MSVCR120_tgamma(double x) +{ +#ifdef HAVE_TGAMMA + return tgamma(x); +#else + FIXME( "not implemented\n" ); + return 0.0; +#endif +} + +/********************************************************************* + * tgammaf (MSVCR120.@) + */ +float CDECL MSVCR120_tgammaf(float x) +{ +#ifdef HAVE_TGAMMAF + return tgammaf(x); +#else + FIXME( "not implemented\n" ); + return 0.0f; +#endif +} + /********************************************************************* * nan (MSVCR120.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 6609683a4a..f1865c85ad 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2534,9 +2534,9 @@ @ cdecl tanh(double) MSVCRT_tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) MSVCRT_tanhf @ cdecl terminate() MSVCRT_terminate -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) MSVCR120_tgamma +@ cdecl tgammaf(float) MSVCR120_tgammaf +@ cdecl tgammal(double) MSVCR120_tgamma @ cdecl tmpfile() MSVCRT_tmpfile @ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s @ cdecl tmpnam(ptr) MSVCRT_tmpnam
Hi Martin,
On 7/30/19 11:08 PM, Martin Storsjo wrote:
+/*********************************************************************
tgamma (MSVCR120.@)
- */
+double CDECL MSVCR120_tgamma(double x) +{ +#ifdef HAVE_TGAMMA
- return tgamma(x);
+#else
- FIXME( "not implemented\n" );
- return 0.0;
+#endif +}
Isn't the function supposed to set error on invalid arguments?
Thanks, Piotr
On Thu, 1 Aug 2019, Piotr Caban wrote:
Hi Martin,
On 7/30/19 11:08 PM, Martin Storsjo wrote:
+/*********************************************************************
tgamma (MSVCR120.@)
- */
+double CDECL MSVCR120_tgamma(double x) +{ +#ifdef HAVE_TGAMMA
- return tgamma(x);
+#else
- FIXME( "not implemented\n" );
- return 0.0;
+#endif +}
Isn't the function supposed to set error on invalid arguments?
Yes, that's true. I'll add support for that.
FWIW, I believe setting of errno is missing in quite a few other math functions, at least lgamma to name one.
// Martin
Signed-off-by: Martin Storsjo [email protected] --- Now setting errno as it should, matching ucrt. --- configure.ac | 2 + .../api-ms-win-crt-math-l1-1-0.spec | 6 +-- dlls/msvcr120/msvcr120.spec | 6 +-- dlls/msvcr120_app/msvcr120_app.spec | 6 +-- dlls/msvcrt/math.c | 38 +++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 6 +-- 6 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac index a7c45ace73..086357be5e 100644 --- a/configure.ac +++ b/configure.ac @@ -2677,6 +2677,8 @@ AC_CHECK_FUNCS(\ rintf \ round \ roundf \ + tgamma \ + tgammaf \ trunc \ truncf \ y0 \ diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index 9eb3059b0d..736ffc6cc2 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -333,9 +333,9 @@ @ cdecl -arch=arm,x86_64,arm64 tanf(float) ucrtbase.tanf @ cdecl tanh(double) ucrtbase.tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) ucrtbase.tanhf -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) ucrtbase.tgamma +@ cdecl tgammaf(float) ucrtbase.tgammaf +@ cdecl tgammal(double) ucrtbase.tgammal @ cdecl trunc(double) ucrtbase.trunc @ cdecl truncf(float) ucrtbase.truncf @ cdecl truncl(double) ucrtbase.truncl diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 26d698317e..0204982533 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2405,9 +2405,9 @@ @ cdecl -arch=arm,x86_64,arm64 tanf(float) MSVCRT_tanf @ cdecl tanh(double) MSVCRT_tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) MSVCRT_tanhf -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) MSVCR120_tgamma +@ cdecl tgammaf(float) MSVCR120_tgammaf +@ cdecl tgammal(double) MSVCR120_tgamma @ cdecl tmpfile() MSVCRT_tmpfile @ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s @ cdecl tmpnam(ptr) MSVCRT_tmpnam diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 3ca90c32ea..499beeae5f 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -2067,9 +2067,9 @@ @ cdecl -arch=arm,x86_64,arm64 tanf(float) msvcr120.tanf @ cdecl tanh(double) msvcr120.tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) msvcr120.tanhf -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) msvcr120.tgamma +@ cdecl tgammaf(float) msvcr120.tgammaf +@ cdecl tgammal(double) msvcr120.tgammal @ cdecl tmpfile() msvcr120.tmpfile @ cdecl tmpfile_s(ptr) msvcr120.tmpfile_s @ cdecl tmpnam(ptr) msvcr120.tmpnam diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index c29539e0e2..7c8d273aa6 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -3380,6 +3380,44 @@ LDOUBLE CDECL MSVCR120_lgammal(LDOUBLE x) return MSVCR120_lgamma(x); }
+/********************************************************************* + * tgamma (MSVCR120.@) + */ +double CDECL MSVCR120_tgamma(double x) +{ +#ifdef HAVE_TGAMMA + if(x==0.0) *MSVCRT__errno() = MSVCRT_ERANGE; + if(x<0.0f) { + double integral; + if (modf(x, &integral) == 0) + *MSVCRT__errno() = MSVCRT_EDOM; + } + return tgamma(x); +#else + FIXME( "not implemented\n" ); + return 0.0; +#endif +} + +/********************************************************************* + * tgammaf (MSVCR120.@) + */ +float CDECL MSVCR120_tgammaf(float x) +{ +#ifdef HAVE_TGAMMAF + if(x==0.0f) *MSVCRT__errno() = MSVCRT_ERANGE; + if(x<0.0f) { + float integral; + if (modff(x, &integral) == 0) + *MSVCRT__errno() = MSVCRT_EDOM; + } + return tgammaf(x); +#else + FIXME( "not implemented\n" ); + return 0.0f; +#endif +} + /********************************************************************* * nan (MSVCR120.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 6609683a4a..f1865c85ad 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2534,9 +2534,9 @@ @ cdecl tanh(double) MSVCRT_tanh @ cdecl -arch=arm,x86_64,arm64 tanhf(float) MSVCRT_tanhf @ cdecl terminate() MSVCRT_terminate -@ stub tgamma -@ stub tgammaf -@ stub tgammal +@ cdecl tgamma(double) MSVCR120_tgamma +@ cdecl tgammaf(float) MSVCR120_tgammaf +@ cdecl tgammal(double) MSVCR120_tgamma @ cdecl tmpfile() MSVCRT_tmpfile @ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s @ cdecl tmpnam(ptr) MSVCRT_tmpnam
Signed-off-by: Piotr Caban [email protected]
Signed-off-by: Martin Storsjo [email protected] --- .../api-ms-win-crt-math-l1-1-0.spec | 6 ++--- dlls/msvcr120/msvcr120.spec | 6 ++--- dlls/msvcr120_app/msvcr120_app.spec | 6 ++--- dlls/msvcrt/math.c | 24 +++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 6 ++--- 5 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index 736ffc6cc2..eb7017f2f5 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -236,9 +236,9 @@ @ cdecl expm1l(double) ucrtbase.expm1l @ cdecl fabs(double) ucrtbase.fabs @ cdecl -arch=arm,arm64 fabsf(float) ucrtbase.fabsf -@ stub fdim -@ stub fdimf -@ stub fdiml +@ cdecl fdim(double double) ucrtbase.fdim +@ cdecl fdimf(float float) ucrtbase.fdimf +@ cdecl fdiml(double double) ucrtbase.fdiml @ cdecl floor(double) ucrtbase.floor @ cdecl -arch=arm,x86_64,arm64 floorf(float) ucrtbase.floorf @ cdecl fma(double double double) ucrtbase.fma diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 0204982533..469bc0100e 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2140,9 +2140,9 @@ @ cdecl fabs(double) MSVCRT_fabs @ cdecl -arch=arm,x86_64,arm64 fabsf(float) MSVCRT_fabsf @ cdecl fclose(ptr) MSVCRT_fclose -@ stub fdim -@ stub fdimf -@ stub fdiml +@ cdecl fdim(double double) MSVCR120_fdim +@ cdecl fdimf(float float) MSVCR120_fdimf +@ cdecl fdiml(double double) MSVCR120_fdim @ stub feclearexcept @ cdecl fegetenv(ptr) MSVCRT_fegetenv @ stub fegetexceptflag diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 499beeae5f..f9e3a0087f 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1806,9 +1806,9 @@ @ cdecl fabs(double) msvcr120.fabs @ cdecl -arch=arm,x86_64,arm64 fabsf(float) msvcr120.fabsf @ cdecl fclose(ptr) msvcr120.fclose -@ stub fdim -@ stub fdimf -@ stub fdiml +@ cdecl fdim(double double) msvcr120.fdim +@ cdecl fdimf(float float) msvcr120.fdimf +@ cdecl fdiml(double double) msvcr120.fdiml @ stub feclearexcept @ cdecl fegetenv(ptr) msvcr120.fegetenv @ stub fegetexceptflag diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 3295c87c45..ef7b1bb3fa 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -3023,6 +3023,30 @@ double CDECL MSVCR120_fmax(double x, double y) return x<y ? y : x; }
+/********************************************************************* + * fdimf (MSVCR120.@) + */ +float CDECL MSVCR120_fdimf(float x, float y) +{ + if(isnan(x)) + return x; + if(isnan(y)) + return y; + return x>y ? x-y : 0; +} + +/********************************************************************* + * fdim (MSVCR120.@) + */ +double CDECL MSVCR120_fdim(double x, double y) +{ + if(isnan(x)) + return x; + if(isnan(y)) + return y; + return x>y ? x-y : 0; +} + /********************************************************************* * _fdsign (MSVCR120.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index f1865c85ad..2a5fdf2893 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2283,9 +2283,9 @@ @ cdecl fabs(double) MSVCRT_fabs @ cdecl -arch=arm,arm64 fabsf(float) MSVCRT_fabsf @ cdecl fclose(ptr) MSVCRT_fclose -@ stub fdim -@ stub fdimf -@ stub fdiml +@ cdecl fdim(double double) MSVCR120_fdim +@ cdecl fdimf(float float) MSVCR120_fdimf +@ cdecl fdiml(double double) MSVCR120_fdim @ stub feclearexcept @ cdecl fegetenv(ptr) MSVCRT_fegetenv @ stub fegetexceptflag
On Wed, 31 Jul 2019, Martin Storsjo wrote:
Signed-off-by: Martin Storsjo [email protected]
.../api-ms-win-crt-math-l1-1-0.spec | 6 ++--- dlls/msvcr120/msvcr120.spec | 6 ++--- dlls/msvcr120_app/msvcr120_app.spec | 6 ++--- dlls/msvcrt/math.c | 24 +++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 6 ++--- 5 files changed, 36 insertions(+), 12 deletions(-)
FWIW, ucrt doesn't seem to set errno in any case for fdim*, so this one should be fine as is.
// Martin
Signed-off-by: Piotr Caban [email protected]