winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
770 discussions
Start a n
N
ew thread
Piotr Caban : msvcrt: Import cosh implementation from musl.
by Alexandre Julliard
31 May '21
31 May '21
Module: wine Branch: master Commit: b431d7515da309ff85e3677fe98fce2218c890ab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b431d7515da309ff85e3677f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat May 29 19:13:39 2021 +0200 msvcrt: Import cosh implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 231 ++++++++++++++++++++++++++++++-------------------- dlls/msvcrt/unixlib.c | 9 -- dlls/msvcrt/unixlib.h | 1 - 3 files changed, 137 insertions(+), 104 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 06f1dc26838..760f3834761 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2095,14 +2095,147 @@ double CDECL cos( double x ) } } +/* Copied from musl: src/math/expm1.c */ +static double CDECL __expm1(double x) +{ + static const double o_threshold = 7.09782712893383973096e+02, + ln2_hi = 6.93147180369123816490e-01, + ln2_lo = 1.90821492927058770002e-10, + invln2 = 1.44269504088896338700e+00, + Q1 = -3.33333333333331316428e-02, + Q2 = 1.58730158725481460165e-03, + Q3 = -7.93650757867487942473e-05, + Q4 = 4.00821782732936239552e-06, + Q5 = -2.01099218183624371326e-07; + + double y, hi, lo, c, t, e, hxs, hfx, r1, twopk; + union {double f; UINT64 i;} u = {x}; + UINT32 hx = u.i >> 32 & 0x7fffffff; + int k, sign = u.i >> 63; + + /* filter out huge and non-finite argument */ + if (hx >= 0x4043687A) { /* if |x|>=56*ln2 */ + if (isnan(x)) + return x; + if (isinf(x)) + return sign ? -1 : x; + if (sign) + return math_error(_UNDERFLOW, "exp", x, 0, -1); + if (x > o_threshold) + return math_error(_OVERFLOW, "exp", x, 0, x * 0x1p1023); + } + + /* argument reduction */ + if (hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if (hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ + if (!sign) { + hi = x - ln2_hi; + lo = ln2_lo; + k = 1; + } else { + hi = x + ln2_hi; + lo = -ln2_lo; + k = -1; + } + } else { + k = invln2 * x + (sign ? -0.5 : 0.5); + t = k; + hi = x - t * ln2_hi; /* t*ln2_hi is exact here */ + lo = t * ln2_lo; + } + x = hi - lo; + c = (hi - x) - lo; + } else if (hx < 0x3c900000) { /* |x| < 2**-54, return x */ + fp_barrier(x + 0x1p120f); + if (hx < 0x00100000) + fp_barrier((float)x); + return x; + } else + k = 0; + + /* x is now in primary range */ + hfx = 0.5 * x; + hxs = x * hfx; + r1 = 1.0 + hxs * (Q1 + hxs * (Q2 + hxs * (Q3 + hxs * (Q4 + hxs * Q5)))); + t = 3.0 - r1 * hfx; + e = hxs * ((r1 - t) / (6.0 - x * t)); + if (k == 0) /* c is 0 */ + return x - (x * e - hxs); + e = x * (e - c) - c; + e -= hxs; + /* exp(x) ~ 2^k (x_reduced - e + 1) */ + if (k == -1) + return 0.5 * (x - e) - 0.5; + if (k == 1) { + if (x < -0.25) + return -2.0 * (e - (x + 0.5)); + return 1.0 + 2.0 * (x - e); + } + u.i = (UINT64)(0x3ff + k) << 52; /* 2^k */ + twopk = u.f; + if (k < 0 || k > 56) { /* suffice to return exp(x)-1 */ + y = x - e + 1.0; + if (k == 1024) + y = y * 2.0 * 0x1p1023; + else + y = y * twopk; + return y - 1.0; + } + u.i = (UINT64)(0x3ff - k) << 52; /* 2^-k */ + if (k < 20) + y = (x - e + (1 - u.f)) * twopk; + else + y = (x - (e + u.f) + 1) * twopk; + return y; +} + +static double __expo2(double x, double sign) +{ + static const int k = 2043; + static const double kln2 = 0x1.62066151add8bp+10; + double scale; + + *(UINT64*)&scale = (UINT64)(0x3ff + k / 2) << 52; + return exp(x - kln2) * (sign * scale) * scale; +} + /********************************************************************* * cosh (MSVCRT.@) + * + * Copied from musl: src/math/cosh.c */ double CDECL cosh( double x ) { - double ret = unix_funcs->cosh( x ); - if (isnan(x)) return math_error(_DOMAIN, "cosh", x, 0, ret); - return ret; + UINT64 ux = *(UINT64*)&x; + UINT32 w; + double t; + + /* |x| */ + ux &= (uint64_t)-1 / 2; + x = *(double*)&ux; + w = ux >> 32; + + /* |x| < log(2) */ + if (w < 0x3fe62e42) { + if (w < 0x3ff00000 - (26 << 20)) { + fp_barrier(x + 0x1p120f); + return 1; + } + t = __expm1(x); + return 1 + t * t / (2 * (1 + t)); + } + + /* |x| < log(DBL_MAX) */ + if (w < 0x40862e42) { + t = exp(x); + /* note: if x>log(0x1p26) then the 1/t is not needed */ + return 0.5 * (t + 1 / t); + } + + /* |x| > log(DBL_MAX) or nan */ + /* note: the result is stored to handle overflow */ + t = __expo2(x, 1.0); + return t; } /********************************************************************* @@ -5758,100 +5891,10 @@ float CDECL exp2f(float x) /********************************************************************* * expm1 (MSVCR120.@) - * - * Copied from musl: src/math/expm1.c */ double CDECL expm1(double x) { - static const double o_threshold = 7.09782712893383973096e+02, - ln2_hi = 6.93147180369123816490e-01, - ln2_lo = 1.90821492927058770002e-10, - invln2 = 1.44269504088896338700e+00, - Q1 = -3.33333333333331316428e-02, - Q2 = 1.58730158725481460165e-03, - Q3 = -7.93650757867487942473e-05, - Q4 = 4.00821782732936239552e-06, - Q5 = -2.01099218183624371326e-07; - - double y, hi, lo, c, t, e, hxs, hfx, r1, twopk; - union {double f; UINT64 i;} u = {x}; - UINT32 hx = u.i >> 32 & 0x7fffffff; - int k, sign = u.i >> 63; - - /* filter out huge and non-finite argument */ - if (hx >= 0x4043687A) { /* if |x|>=56*ln2 */ - if (isnan(x)) - return x; - if (isinf(x)) - return sign ? -1 : x; - if (sign) - return math_error(_UNDERFLOW, "exp", x, 0, -1); - if (x > o_threshold) - return math_error(_OVERFLOW, "exp", x, 0, x * 0x1p1023); - } - - /* argument reduction */ - if (hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ - if (hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ - if (!sign) { - hi = x - ln2_hi; - lo = ln2_lo; - k = 1; - } else { - hi = x + ln2_hi; - lo = -ln2_lo; - k = -1; - } - } else { - k = invln2 * x + (sign ? -0.5 : 0.5); - t = k; - hi = x - t * ln2_hi; /* t*ln2_hi is exact here */ - lo = t * ln2_lo; - } - x = hi - lo; - c = (hi - x) - lo; - } else if (hx < 0x3c900000) { /* |x| < 2**-54, return x */ - fp_barrier(x + 0x1p120f); - if (hx < 0x00100000) - fp_barrier((float)x); - return x; - } else - k = 0; - - /* x is now in primary range */ - hfx = 0.5 * x; - hxs = x * hfx; - r1 = 1.0 + hxs * (Q1 + hxs * (Q2 + hxs * (Q3 + hxs * (Q4 + hxs * Q5)))); - t = 3.0 - r1 * hfx; - e = hxs * ((r1 - t) / (6.0 - x * t)); - if (k == 0) /* c is 0 */ - return x - (x * e - hxs); - e = x * (e - c) - c; - e -= hxs; - /* exp(x) ~ 2^k (x_reduced - e + 1) */ - if (k == -1) - return 0.5 * (x - e) - 0.5; - if (k == 1) { - if (x < -0.25) - return -2.0 * (e - (x + 0.5)); - return 1.0 + 2.0 * (x - e); - } - u.i = (UINT64)(0x3ff + k) << 52; /* 2^k */ - twopk = u.f; - if (k < 0 || k > 56) { /* suffice to return exp(x)-1 */ - y = x - e + 1.0; - if (k == 1024) - y = y * 2.0 * 0x1p1023; - else - y = y * twopk; - return y - 1.0; - } - u.i = (UINT64)(0x3ff - k) << 52; /* 2^-k */ - if (k < 20) - y = (x - e + (1 - u.f)) * twopk; - else - y = (x - (e + u.f) + 1) * twopk; - return y; + return __expm1(x); } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index c0c3a2b1636..6af252e5e9b 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -42,14 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); -/********************************************************************* - * cosh - */ -static double CDECL unix_cosh( double x ) -{ - return cosh( x ); -} - /********************************************************************* * coshf */ @@ -344,7 +336,6 @@ static float CDECL unix_tgammaf(float x) static const struct unix_funcs funcs = { - unix_cosh, unix_coshf, unix_exp, unix_expf, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 6f8347b066a..67dd1f98b84 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -23,7 +23,6 @@ struct unix_funcs { - double (CDECL *cosh)(double x); float (CDECL *coshf)(float x); double (CDECL *exp)(double x); float (CDECL *expf)(float x);
1
0
0
0
Piotr Caban : msvcrt: Import expm1f implementation from musl.
by Alexandre Julliard
31 May '21
31 May '21
Module: wine Branch: master Commit: 7d0d7690eb03330c16894d4e0bf5ca18335619ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7d0d7690eb03330c16894d4e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat May 29 19:13:36 2021 +0200 msvcrt: Import expm1f implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++-- dlls/msvcrt/unixlib.c | 13 -------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 -- 6 files changed, 84 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 75ac679a1d5..3f8b89d287d 100755 --- a/configure +++ b/configure @@ -19618,7 +19618,6 @@ fi for ac_func in \ exp2 \ exp2f \ - expm1f \ fma \ fmaf \ lgamma \ diff --git a/configure.ac b/configure.ac index 9d4e8278eed..7ea0d824cee 100644 --- a/configure.ac +++ b/configure.ac @@ -2658,7 +2658,6 @@ fi AC_CHECK_FUNCS(\ exp2 \ exp2f \ - expm1f \ fma \ fmaf \ lgamma \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index f9b2dc06d78..06f1dc26838 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5856,12 +5856,93 @@ double CDECL expm1(double x) /********************************************************************* * expm1f (MSVCR120.@) + * + * Copied from musl: src/math/expm1f.c */ float CDECL expm1f(float x) { - float ret = unix_funcs->expm1f( x ); - if (isfinite(x) && !isfinite(ret)) *_errno() = ERANGE; - return ret; + static const float ln2_hi = 6.9313812256e-01, + ln2_lo = 9.0580006145e-06, + invln2 = 1.4426950216e+00, + Q1 = -3.3333212137e-2, + Q2 = 1.5807170421e-3; + + float y, hi, lo, c, t, e, hxs, hfx, r1, twopk; + union {float f; UINT32 i;} u = {x}; + UINT32 hx = u.i & 0x7fffffff; + int k, sign = u.i >> 31; + + /* filter out huge and non-finite argument */ + if (hx >= 0x4195b844) { /* if |x|>=27*ln2 */ + if (hx >= 0x7f800000) /* NaN */ + return u.i == 0xff800000 ? -1 : x; + if (sign) + return math_error(_UNDERFLOW, "exp", x, 0, -1); + if (hx > 0x42b17217) /* x > log(FLT_MAX) */ + return math_error(_OVERFLOW, "exp", x, 0, fp_barrierf(x * FLT_MAX)); + } + + /* argument reduction */ + if (hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ + if (hx < 0x3F851592) { /* and |x| < 1.5 ln2 */ + if (!sign) { + hi = x - ln2_hi; + lo = ln2_lo; + k = 1; + } else { + hi = x + ln2_hi; + lo = -ln2_lo; + k = -1; + } + } else { + k = invln2 * x + (sign ? -0.5f : 0.5f); + t = k; + hi = x - t * ln2_hi; /* t*ln2_hi is exact here */ + lo = t * ln2_lo; + } + x = hi - lo; + c = (hi - x) - lo; + } else if (hx < 0x33000000) { /* when |x|<2**-25, return x */ + if (hx < 0x00800000) + fp_barrierf(x * x); + return x; + } else + k = 0; + + /* x is now in primary range */ + hfx = 0.5f * x; + hxs = x * hfx; + r1 = 1.0f + hxs * (Q1 + hxs * Q2); + t = 3.0f - r1 * hfx; + e = hxs * ((r1 - t) / (6.0f - x * t)); + if (k == 0) /* c is 0 */ + return x - (x * e - hxs); + e = x * (e - c) - c; + e -= hxs; + /* exp(x) ~ 2^k (x_reduced - e + 1) */ + if (k == -1) + return 0.5f * (x - e) - 0.5f; + if (k == 1) { + if (x < -0.25f) + return -2.0f * (e - (x + 0.5f)); + return 1.0f + 2.0f * (x - e); + } + u.i = (0x7f + k) << 23; /* 2^k */ + twopk = u.f; + if (k < 0 || k > 56) { /* suffice to return exp(x)-1 */ + y = x - e + 1.0f; + if (k == 128) + y = y * 2.0f * 0x1p127f; + else + y = y * twopk; + return y - 1.0f; + } + u.i = (0x7f-k) << 23; /* 2^-k */ + if (k < 23) + y = (x - e + (1 - u.f)) * twopk; + else + y = (x - (e + u.f) + 1) * twopk; + return y; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 3b0dcea9b47..c0c3a2b1636 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -98,18 +98,6 @@ static float CDECL unix_exp2f( float x ) #endif } -/********************************************************************* - * expm1f - */ -static float CDECL unix_expm1f(float x) -{ -#ifdef HAVE_EXPM1F - return expm1f(x); -#else - return exp(x) - 1; -#endif -} - /********************************************************************* * fma */ @@ -362,7 +350,6 @@ static const struct unix_funcs funcs = unix_expf, unix_exp2, unix_exp2f, - unix_expm1f, unix_fma, unix_fmaf, unix_frexp, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 01907623f6a..6f8347b066a 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -29,7 +29,6 @@ struct unix_funcs float (CDECL *expf)(float x); double (CDECL *exp2)(double x); float (CDECL *exp2f)(float x); - float (CDECL *expm1f)(float x); double (CDECL *fma)(double x, double y, double z); float (CDECL *fmaf)(float x, float y, float z); double (CDECL *frexp)(double x, int *exp); diff --git a/include/config.h.in b/include/config.h.in index 7ab23e1ab51..42aaa2708a8 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -98,9 +98,6 @@ /* Define to 1 if you have the `exp2f' function. */ #undef HAVE_EXP2F -/* Define to 1 if you have the `expm1f' function. */ -#undef HAVE_EXPM1F - /* Define to 1 if you have the `F3DAudioInitialize8' function. */ #undef HAVE_F3DAUDIOINITIALIZE8
1
0
0
0
Piotr Caban : msvcrt: Import expm1 implementation from musl.
by Alexandre Julliard
31 May '21
31 May '21
Module: wine Branch: master Commit: 5b025c7175d4adef5a35f65d685c3ca76630e6bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5b025c7175d4adef5a35f65d…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat May 29 19:13:28 2021 +0200 msvcrt: Import expm1 implementation from musl. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/msvcrt/math.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++-- dlls/msvcrt/unixlib.c | 13 ------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 -- 6 files changed, 91 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 0aa6e54804c..75ac679a1d5 100755 --- a/configure +++ b/configure @@ -19618,7 +19618,6 @@ fi for ac_func in \ exp2 \ exp2f \ - expm1 \ expm1f \ fma \ fmaf \ diff --git a/configure.ac b/configure.ac index 821b2bb092b..9d4e8278eed 100644 --- a/configure.ac +++ b/configure.ac @@ -2658,7 +2658,6 @@ fi AC_CHECK_FUNCS(\ exp2 \ exp2f \ - expm1 \ expm1f \ fma \ fmaf \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 732d2084285..f9b2dc06d78 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5758,12 +5758,100 @@ float CDECL exp2f(float x) /********************************************************************* * expm1 (MSVCR120.@) + * + * Copied from musl: src/math/expm1.c */ double CDECL expm1(double x) { - double ret = unix_funcs->expm1( x ); - if (isfinite(x) && !isfinite(ret)) *_errno() = ERANGE; - return ret; + static const double o_threshold = 7.09782712893383973096e+02, + ln2_hi = 6.93147180369123816490e-01, + ln2_lo = 1.90821492927058770002e-10, + invln2 = 1.44269504088896338700e+00, + Q1 = -3.33333333333331316428e-02, + Q2 = 1.58730158725481460165e-03, + Q3 = -7.93650757867487942473e-05, + Q4 = 4.00821782732936239552e-06, + Q5 = -2.01099218183624371326e-07; + + double y, hi, lo, c, t, e, hxs, hfx, r1, twopk; + union {double f; UINT64 i;} u = {x}; + UINT32 hx = u.i >> 32 & 0x7fffffff; + int k, sign = u.i >> 63; + + /* filter out huge and non-finite argument */ + if (hx >= 0x4043687A) { /* if |x|>=56*ln2 */ + if (isnan(x)) + return x; + if (isinf(x)) + return sign ? -1 : x; + if (sign) + return math_error(_UNDERFLOW, "exp", x, 0, -1); + if (x > o_threshold) + return math_error(_OVERFLOW, "exp", x, 0, x * 0x1p1023); + } + + /* argument reduction */ + if (hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if (hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ + if (!sign) { + hi = x - ln2_hi; + lo = ln2_lo; + k = 1; + } else { + hi = x + ln2_hi; + lo = -ln2_lo; + k = -1; + } + } else { + k = invln2 * x + (sign ? -0.5 : 0.5); + t = k; + hi = x - t * ln2_hi; /* t*ln2_hi is exact here */ + lo = t * ln2_lo; + } + x = hi - lo; + c = (hi - x) - lo; + } else if (hx < 0x3c900000) { /* |x| < 2**-54, return x */ + fp_barrier(x + 0x1p120f); + if (hx < 0x00100000) + fp_barrier((float)x); + return x; + } else + k = 0; + + /* x is now in primary range */ + hfx = 0.5 * x; + hxs = x * hfx; + r1 = 1.0 + hxs * (Q1 + hxs * (Q2 + hxs * (Q3 + hxs * (Q4 + hxs * Q5)))); + t = 3.0 - r1 * hfx; + e = hxs * ((r1 - t) / (6.0 - x * t)); + if (k == 0) /* c is 0 */ + return x - (x * e - hxs); + e = x * (e - c) - c; + e -= hxs; + /* exp(x) ~ 2^k (x_reduced - e + 1) */ + if (k == -1) + return 0.5 * (x - e) - 0.5; + if (k == 1) { + if (x < -0.25) + return -2.0 * (e - (x + 0.5)); + return 1.0 + 2.0 * (x - e); + } + u.i = (UINT64)(0x3ff + k) << 52; /* 2^k */ + twopk = u.f; + if (k < 0 || k > 56) { /* suffice to return exp(x)-1 */ + y = x - e + 1.0; + if (k == 1024) + y = y * 2.0 * 0x1p1023; + else + y = y * twopk; + return y - 1.0; + } + u.i = (UINT64)(0x3ff - k) << 52; /* 2^-k */ + if (k < 20) + y = (x - e + (1 - u.f)) * twopk; + else + y = (x - (e + u.f) + 1) * twopk; + return y; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 6d3a3bd5a79..3b0dcea9b47 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -98,18 +98,6 @@ static float CDECL unix_exp2f( float x ) #endif } -/********************************************************************* - * expm1 - */ -static double CDECL unix_expm1(double x) -{ -#ifdef HAVE_EXPM1 - return expm1(x); -#else - return exp(x) - 1; -#endif -} - /********************************************************************* * expm1f */ @@ -374,7 +362,6 @@ static const struct unix_funcs funcs = unix_expf, unix_exp2, unix_exp2f, - unix_expm1, unix_expm1f, unix_fma, unix_fmaf, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 06f0d6ec5c9..01907623f6a 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -29,7 +29,6 @@ struct unix_funcs float (CDECL *expf)(float x); double (CDECL *exp2)(double x); float (CDECL *exp2f)(float x); - double (CDECL *expm1)(double x); float (CDECL *expm1f)(float x); double (CDECL *fma)(double x, double y, double z); float (CDECL *fmaf)(float x, float y, float z); diff --git a/include/config.h.in b/include/config.h.in index 6ea3949541b..7ab23e1ab51 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -98,9 +98,6 @@ /* Define to 1 if you have the `exp2f' function. */ #undef HAVE_EXP2F -/* Define to 1 if you have the `expm1' function. */ -#undef HAVE_EXPM1 - /* Define to 1 if you have the `expm1f' function. */ #undef HAVE_EXPM1F
1
0
0
0
Austin English : readme: Document Libera Chat migration.
by Alexandre Julliard
31 May '21
31 May '21
Module: wine Branch: master Commit: d9a8be2a46063b5d9309e9e01bcd98826b53cef4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d9a8be2a46063b5d9309e9e0…
Author: Austin English <austinenglish(a)gmail.com> Date: Sat May 29 02:20:48 2021 -0500 readme: Document Libera Chat migration. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- README | 2 +- documentation/README.de | 2 +- documentation/README.es | 2 +- documentation/README.fi | 2 +- documentation/README.fr | 2 +- documentation/README.hu | 2 +- documentation/README.it | 2 +- documentation/README.ja | 2 +- documentation/README.ko | 2 +- documentation/README.nl | 2 +- documentation/README.no | 2 +- documentation/README.pt | 2 +- documentation/README.pt_br | 2 +- documentation/README.ru | 2 +- documentation/README.sv | 2 +- documentation/README.tr | 2 +- documentation/README.uk | 2 +- documentation/README.zh_cn | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d9a8be2a46063b5d9309…
1
0
0
0
Zebediah Figura : vkd3d-shader: Lower DIV to RCP + MUL for SM1.
by Alexandre Julliard
31 May '21
31 May '21
Module: vkd3d Branch: master Commit: 100c65c967704411b751fee17e9c0b165be9c6d7 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=100c65c967704411b751fee…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri May 21 00:32:24 2021 -0500 vkd3d-shader: Lower DIV to RCP + MUL for SM1. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl_codegen.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index b4ea839..afa096b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -388,6 +388,27 @@ static bool fold_constants(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, voi return true; } +/* Lower DIV to RCP + MUL. */ +static bool lower_division(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *rcp; + + if (instr->type != HLSL_IR_EXPR) + return false; + expr = hlsl_ir_expr(instr); + if (expr->op != HLSL_IR_BINOP_DIV) + return false; + + if (!(rcp = hlsl_new_unary_expr(ctx, HLSL_IR_UNOP_RCP, expr->operands[1].node, instr->loc))) + return false; + list_add_before(&expr->node.entry, &rcp->entry); + expr->op = HLSL_IR_BINOP_MUL; + hlsl_src_remove(&expr->operands[1]); + hlsl_src_from_node(&expr->operands[1], rcp); + return true; +} + static bool dce(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context) { switch (instr->type) @@ -1954,6 +1975,9 @@ int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun while (transform_ir(ctx, split_struct_copies, entry_func->body, NULL)); while (transform_ir(ctx, fold_constants, entry_func->body, NULL)); + if (ctx->profile->major_version < 4) + transform_ir(ctx, lower_division, entry_func->body, NULL); + do compute_liveness(ctx, entry_func); while (transform_ir(ctx, dce, entry_func->body, NULL));
1
0
0
0
Zebediah Figura : vkd3d-shader: Distinguish between resource exhaustion and invalid shaders when returning failure.
by Alexandre Julliard
31 May '21
31 May '21
Module: vkd3d Branch: master Commit: 6493953516f9c798f221da0f0cf0a58d97034798 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=6493953516f9c798f221da0…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri May 21 00:32:23 2021 -0500 vkd3d-shader: Distinguish between resource exhaustion and invalid shaders when returning failure. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 7 ++++--- libs/vkd3d-shader/hlsl.h | 10 +++++----- libs/vkd3d-shader/hlsl_codegen.c | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index f7e2ad5..441fd6c 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -39,7 +39,8 @@ void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, vkd3d_shader_verror(ctx->message_context, &loc, error, fmt, args); va_end(args); - ctx->failed = true; + if (!ctx->result) + ctx->result = VKD3D_ERROR_INVALID_SHADER; } void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, @@ -1648,10 +1649,10 @@ int hlsl_compile_shader(const struct vkd3d_shader_code *hlsl, const struct vkd3d return VKD3D_ERROR_OUT_OF_MEMORY; } - if (ctx.failed) + if (ctx.result) { hlsl_ctx_cleanup(&ctx); - return VKD3D_ERROR_INVALID_SHADER; + return ctx.result; } if (!(entry_func = hlsl_get_func_decl(&ctx, entry_point))) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 55665c1..4fe90a9 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -428,7 +428,7 @@ struct hlsl_ctx struct vkd3d_shader_location location; struct vkd3d_shader_message_context *message_context; struct vkd3d_string_buffer_cache string_buffers; - bool failed; + int result; void *scanner; @@ -544,7 +544,7 @@ static inline void *hlsl_alloc(struct hlsl_ctx *ctx, size_t size) void *ptr = vkd3d_calloc(1, size); if (!ptr) - ctx->failed = true; + ctx->result = VKD3D_ERROR_OUT_OF_MEMORY; return ptr; } @@ -553,7 +553,7 @@ static inline char *hlsl_strdup(struct hlsl_ctx *ctx, const char *string) char *ptr = vkd3d_strdup(string); if (!ptr) - ctx->failed = true; + ctx->result = VKD3D_ERROR_OUT_OF_MEMORY; return ptr; } @@ -563,7 +563,7 @@ static inline bool hlsl_array_reserve(struct hlsl_ctx *ctx, void **elements, bool ret = vkd3d_array_reserve(elements, capacity, element_count, element_size); if (!ret) - ctx->failed = true; + ctx->result = VKD3D_ERROR_OUT_OF_MEMORY; return ret; } @@ -572,7 +572,7 @@ static inline struct vkd3d_string_buffer *hlsl_get_string_buffer(struct hlsl_ctx struct vkd3d_string_buffer *ret = vkd3d_string_buffer_get(&ctx->string_buffers); if (!ret) - ctx->failed = true; + ctx->result = VKD3D_ERROR_OUT_OF_MEMORY; return ret; } diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 243deec..b4ea839 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1968,8 +1968,8 @@ int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun allocate_const_registers(ctx, entry_func); allocate_semantic_registers(ctx); - if (ctx->failed) - return VKD3D_ERROR_INVALID_SHADER; + if (ctx->result) + return ctx->result; if (ctx->profile->major_version < 4) return write_sm1_shader(ctx, entry_func, out);
1
0
0
0
Zebediah Figura : vkd3d-shader: Use the HLSL string buffer cache in hlsl_type_to_string() and hlsl_modifiers_to_string().
by Alexandre Julliard
31 May '21
31 May '21
Module: vkd3d Branch: master Commit: ba1cc670e68175e5506dfcc41ea0ad6df8d81eab URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=ba1cc670e68175e5506dfcc…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri May 21 00:32:22 2021 -0500 vkd3d-shader: Use the HLSL string buffer cache in hlsl_type_to_string() and hlsl_modifiers_to_string(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 66 +++++++++++++++++--------------------- libs/vkd3d-shader/hlsl.h | 10 +++--- libs/vkd3d-shader/hlsl.y | 68 ++++++++++++++++++++-------------------- libs/vkd3d-shader/hlsl_codegen.c | 9 ++++-- 4 files changed, 73 insertions(+), 80 deletions(-) Diff:
https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=ba1cc670e68175e5506…
1
0
0
0
Zebediah Figura : vkd3d-shader: Introduce HLSL string buffer helpers.
by Alexandre Julliard
31 May '21
31 May '21
Module: vkd3d Branch: master Commit: 4fe1e86310eeabd2ed49f25bb4f076a509cc881e URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=4fe1e86310eeabd2ed49f25…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri May 21 00:32:21 2021 -0500 vkd3d-shader: Introduce HLSL string buffer helpers. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.h | 14 ++++++++++++++ libs/vkd3d-shader/hlsl_codegen.c | 33 ++++++++++++--------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 3e7d244..3e6d1c3 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -567,6 +567,20 @@ static inline bool hlsl_array_reserve(struct hlsl_ctx *ctx, void **elements, return ret; } +static inline struct vkd3d_string_buffer *hlsl_get_string_buffer(struct hlsl_ctx *ctx) +{ + struct vkd3d_string_buffer *ret = vkd3d_string_buffer_get(&ctx->string_buffers); + + if (!ret) + ctx->failed = true; + return ret; +} + +static inline void hlsl_release_string_buffer(struct hlsl_ctx *ctx, struct vkd3d_string_buffer *buffer) +{ + vkd3d_string_buffer_release(&ctx->string_buffers, buffer); +} + const char *debug_hlsl_type(const struct hlsl_type *type) DECLSPEC_HIDDEN; const char *debug_hlsl_writemask(unsigned int writemask) DECLSPEC_HIDDEN; diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 1705529..84a47ed 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -42,14 +42,11 @@ static void prepend_uniform_copy(struct hlsl_ctx *ctx, struct list *instrs, stru uniform->is_uniform = 1; uniform->is_param = temp->is_param; - if (!(name = vkd3d_string_buffer_get(&ctx->string_buffers))) - { - ctx->failed = true; + if (!(name = hlsl_get_string_buffer(ctx))) return; - } vkd3d_string_buffer_printf(name, "<temp-%s>", temp->name); temp->name = hlsl_strdup(ctx, name->buffer); - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); if (!(load = hlsl_new_var_load(ctx, uniform, temp->loc))) return; @@ -70,25 +67,22 @@ static void prepend_input_copy(struct hlsl_ctx *ctx, struct list *instrs, struct struct hlsl_ir_load *load; struct hlsl_ir_var *input; - if (!(name = vkd3d_string_buffer_get(&ctx->string_buffers))) - { - ctx->failed = true; + if (!(name = hlsl_get_string_buffer(ctx))) return; - } vkd3d_string_buffer_printf(name, "<input-%s%u>", semantic->name, semantic->index); if (!(new_semantic.name = hlsl_strdup(ctx, semantic->name))) { - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); return; } new_semantic.index = semantic->index; if (!(input = hlsl_new_var(ctx, hlsl_strdup(ctx, name->buffer), type, var->loc, &new_semantic, 0, NULL))) { - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); vkd3d_free((void *)new_semantic.name); return; } - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); input->is_input_semantic = 1; input->is_param = var->is_param; list_add_before(&var->scope_entry, &input->scope_entry); @@ -144,25 +138,22 @@ static void append_output_copy(struct hlsl_ctx *ctx, struct list *instrs, struct struct hlsl_ir_var *output; struct hlsl_ir_load *load; - if (!(name = vkd3d_string_buffer_get(&ctx->string_buffers))) - { - ctx->failed = true; + if (!(name = hlsl_get_string_buffer(ctx))) return; - } vkd3d_string_buffer_printf(name, "<output-%s%u>", semantic->name, semantic->index); if (!(new_semantic.name = hlsl_strdup(ctx, semantic->name))) { - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); return; } new_semantic.index = semantic->index; if (!(output = hlsl_new_var(ctx, hlsl_strdup(ctx, name->buffer), type, var->loc, &new_semantic, 0, NULL))) { vkd3d_free((void *)new_semantic.name); - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); return; } - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); output->is_output_semantic = 1; output->is_param = var->is_param; list_add_before(&var->scope_entry, &output->scope_entry); @@ -1422,7 +1413,7 @@ static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct bytecode_buffer *buf { struct vkd3d_string_buffer *name; - if (!(name = vkd3d_string_buffer_get(&ctx->string_buffers))) + if (!(name = hlsl_get_string_buffer(ctx))) { buffer->status = VKD3D_ERROR_OUT_OF_MEMORY; return; @@ -1430,7 +1421,7 @@ static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct bytecode_buffer *buf vkd3d_string_buffer_printf(name, "$%s", var->name); vkd3d_free((char *)var->name); var->name = hlsl_strdup(ctx, name->buffer); - vkd3d_string_buffer_release(&ctx->string_buffers, name); + hlsl_release_string_buffer(ctx, name); } } }
1
0
0
0
Zebediah Figura : vkd3d-shader: Introduce HLSL allocation helpers.
by Alexandre Julliard
31 May '21
31 May '21
Module: vkd3d Branch: master Commit: 49726b0e649f196841abf8ab1b3604ac7c65ab1c URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=49726b0e649f196841abf8a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri May 21 00:32:20 2021 -0500 vkd3d-shader: Introduce HLSL allocation helpers. To automatically put the compilation context in a failed state. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 102 ++++++++++++++------------- libs/vkd3d-shader/hlsl.h | 57 +++++++++++---- libs/vkd3d-shader/hlsl.l | 5 +- libs/vkd3d-shader/hlsl.y | 137 ++++++++++++++++++------------------ libs/vkd3d-shader/hlsl_codegen.c | 147 +++++++++++++-------------------------- 5 files changed, 216 insertions(+), 232 deletions(-) Diff:
https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=49726b0e649f196841a…
1
0
0
0
Francois Gouget : user32/tests: Trace GetLastError() when OpenClipboard() fails in edit.
by Alexandre Julliard
28 May '21
28 May '21
Module: wine Branch: master Commit: 35180d368a94156cb77b09560b24d3af428b988b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35180d368a94156cb77b0956…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri May 28 17:48:20 2021 +0200 user32/tests: Trace GetLastError() when OpenClipboard() fails in edit. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/edit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 34bb1e5a76e..6edec12e03b 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -2187,7 +2187,7 @@ static void test_espassword(void) ok(strcmp(buffer, password) == 0, "expected %s, got %s\n", password, buffer); r = OpenClipboard(hwEdit); - ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + ok(r == TRUE, "expected %d, got %d le=%u\n", TRUE, r, GetLastError()); r = EmptyClipboard(); ok(r == TRUE, "expected %d, got %d\n", TRUE, r); r = CloseClipboard(); @@ -3190,7 +3190,7 @@ static void test_paste(void) GlobalUnlock(hmem); r = OpenClipboard(hEdit); - ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + ok(r == TRUE, "expected %d, got %d le=%u\n", TRUE, r, GetLastError()); r = EmptyClipboard(); ok(r == TRUE, "expected %d, got %d\n", TRUE, r); hmem_ret = SetClipboardData(CF_TEXT, hmem); @@ -3213,7 +3213,7 @@ static void test_paste(void) GlobalUnlock(hmem); r = OpenClipboard(hEdit); - ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + ok(r == TRUE, "expected %d, got %d le=%u\n", TRUE, r, GetLastError()); r = EmptyClipboard(); ok(r == TRUE, "expected %d, got %d\n", TRUE, r); hmem_ret = SetClipboardData(CF_TEXT, hmem);
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200