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
June 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
1 participants
811 discussions
Start a n
N
ew thread
Alexandre Julliard : Release 6.10.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: 649385e7d47091fa25b9114668075b06d2942e2f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=649385e7d47091fa25b91146…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 4 21:30:53 2021 +0200 Release 6.10. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- ANNOUNCE | 816 ++++++++++++++++++++++++++++++++------------------------------ AUTHORS | 1 + VERSION | 2 +- configure | 18 +- 4 files changed, 427 insertions(+), 410 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=649385e7d47091fa25b9…
1
0
0
0
Lauri Kenttä : po: Update Finnish translation.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: 4b46c6302495ceffa783f8ebc118cc71723b3e77 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b46c6302495ceffa783f8eb…
Author: Lauri Kenttä <lauri.kentta(a)gmail.com> Date: Fri Jun 4 21:54:49 2021 +0300 po: Update Finnish translation. Signed-off-by: Lauri Kenttä <lauri.kentta(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- po/fi.po | 296 ++++++++++++++++----------------------------------------------- 1 file changed, 76 insertions(+), 220 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4b46c6302495ceffa783…
1
0
0
0
Floris Renaud : po: Update Dutch translation.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: 5d2d2c3264b2d6039950b36bc5b59458b5842860 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d2d2c3264b2d6039950b36b…
Author: Floris Renaud <jkfloris(a)dds.nl> Date: Fri Jun 4 19:56:52 2021 +0200 po: Update Dutch translation. Signed-off-by: Floris Renaud <jkfloris(a)dds.nl> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- po/nl.po | 75 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/po/nl.po b/po/nl.po index 03a6b7a1f3e..cd8fbce0f44 100644 --- a/po/nl.po +++ b/po/nl.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
https://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2021-05-20 14:10+0200\n" +"PO-Revision-Date: 2021-06-04 19:40+0200\n" "Last-Translator: Floris Renaud <jkfloris(a)dds.nl>\n" "Language-Team: Dutch\n" "Language: nl\n" @@ -4515,7 +4515,7 @@ msgstr "Pad is ongeldig.\n" #: dlls/kernel32/winerror.mc:678 msgid "Signal pending.\n" -msgstr "Signaal wachtende.\n" +msgstr "Signaal in behandeling.\n" #: dlls/kernel32/winerror.mc:683 msgid "Max system-wide thread count reached.\n" @@ -4527,7 +4527,7 @@ msgstr "Vergrendelen mislukt.\n" #: dlls/kernel32/winerror.mc:693 msgid "Resource in use.\n" -msgstr "Resource in gebruik.\n" +msgstr "Bron in gebruik.\n" #: dlls/kernel32/winerror.mc:698 msgid "Cancel violation.\n" @@ -6088,11 +6088,11 @@ msgstr "Geen systeembronnen.\n" #: dlls/kernel32/winerror.mc:2653 msgid "No non-paged system resources.\n" -msgstr "Geen nonpaged systeembronnen.\n" +msgstr "Geen niet-wisselbare systeembronnen.\n" #: dlls/kernel32/winerror.mc:2658 msgid "No paged system resources.\n" -msgstr "Geen paged systeembronnen.\n" +msgstr "Geen wisselbare systeembronnen.\n" #: dlls/kernel32/winerror.mc:2663 msgid "No working set quota.\n" @@ -6112,7 +6112,7 @@ msgstr "Menu-item niet gevonden.\n" #: dlls/kernel32/winerror.mc:2683 msgid "Invalid keyboard handle.\n" -msgstr "Ongeldige toestenbordhandle.\n" +msgstr "Ongeldige toestenbordbeschrijving.\n" #: dlls/kernel32/winerror.mc:2688 msgid "Hook type not allowed.\n" @@ -6124,15 +6124,15 @@ msgstr "Interactief windowstation vereist.\n" #: dlls/kernel32/winerror.mc:2698 msgid "Timeout.\n" -msgstr "Timeout.\n" +msgstr "Time-out.\n" #: dlls/kernel32/winerror.mc:2703 msgid "Invalid monitor handle.\n" -msgstr "Ongeldige monitorhandle.\n" +msgstr "Ongeldige monitorbeschrijving.\n" #: dlls/kernel32/winerror.mc:2708 msgid "Event log file corrupt.\n" -msgstr "Gebeurtenislogbestand corrupt.\n" +msgstr "Gebeurtenislogbestand beschadigd.\n" #: dlls/kernel32/winerror.mc:2713 msgid "Event log can't start.\n" @@ -6384,7 +6384,7 @@ msgstr "Onbekende interface.\n" #: dlls/kernel32/winerror.mc:3023 msgid "No bindings.\n" -msgstr "Geen bindings.\n" +msgstr "Geen bindingen.\n" #: dlls/kernel32/winerror.mc:3028 msgid "No protocol sequences.\n" @@ -6392,11 +6392,11 @@ msgstr "Geen protocol volgordes.\n" #: dlls/kernel32/winerror.mc:3033 msgid "Can't create endpoint.\n" -msgstr "Kan eindpunt niet creëren.\n" +msgstr "Kan eindpunt niet aanmaken.\n" #: dlls/kernel32/winerror.mc:3038 msgid "Out of resources.\n" -msgstr "Resources zijn op.\n" +msgstr "Onvoldoende bronnen.\n" #: dlls/kernel32/winerror.mc:3043 msgid "RPC server unavailable.\n" @@ -6412,15 +6412,15 @@ msgstr "Ongeldige netwerkopties.\n" #: dlls/kernel32/winerror.mc:3058 msgid "No RPC call active.\n" -msgstr "Geen RPC-call actief.\n" +msgstr "Geen RPC-oproep actief.\n" #: dlls/kernel32/winerror.mc:3063 msgid "RPC call failed.\n" -msgstr "RPC-call mislukt.\n" +msgstr "RPC-oproep mislukt.\n" #: dlls/kernel32/winerror.mc:3068 msgid "RPC call failed and didn't execute.\n" -msgstr "RPC-call mislukt en niet uitgevoerd.\n" +msgstr "RPC-oproep mislukt en niet uitgevoerd.\n" #: dlls/kernel32/winerror.mc:3073 msgid "RPC protocol error.\n" @@ -6740,23 +6740,23 @@ msgstr "Server heeft open handles.\n" #: dlls/kernel32/winerror.mc:3473 msgid "Resource data not found.\n" -msgstr "Resourcedata niet gevonden.\n" +msgstr "Brongegevens niet gevonden.\n" #: dlls/kernel32/winerror.mc:3478 msgid "Resource type not found.\n" -msgstr "Resourcetype niet gevonden.\n" +msgstr "Brontype niet gevonden.\n" #: dlls/kernel32/winerror.mc:3483 msgid "Resource name not found.\n" -msgstr "Resourcenaam niet gevonden.\n" +msgstr "Bronnaam niet gevonden.\n" #: dlls/kernel32/winerror.mc:3488 msgid "Resource language not found.\n" -msgstr "Resourcetaal niet gevonden.\n" +msgstr "Brontaal niet gevonden.\n" #: dlls/kernel32/winerror.mc:3493 msgid "Not enough quota.\n" -msgstr "Niet genoeg quota.\n" +msgstr "Onvoldoende quota.\n" #: dlls/kernel32/winerror.mc:3498 msgid "No interfaces.\n" @@ -9573,55 +9573,55 @@ msgstr "Terugspoelen" #: dlls/shdoclc/shdoclc.rc:199 msgid "Trace Tags" -msgstr "Traceer Labels" +msgstr "Markeringen" #: dlls/shdoclc/shdoclc.rc:200 msgid "Resource Failures" -msgstr "Resource Fouten" +msgstr "Bronfouten" #: dlls/shdoclc/shdoclc.rc:201 msgid "Dump Tracking Info" -msgstr "Log Tracerings Informatie" +msgstr "Traceerinformatie Dumpen" #: dlls/shdoclc/shdoclc.rc:202 msgid "Debug Break" -msgstr "Debug Onderbreking" +msgstr "Foutopsporing Onderbreking" #: dlls/shdoclc/shdoclc.rc:203 msgid "Debug View" -msgstr "Debug Beeld" +msgstr "Foutopsporingsbeeld" #: dlls/shdoclc/shdoclc.rc:204 msgid "Dump Tree" -msgstr "Log Gehele Boom" +msgstr "Boom Dumpen" #: dlls/shdoclc/shdoclc.rc:205 msgid "Dump Lines" -msgstr "Log Regels" +msgstr "Regels Dumpen" #: dlls/shdoclc/shdoclc.rc:206 msgid "Dump DisplayTree" -msgstr "Log Beeld Boom" +msgstr "BeeldBoom Dumpen" #: dlls/shdoclc/shdoclc.rc:207 msgid "Dump FormatCaches" -msgstr "Log Formaat Caches" +msgstr "FormaatCaches Dumpen" #: dlls/shdoclc/shdoclc.rc:208 msgid "Dump LayoutRects" -msgstr "Log Layout Rects" +msgstr "LayoutRects Dumpen" #: dlls/shdoclc/shdoclc.rc:209 msgid "Memory Monitor" -msgstr "Geheugen Monitor" +msgstr "Geheugenmonitor" #: dlls/shdoclc/shdoclc.rc:210 msgid "Performance Meters" -msgstr "Performance Meters" +msgstr "Prestatiemeters" #: dlls/shdoclc/shdoclc.rc:211 msgid "Save HTML" -msgstr "Sla HTML op" +msgstr "HTML Opslaan" #: dlls/shdoclc/shdoclc.rc:213 msgid "&Browse View" @@ -13810,7 +13810,7 @@ msgstr "" #: programs/net/net.rc:46 msgid "%1 %2 %3 Open resources: %4!u!\n" -msgstr "%1 %2 %3 Open resources: %4!u!\n" +msgstr "%1 %2 %3 Open bronnen: %4!u!\n" #: programs/net/net.rc:48 msgid "Paused" @@ -15263,15 +15263,14 @@ msgstr "reg: Foutieve opdrachtregel-parameters\n" #: programs/reg/reg.rc:204 msgid "reg: The source and destination keys cannot be the same\n" -msgstr "" +msgstr "reg: De bron- en de doelsleutel kunnen niet hetzelfde zijn\n" #: programs/reg/reg.rc:205 -#, fuzzy -#| msgid "The file '%1' already exists. Do you want to overwrite it?" msgid "" "The value '%1\\%2' already exists in the destination key. Do you want to " "overwrite it?" -msgstr "Het bestand '%1' bestaat al. Wilt u het overschrijven?" +msgstr "" +"De waarde '%1\\%2' komt al voor in de doelsleutel. Wilt u het overschrijven?" #: programs/reg/reg.rc:133 msgid "Are you sure you want to delete the registry value '%1'?"
1
0
0
0
Piotr Caban : msvcrt: Import lgammaf implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: b634fa7ca7eb428252cbaf539dca5a2be3ef9e0c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b634fa7ca7eb428252cbaf53…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:53 2021 +0200 msvcrt: Import lgammaf 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 | 259 +++++++++++++++++++++++++++++++++++++++++++------- dlls/msvcrt/unixlib.c | 14 --- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 - 6 files changed, 226 insertions(+), 53 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b634fa7ca7eb428252cb…
1
0
0
0
Piotr Caban : msvcrt: Import lgamma implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: 3171aa2b2d8db28e5bfde1cad92e0ef36ee7ccaa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3171aa2b2d8db28e5bfde1ca…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:49 2021 +0200 msvcrt: Import lgamma 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 | 196 +++++++++++++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 14 ---- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 - 6 files changed, 195 insertions(+), 21 deletions(-) diff --git a/configure b/configure index edc15165750..6c890d0e36b 100755 --- a/configure +++ b/configure @@ -19620,7 +19620,6 @@ for ac_func in \ exp2 \ exp2f \ fmaf \ - lgamma \ lgammaf \ tgamma \ tgammaf diff --git a/configure.ac b/configure.ac index cb2b0cbeb17..f5bf9bc071f 100644 --- a/configure.ac +++ b/configure.ac @@ -2659,7 +2659,6 @@ AC_CHECK_FUNCS(\ exp2 \ exp2f \ fmaf \ - lgamma \ lgammaf \ tgamma \ tgammaf diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index ae9debce20c..6f0b0c1ba4f 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -8644,12 +8644,206 @@ end: return sx ? -x : x; } +/* sin(pi*x) assuming x > 2^-100, if sin(pi*x)==0 the sign is arbitrary */ +static double sin_pi(double x) +{ + static const double pi = 3.14159265358979311600e+00; + int n; + + /* spurious inexact if odd int */ + x = 2.0 * (x * 0.5 - floor(x * 0.5)); /* x mod 2.0 */ + + n = (int)(x * 4.0); + n = (n + 1) / 2; + x -= n * 0.5f; + x *= pi; + + switch (n) { + default: /* case 4: */ + case 0: return __sin(x, 0.0, 0); + case 1: return __cos(x, 0.0); + case 2: return __sin(-x, 0.0, 0); + case 3: return -__cos(x, 0.0); + } +} + /********************************************************************* * lgamma (MSVCR120.@) + * + * Copied from musl: src/math/lgamma_r.c */ double CDECL lgamma(double x) { - return unix_funcs->lgamma( x ); + static const double pi = 3.14159265358979311600e+00, + a0 = 7.72156649015328655494e-02, + a1 = 3.22467033424113591611e-01, + a2 = 6.73523010531292681824e-02, + a3 = 2.05808084325167332806e-02, + a4 = 7.38555086081402883957e-03, + a5 = 2.89051383673415629091e-03, + a6 = 1.19270763183362067845e-03, + a7 = 5.10069792153511336608e-04, + a8 = 2.20862790713908385557e-04, + a9 = 1.08011567247583939954e-04, + a10 = 2.52144565451257326939e-05, + a11 = 4.48640949618915160150e-05, + tc = 1.46163214496836224576e+00, + tf = -1.21486290535849611461e-01, + tt = -3.63867699703950536541e-18, + t0 = 4.83836122723810047042e-01, + t1 = -1.47587722994593911752e-01, + t2 = 6.46249402391333854778e-02, + t3 = -3.27885410759859649565e-02, + t4 = 1.79706750811820387126e-02, + t5 = -1.03142241298341437450e-02, + t6 = 6.10053870246291332635e-03, + t7 = -3.68452016781138256760e-03, + t8 = 2.25964780900612472250e-03, + t9 = -1.40346469989232843813e-03, + t10 = 8.81081882437654011382e-04, + t11 = -5.38595305356740546715e-04, + t12 = 3.15632070903625950361e-04, + t13 = -3.12754168375120860518e-04, + t14 = 3.35529192635519073543e-04, + u0 = -7.72156649015328655494e-02, + u1 = 6.32827064025093366517e-01, + u2 = 1.45492250137234768737e+00, + u3 = 9.77717527963372745603e-01, + u4 = 2.28963728064692451092e-01, + u5 = 1.33810918536787660377e-02, + v1 = 2.45597793713041134822e+00, + v2 = 2.12848976379893395361e+00, + v3 = 7.69285150456672783825e-01, + v4 = 1.04222645593369134254e-01, + v5 = 3.21709242282423911810e-03, + s0 = -7.72156649015328655494e-02, + s1 = 2.14982415960608852501e-01, + s2 = 3.25778796408930981787e-01, + s3 = 1.46350472652464452805e-01, + s4 = 2.66422703033638609560e-02, + s5 = 1.84028451407337715652e-03, + s6 = 3.19475326584100867617e-05, + r1 = 1.39200533467621045958e+00, + r2 = 7.21935547567138069525e-01, + r3 = 1.71933865632803078993e-01, + r4 = 1.86459191715652901344e-02, + r5 = 7.77942496381893596434e-04, + r6 = 7.32668430744625636189e-06, + w0 = 4.18938533204672725052e-01, + w1 = 8.33333333333329678849e-02, + w2 = -2.77777777728775536470e-03, + w3 = 7.93650558643019558500e-04, + w4 = -5.95187557450339963135e-04, + w5 = 8.36339918996282139126e-04, + w6 = -1.63092934096575273989e-03; + + union {double f; UINT64 i;} u = {x}; + double t, y, z, nadj, p, p1, p2, p3, q, r, w; + UINT32 ix; + int sign,i; + + /* purge off +-inf, NaN, +-0, tiny and negative arguments */ + sign = u.i >> 63; + ix = u.i >> 32 & 0x7fffffff; + if (ix >= 0x7ff00000) + return x * x; + if (ix < (0x3ff - 70) << 20) { /* |x|<2**-70, return -log(|x|) */ + if(sign) + x = -x; + return -log(x); + } + if (sign) { + x = -x; + t = sin_pi(x); + if (t == 0.0) { /* -integer */ + *_errno() = ERANGE; + return 1.0 / (x - x); + } + if (t <= 0.0) + t = -t; + nadj = log(pi / (t * x)); + } + + /* purge off 1 and 2 */ + if ((ix == 0x3ff00000 || ix == 0x40000000) && (UINT32)u.i == 0) + r = 0; + /* for x < 2.0 */ + else if (ix < 0x40000000) { + if (ix <= 0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */ + r = -log(x); + if (ix >= 0x3FE76944) { + y = 1.0 - x; + i = 0; + } else if (ix >= 0x3FCDA661) { + y = x - (tc - 1.0); + i = 1; + } else { + y = x; + i = 2; + } + } else { + r = 0.0; + if (ix >= 0x3FFBB4C3) { /* [1.7316,2] */ + y = 2.0 - x; + i = 0; + } else if(ix >= 0x3FF3B4C4) { /* [1.23,1.73] */ + y = x - tc; + i = 1; + } else { + y = x - 1.0; + i = 2; + } + } + switch (i) { + case 0: + z = y * y; + p1 = a0 + z * (a2 + z * (a4 + z * (a6 + z * (a8 + z * a10)))); + p2 = z * (a1 + z * (a3 + z * (a5 + z * (a7 + z * (a9 + z * a11))))); + p = y * p1 + p2; + r += (p - 0.5 * y); + break; + case 1: + z = y * y; + w = z * y; + p1 = t0 + w * (t3 + w * (t6 + w * (t9 + w * t12))); /* parallel comp */ + p2 = t1 + w * (t4 + w * (t7 + w * (t10 + w * t13))); + p3 = t2 + w * (t5 + w * (t8 + w * (t11 + w * t14))); + p = z * p1 - (tt - w * (p2 + y * p3)); + r += tf + p; + break; + case 2: + p1 = y * (u0 + y * (u1 + y * (u2 + y * (u3 + y * (u4 + y * u5))))); + p2 = 1.0 + y * (v1 + y * (v2 + y * (v3 + y * (v4 + y * v5)))); + r += -0.5 * y + p1 / p2; + } + } else if (ix < 0x40200000) { /* x < 8.0 */ + i = (int)x; + y = x - (double)i; + p = y * (s0 + y * (s1 + y * (s2 + y * (s3 + y * (s4 + y * (s5 + y * s6)))))); + q = 1.0 + y * (r1 + y * (r2 + y * (r3 + y * (r4 + y * (r5 + y * r6))))); + r = 0.5 * y + p / q; + z = 1.0; /* lgamma(1+s) = log(s) + lgamma(s) */ + switch (i) { + case 7: z *= y + 6.0; /* fall through */ + case 6: z *= y + 5.0; /* fall through */ + case 5: z *= y + 4.0; /* fall through */ + case 4: z *= y + 3.0; /* fall through */ + case 3: + z *= y + 2.0; + r += log(z); + break; + } + } else if (ix < 0x43900000) { /* 8.0 <= x < 2**58 */ + t = log(x); + z = 1.0 / x; + y = z * z; + w = w0 + z * (w1 + y * (w2 + y * (w3 + y * (w4 + y * (w5 + y * w6))))); + r = (x - 0.5) * (t - 1.0) + w; + } else /* 2**58 <= x <= inf */ + r = x * (log(x) - 1.0); + if (sign) + r = nadj - r; + return r; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 440d002869c..14aeef4c1e7 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -94,19 +94,6 @@ static float CDECL unix_fmaf( float x, float y, float z ) #endif } -/********************************************************************* - * lgamma - */ -static double CDECL unix_lgamma(double x) -{ -#ifdef HAVE_LGAMMA - return lgamma(x); -#else - FIXME( "not implemented\n" ); - return 0; -#endif -} - /********************************************************************* * lgammaf */ @@ -169,7 +156,6 @@ static const struct unix_funcs funcs = unix_exp2, unix_exp2f, unix_fmaf, - unix_lgamma, unix_lgammaf, unix_pow, unix_powf, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index fc2ceb7798d..4309ff835a0 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -28,7 +28,6 @@ struct unix_funcs double (CDECL *exp2)(double x); float (CDECL *exp2f)(float x); float (CDECL *fmaf)(float x, float y, float z); - double (CDECL *lgamma)(double x); float (CDECL *lgammaf)(float x); double (CDECL *pow)(double x, double y); float (CDECL *powf)(float x, float y); diff --git a/include/config.h.in b/include/config.h.in index 252c2819fcc..dd34230b268 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -297,9 +297,6 @@ /* Define to 1 if you have the `ldap_parse_vlv_control' function. */ #undef HAVE_LDAP_PARSE_VLV_CONTROL -/* Define to 1 if you have the `lgamma' function. */ -#undef HAVE_LGAMMA - /* Define to 1 if you have the `lgammaf' function. */ #undef HAVE_LGAMMAF
1
0
0
0
Piotr Caban : msvcrt: Import log2 implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: 7e6756d0f4495f37ac520685e3baeec053f478ed URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7e6756d0f4495f37ac520685…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:45 2021 +0200 msvcrt: Import log2 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 | 247 +++++++++++++++++++++++++++++++++++++++++++++++++- dlls/msvcrt/unixlib.c | 13 --- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 - 6 files changed, 244 insertions(+), 22 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7e6756d0f4495f37ac52…
1
0
0
0
Piotr Caban : msvcrt: Import log2f implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: 301bde60d3335ec78aa4bb4622dc14c5ea1eec92 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=301bde60d3335ec78aa4bb46…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:41 2021 +0200 msvcrt: Import log2f 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 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++-- dlls/msvcrt/unixlib.c | 13 -------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 -- 6 files changed, 80 insertions(+), 22 deletions(-) diff --git a/configure b/configure index e73670fc110..08a28968945 100755 --- a/configure +++ b/configure @@ -19623,7 +19623,6 @@ for ac_func in \ lgamma \ lgammaf \ log2 \ - log2f \ tgamma \ tgammaf diff --git a/configure.ac b/configure.ac index b13c2ad3182..71c95cbdd90 100644 --- a/configure.ac +++ b/configure.ac @@ -2662,7 +2662,6 @@ AC_CHECK_FUNCS(\ lgamma \ lgammaf \ log2 \ - log2f \ tgamma \ tgammaf ) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 0176b6544c0..88a5ecd240f 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -7176,12 +7176,89 @@ double CDECL log2(double x) /********************************************************************* * log2f (MSVCR120.@) + * + * Copied from musl: src/math/log2f.c */ float CDECL log2f(float x) { - if (x < 0) *_errno() = EDOM; - else if (x == 0) *_errno() = ERANGE; - return unix_funcs->log2f( x ); + static const double A[] = { + -0x1.712b6f70a7e4dp-2, + 0x1.ecabf496832ep-2, + -0x1.715479ffae3dep-1, + 0x1.715475f35c8b8p0 + }; + static const struct { + double invc, logc; + } T[] = { + { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 }, + { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 }, + { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 }, + { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 }, + { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 }, + { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 }, + { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 }, + { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 }, + { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 }, + { 0x1p+0, 0x0p+0 }, + { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 }, + { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 }, + { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 }, + { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 }, + { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 }, + { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 } + }; + + double z, r, r2, p, y, y0, invc, logc; + UINT32 ix, iz, top, tmp; + int k, i; + + ix = *(UINT32*)&x; + /* Fix sign of zero with downward rounding when x==1. */ + if (ix == 0x3f800000) + return 0; + if (ix - 0x00800000 >= 0x7f800000 - 0x00800000) { + /* x < 0x1p-126 or inf or nan. */ + if (ix * 2 == 0) { + *_errno() = ERANGE; + return -1.0f / x; + } + if (ix == 0x7f800000) /* log2(inf) == inf. */ + return x; + if (ix * 2 > 0xff000000) + return x; + if (ix & 0x80000000) { + *_errno() = EDOM; + return (x - x) / (x - x); + } + /* x is subnormal, normalize it. */ + x *= 0x1p23f; + ix = *(UINT32*)&x; + ix -= 23 << 23; + } + + /* x = 2^k z; where z is in range [OFF,2*OFF] and exact. + The range is split into N subintervals. + The ith subinterval contains z and c is near its center. */ + tmp = ix - 0x3f330000; + i = (tmp >> (23 - 4)) % (1 << 4); + top = tmp & 0xff800000; + iz = ix - top; + k = (INT32)tmp >> 23; /* arithmetic shift */ + invc = T[i].invc; + logc = T[i].logc; + z = *(float*)&iz; + + /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ + r = z * invc - 1; + y0 = logc + (double)k; + + /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ + r2 = r * r; + y = A[1] * r + A[2]; + y = A[0] * r2 + y; + p = A[3] * r + y0; + y = y * r2 + p; + return y; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 4311de356df..b23afaf7123 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -132,18 +132,6 @@ static double CDECL unix_log2(double x) #endif } -/********************************************************************* - * log2f - */ -static float CDECL unix_log2f(float x) -{ -#ifdef HAVE_LOG2F - return log2f(x); -#else - return unix_log2(x); -#endif -} - /********************************************************************* * pow */ @@ -196,7 +184,6 @@ static const struct unix_funcs funcs = unix_lgamma, unix_lgammaf, unix_log2, - unix_log2f, unix_pow, unix_powf, unix_tgamma, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index d907d68dd7d..85f74e5fb12 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -31,7 +31,6 @@ struct unix_funcs double (CDECL *lgamma)(double x); float (CDECL *lgammaf)(float x); double (CDECL *log2)(double x); - float (CDECL *log2f)(float x); double (CDECL *pow)(double x, double y); float (CDECL *powf)(float x, float y); double (CDECL *tgamma)(double x); diff --git a/include/config.h.in b/include/config.h.in index 1b308f3d34c..d0e3ccb60fe 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -411,9 +411,6 @@ /* Define to 1 if you have the `log2' function. */ #undef HAVE_LOG2 -/* Define to 1 if you have the `log2f' function. */ -#undef HAVE_LOG2F - /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT
1
0
0
0
Piotr Caban : msvcrt: Import log10f implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: b29096cce1cbed40f539ed004aa82dbcf5fd8a1d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b29096cce1cbed40f539ed00…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:37 2021 +0200 msvcrt: Import log10f 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 | 60 +++++++++++++++++++++++++++++++++++++++++++++++---- dlls/msvcrt/unixlib.c | 9 -------- dlls/msvcrt/unixlib.h | 1 - 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 4eb759c2dda..0176b6544c0 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1295,10 +1295,62 @@ float CDECL logf( float x ) */ float CDECL log10f( float x ) { - float ret = unix_funcs->log10f( x ); - if (x < 0.0) return math_error(_DOMAIN, "log10f", x, 0, ret); - if (x == 0.0) return math_error(_SING, "log10f", x, 0, ret); - return ret; + static const float ivln10hi = 4.3432617188e-01, + ivln10lo = -3.1689971365e-05, + log10_2hi = 3.0102920532e-01, + log10_2lo = 7.9034151668e-07, + Lg1 = 0xaaaaaa.0p-24, + Lg2 = 0xccce13.0p-25, + Lg3 = 0x91e9ee.0p-25, + Lg4 = 0xf89e26.0p-26; + + union {float f; UINT32 i;} u = {x}; + float hfsq, f, s, z, R, w, t1, t2, dk, hi, lo; + UINT32 ix; + int k; + + ix = u.i; + k = 0; + if (ix < 0x00800000 || ix >> 31) { /* x < 2**-126 */ + if (ix << 1 == 0) + return math_error(_SING, "log10f", x, 0, -1 / (x * x)); + if ((ix & ~(1u << 31)) > 0x7f800000) + return x; + if (ix >> 31) + return math_error(_DOMAIN, "log10f", x, 0, (x - x) / (x - x)); + /* subnormal number, scale up x */ + k -= 25; + x *= 0x1p25f; + u.f = x; + ix = u.i; + } else if (ix >= 0x7f800000) { + return x; + } else if (ix == 0x3f800000) + return 0; + + /* reduce x into [sqrt(2)/2, sqrt(2)] */ + ix += 0x3f800000 - 0x3f3504f3; + k += (int)(ix >> 23) - 0x7f; + ix = (ix & 0x007fffff) + 0x3f3504f3; + u.i = ix; + x = u.f; + + f = x - 1.0f; + s = f / (2.0f + f); + z = s * s; + w = z * z; + t1= w * (Lg2 + w * Lg4); + t2= z * (Lg1 + w * Lg3); + R = t2 + t1; + hfsq = 0.5f * f * f; + + hi = f - hfsq; + u.f = hi; + u.i &= 0xfffff000; + hi = u.f; + lo = f - hi - hfsq + s * (hfsq + R); + dk = k; + return dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi + hi * ivln10hi + dk * log10_2hi; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 436accde122..4311de356df 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -120,14 +120,6 @@ static float CDECL unix_lgammaf(float x) #endif } -/********************************************************************* - * log10f - */ -static float CDECL unix_log10f( float x ) -{ - return log10f( x ); -} - /********************************************************************* * log2 */ @@ -203,7 +195,6 @@ static const struct unix_funcs funcs = unix_fmaf, unix_lgamma, unix_lgammaf, - unix_log10f, unix_log2, unix_log2f, unix_pow, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 6ff2a520224..d907d68dd7d 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -30,7 +30,6 @@ struct unix_funcs float (CDECL *fmaf)(float x, float y, float z); double (CDECL *lgamma)(double x); float (CDECL *lgammaf)(float x); - float (CDECL *log10f)(float x); double (CDECL *log2)(double x); float (CDECL *log2f)(float x); double (CDECL *pow)(double x, double y);
1
0
0
0
Piotr Caban : msvcrt: Import log10 implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: cef75b3b19d8c21e2d941de55f04f587d521a719 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cef75b3b19d8c21e2d941de5…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:35 2021 +0200 msvcrt: Import log10 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 | 80 ++++++++++++++++++++++++++++++++++++++++++++++++--- dlls/msvcrt/unixlib.c | 9 ------ dlls/msvcrt/unixlib.h | 1 - 3 files changed, 76 insertions(+), 14 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 5702131cec9..4eb759c2dda 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2964,10 +2964,82 @@ double CDECL log( double x ) */ double CDECL log10( double x ) { - double ret = unix_funcs->log10( x ); - if (x < 0.0) return math_error(_DOMAIN, "log10", x, 0, ret); - if (x == 0.0) return math_error(_SING, "log10", x, 0, ret); - return ret; + static const double ivln10hi = 4.34294481878168880939e-01, + ivln10lo = 2.50829467116452752298e-11, + log10_2hi = 3.01029995663611771306e-01, + log10_2lo = 3.69423907715893078616e-13, + Lg1 = 6.666666666666735130e-01, + Lg2 = 3.999999999940941908e-01, + Lg3 = 2.857142874366239149e-01, + Lg4 = 2.222219843214978396e-01, + Lg5 = 1.818357216161805012e-01, + Lg6 = 1.531383769920937332e-01, + Lg7 = 1.479819860511658591e-01; + + union {double f; UINT64 i;} u = {x}; + double hfsq, f, s, z, R, w, t1, t2, dk, y, hi, lo, val_hi, val_lo; + UINT32 hx; + int k; + + hx = u.i >> 32; + k = 0; + if (hx < 0x00100000 || hx >> 31) { + if (u.i << 1 == 0) + return math_error(_SING, "log10", x, 0, -1 / (x * x)); + if ((u.i & ~(1ULL << 63)) > 0x7ff0000000000000ULL) + return x; + if (hx >> 31) + return math_error(_DOMAIN, "log10", x, 0, (x - x) / (x - x)); + /* subnormal number, scale x up */ + k -= 54; + x *= 0x1p54; + u.f = x; + hx = u.i >> 32; + } else if (hx >= 0x7ff00000) { + return x; + } else if (hx == 0x3ff00000 && u.i<<32 == 0) + return 0; + + /* reduce x into [sqrt(2)/2, sqrt(2)] */ + hx += 0x3ff00000 - 0x3fe6a09e; + k += (int)(hx >> 20) - 0x3ff; + hx = (hx & 0x000fffff) + 0x3fe6a09e; + u.i = (UINT64)hx << 32 | (u.i & 0xffffffff); + x = u.f; + + f = x - 1.0; + hfsq = 0.5 * f * f; + s = f / (2.0 + f); + z = s * s; + w = z * z; + t1 = w * (Lg2 + w * (Lg4 + w * Lg6)); + t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7))); + R = t2 + t1; + + /* hi+lo = f - hfsq + s*(hfsq+R) ~ log(1+f) */ + hi = f - hfsq; + u.f = hi; + u.i &= (UINT64)-1 << 32; + hi = u.f; + lo = f - hi - hfsq + s * (hfsq + R); + + /* val_hi+val_lo ~ log10(1+f) + k*log10(2) */ + val_hi = hi * ivln10hi; + dk = k; + y = dk * log10_2hi; + val_lo = dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi; + + /* + * Extra precision in for adding y is not strictly needed + * since there is no very large cancellation near x = sqrt(2) or + * x = 1/sqrt(2), but we do it anyway since it costs little on CPUs + * with some parallelism and it reduces the error for many args. + */ + w = y + val_hi; + val_lo += (y - w) + val_hi; + val_hi = w; + + return val_lo + val_hi; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index 3b003a846c8..436accde122 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -120,14 +120,6 @@ static float CDECL unix_lgammaf(float x) #endif } -/********************************************************************* - * log10 - */ -static double CDECL unix_log10( double x ) -{ - return log10( x ); -} - /********************************************************************* * log10f */ @@ -211,7 +203,6 @@ static const struct unix_funcs funcs = unix_fmaf, unix_lgamma, unix_lgammaf, - unix_log10, unix_log10f, unix_log2, unix_log2f, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 7e976949e04..6ff2a520224 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -30,7 +30,6 @@ struct unix_funcs float (CDECL *fmaf)(float x, float y, float z); double (CDECL *lgamma)(double x); float (CDECL *lgammaf)(float x); - double (CDECL *log10)(double x); float (CDECL *log10f)(float x); double (CDECL *log2)(double x); float (CDECL *log2f)(float x);
1
0
0
0
Piotr Caban : msvcrt: Import log1pf implementation from musl.
by Alexandre Julliard
04 Jun '21
04 Jun '21
Module: wine Branch: master Commit: ff7faafda68f697b38270569031f71f151d2dc0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff7faafda68f697b38270569…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 4 18:25:30 2021 +0200 msvcrt: Import log1pf 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 | 66 ++++++++++++++++++++++++++++++++++++++++++++++++--- dlls/msvcrt/unixlib.c | 13 ---------- dlls/msvcrt/unixlib.h | 1 - include/config.h.in | 3 --- 6 files changed, 63 insertions(+), 22 deletions(-) diff --git a/configure b/configure index e91b319c705..e73670fc110 100755 --- a/configure +++ b/configure @@ -19622,7 +19622,6 @@ for ac_func in \ fmaf \ lgamma \ lgammaf \ - log1pf \ log2 \ log2f \ tgamma \ diff --git a/configure.ac b/configure.ac index accdbaf6216..b13c2ad3182 100644 --- a/configure.ac +++ b/configure.ac @@ -2661,7 +2661,6 @@ AC_CHECK_FUNCS(\ fmaf \ lgamma \ lgammaf \ - log1pf \ log2 \ log2f \ tgamma \ diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index fbc97aedce4..5702131cec9 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -6972,12 +6972,72 @@ double CDECL log1p(double x) /********************************************************************* * log1pf (MSVCR120.@) + * + * Copied from musl: src/math/log1pf.c */ float CDECL log1pf(float x) { - if (x < -1) *_errno() = EDOM; - else if (x == -1) *_errno() = ERANGE; - return unix_funcs->log1pf( x ); + static const float ln2_hi = 6.9313812256e-01, + ln2_lo = 9.0580006145e-06, + Lg1 = 0xaaaaaa.0p-24, + Lg2 = 0xccce13.0p-25, + Lg3 = 0x91e9ee.0p-25, + Lg4 = 0xf89e26.0p-26; + + union {float f; UINT32 i;} u = {x}; + float hfsq, f, c, s, z, R, w, t1, t2, dk; + UINT32 ix, iu; + int k; + + ix = u.i; + k = 1; + if (ix < 0x3ed413d0 || ix >> 31) { /* 1+x < sqrt(2)+ */ + if (ix >= 0xbf800000) { /* x <= -1.0 */ + if (x == -1) { + *_errno() = ERANGE; + return x / 0.0f; /* log1p(-1)=+inf */ + } + *_errno() = EDOM; + return (x - x) / 0.0f; /* log1p(x<-1)=NaN */ + } + if (ix<<1 < 0x33800000<<1) { /* |x| < 2**-24 */ + /* underflow if subnormal */ + if ((ix & 0x7f800000) == 0) + fp_barrierf(x * x); + return x; + } + if (ix <= 0xbe95f619) { /* sqrt(2)/2- <= 1+x < sqrt(2)+ */ + k = 0; + c = 0; + f = x; + } + } else if (ix >= 0x7f800000) + return x; + if (k) { + u.f = 1 + x; + iu = u.i; + iu += 0x3f800000 - 0x3f3504f3; + k = (int)(iu >> 23) - 0x7f; + /* correction term ~ log(1+x)-log(u), avoid underflow in c/u */ + if (k < 25) { + c = k >= 2 ? 1 - (u.f - x) : x - (u.f - 1); + c /= u.f; + } else + c = 0; + /* reduce u into [sqrt(2)/2, sqrt(2)] */ + iu = (iu & 0x007fffff) + 0x3f3504f3; + u.i = iu; + f = u.f - 1; + } + s = f / (2.0f + f); + z = s * s; + w = z * z; + t1= w * (Lg2 + w * Lg4); + t2= z * (Lg1 + w * Lg3); + R = t2 + t1; + hfsq = 0.5f * f * f; + dk = k; + return s * (hfsq + R) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi; } /********************************************************************* diff --git a/dlls/msvcrt/unixlib.c b/dlls/msvcrt/unixlib.c index f98d08e4909..3b003a846c8 100644 --- a/dlls/msvcrt/unixlib.c +++ b/dlls/msvcrt/unixlib.c @@ -136,18 +136,6 @@ static float CDECL unix_log10f( float x ) return log10f( x ); } -/********************************************************************* - * log1pf - */ -static float CDECL unix_log1pf(float x) -{ -#ifdef HAVE_LOG1PF - return log1pf(x); -#else - return log(1 + x); -#endif -} - /********************************************************************* * log2 */ @@ -225,7 +213,6 @@ static const struct unix_funcs funcs = unix_lgammaf, unix_log10, unix_log10f, - unix_log1pf, unix_log2, unix_log2f, unix_pow, diff --git a/dlls/msvcrt/unixlib.h b/dlls/msvcrt/unixlib.h index 285deb22bc2..7e976949e04 100644 --- a/dlls/msvcrt/unixlib.h +++ b/dlls/msvcrt/unixlib.h @@ -32,7 +32,6 @@ struct unix_funcs float (CDECL *lgammaf)(float x); double (CDECL *log10)(double x); float (CDECL *log10f)(float x); - float (CDECL *log1pf)(float x); double (CDECL *log2)(double x); float (CDECL *log2f)(float x); double (CDECL *pow)(double x, double y); diff --git a/include/config.h.in b/include/config.h.in index 7e6d36112d3..1b308f3d34c 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -408,9 +408,6 @@ /* Define to 1 if you have the <linux/videodev2.h> header file. */ #undef HAVE_LINUX_VIDEODEV2_H -/* Define to 1 if you have the `log1pf' function. */ -#undef HAVE_LOG1PF - /* Define to 1 if you have the `log2' function. */ #undef HAVE_LOG2
1
0
0
0
← Newer
1
...
68
69
70
71
72
73
74
...
82
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
78
79
80
81
82
Results per page:
10
25
50
100
200