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
February 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
915 discussions
Start a n
N
ew thread
Francois Gouget : testbot/WinRun*: Simplify LogTaskError().
by Alexandre Julliard
03 Feb '21
03 Feb '21
Module: tools Branch: master Commit: 11b596f4425ff2c70da2f312529adabfe43a025d URL:
https://source.winehq.org/git/tools.git/?a=commit;h=11b596f4425ff2c70da2f31…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Feb 3 03:32:20 2021 +0100 testbot/WinRun*: Simplify LogTaskError(). The TestBot engine redirects stderr to testbot.log so there is no need to manually open and append to that file. This also makes the Debug() call in LogTaskError() redundant. Add the "tool:error:" prefix. This clarifies which errors come from the script, and which come from the TestBot Engine. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48658
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/bin/WineRunBuild.pl | 14 +------------- testbot/bin/WineRunReconfig.pl | 14 +------------- testbot/bin/WineRunTask.pl | 14 +------------- testbot/bin/WineRunWineTest.pl | 12 +----------- 4 files changed, 4 insertions(+), 50 deletions(-) diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl index 2764ffc..ff13052 100755 --- a/testbot/bin/WineRunBuild.pl +++ b/testbot/bin/WineRunBuild.pl @@ -178,19 +178,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - my $OldUMask = umask(002); - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } - umask($OldUMask); + print STDERR "$Name0:error: ", $ErrMessage; } sub WrapUpAndExit($;$$$) diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index 2d45ed5..49e7305 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -179,19 +179,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - my $OldUMask = umask(002); - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } - umask($OldUMask); + print STDERR "$Name0:error: ", $ErrMessage; } sub WrapUpAndExit($;$$$) diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl index 3036488..6056806 100755 --- a/testbot/bin/WineRunTask.pl +++ b/testbot/bin/WineRunTask.pl @@ -207,19 +207,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - my $OldUMask = umask(002); - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } - umask($OldUMask); + print STDERR "$Name0:error: ", $ErrMessage; } my $ReportNames; diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl index bcf89bf..7892bca 100755 --- a/testbot/bin/WineRunWineTest.pl +++ b/testbot/bin/WineRunWineTest.pl @@ -204,17 +204,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } + print STDERR "$Name0:error: ", $ErrMessage; } my $ReportNames;
1
0
0
0
Henri Verbeet : vkd3d-shader: Implement relative addressing of tessellation control shader inputs.
by Alexandre Julliard
03 Feb '21
03 Feb '21
Module: vkd3d Branch: master Commit: 0c73afd424039a88ae41fa0bcd3b549a525c2ad5 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=0c73afd424039a88ae41fa0…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 3 19:24:17 2021 +0100 vkd3d-shader: Implement relative addressing of tessellation control shader inputs. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 153 +++++++++++++++++++++++++++++++++++++++++----- tests/d3d12.c | 2 +- 2 files changed, 138 insertions(+), 17 deletions(-) Diff:
https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=0c73afd424039a88ae4…
1
0
0
0
Henri Verbeet : tests: Add a test for relative addressing of tessellation control shader inputs.
by Alexandre Julliard
03 Feb '21
03 Feb '21
Module: vkd3d Branch: master Commit: 88fd3b3e1b801e5bff7fdbc63b1f37b7f912b787 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=88fd3b3e1b801e5bff7fdbc…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 3 19:24:16 2021 +0100 tests: Add a test for relative addressing of tessellation control shader inputs. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/d3d12.c | 261 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 250 insertions(+), 11 deletions(-) Diff:
https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=88fd3b3e1b801e5bff7…
1
0
0
0
Jefferson Carpenter : msxml3: Fold in reset_output_buffer.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: 433b9081ba7c862feb947400f507228e793d7d4c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=433b9081ba7c862feb947400…
Author: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Date: Tue Feb 2 19:01:10 2021 +0000 msxml3: Fold in reset_output_buffer. Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/mxwriter.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 029e9aac0d0..ac3c0fa59c3 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -693,14 +693,6 @@ static inline HRESULT flush_output_buffer(mxwriter *This) return write_data_to_stream(This); } -/* Resets the mxwriter's output buffer by closing it, then creating a new - * output buffer using the given encoding. - */ -static inline void reset_output_buffer(mxwriter *This) -{ - close_output_buffer(This); -} - static HRESULT writer_set_property(mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value) { writer->props[property] = value; @@ -927,7 +919,7 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest) { if (This->dest) IStream_Release(This->dest); This->dest = NULL; - reset_output_buffer(This); + close_output_buffer(This); break; } case VT_UNKNOWN: @@ -938,7 +930,7 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest) if (hr == S_OK) { /* Recreate the output buffer to make sure it's using the correct encoding. */ - reset_output_buffer(This); + close_output_buffer(This); if (This->dest) IStream_Release(This->dest); This->dest = stream; @@ -1028,7 +1020,7 @@ static HRESULT WINAPI mxwriter_put_encoding(IMXWriter *iface, BSTR encoding) This->xml_enc = enc; TRACE("got encoding %d\n", This->xml_enc); - reset_output_buffer(This); + close_output_buffer(This); return S_OK; } @@ -1229,7 +1221,7 @@ static HRESULT WINAPI SAXContentHandler_startDocument(ISAXContentHandler *iface) * be how Windows works. */ if (This->prop_changed) { - reset_output_buffer(This); + close_output_buffer(This); This->prop_changed = FALSE; }
1
0
0
0
Hans Leidekker : wbemprox: Report the real OS version.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: ba06f7a541c44343a9751cc6105211c1ef058c49 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ba06f7a541c44343a9751cc6…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Feb 2 14:25:20 2021 +0100 wbemprox: Report the real OS version. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50580
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 9ae34a50c0d..f1cf75ab380 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3514,13 +3514,13 @@ static enum fill_status fill_operatingsystem( struct table *table, const struct { struct record_operatingsystem *rec; enum fill_status status = FILL_STATUS_UNFILTERED; - OSVERSIONINFOEXW ver; + RTL_OSVERSIONINFOEXW ver; UINT row = 0; if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; ver.dwOSVersionInfoSize = sizeof(ver); - GetVersionExW( (OSVERSIONINFOW *)&ver ); + RtlGetVersion( &ver ); rec = (struct record_operatingsystem *)table->data; rec->buildnumber = get_osbuildnumber( &ver );
1
0
0
0
Piotr Caban : msvcrt: Improve __libm_sse2_sqrt_precise implementation.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: e3772c917ef345039b8422b6e16c1c48f7834f82 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3772c917ef345039b8422b6…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Feb 1 20:47:24 2021 +0100 msvcrt: Improve __libm_sse2_sqrt_precise implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index a4519c03607..0f41cbac468 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1165,13 +1165,14 @@ double CDECL sinh( double x ) return ret; } -static inline double CDECL ret_nan( void ) +static inline double CDECL ret_nan( BOOL update_sw ) { double x = 1.0; + if (!update_sw) return -NAN; return (x - x) / (x - x); } -BOOL sqrt_validate( double *x ) +BOOL sqrt_validate( double *x, BOOL update_sw ) { short c = _dclass(*x); @@ -1179,7 +1180,8 @@ BOOL sqrt_validate( double *x ) if (c == FP_NAN) { #ifdef __i386__ - *x = math_error(_DOMAIN, "sqrt", *x, 0, *x); + if (update_sw) + *x = math_error(_DOMAIN, "sqrt", *x, 0, *x); #else /* set signaling bit */ *(ULONGLONG*)x |= 0x8000000000000ULL; @@ -1188,14 +1190,14 @@ BOOL sqrt_validate( double *x ) } if (signbit(*x)) { - *x = math_error(_DOMAIN, "sqrt", *x, 0, ret_nan()); + *x = math_error(_DOMAIN, "sqrt", *x, 0, ret_nan(update_sw)); return FALSE; } if (c == FP_INFINITE) return FALSE; return TRUE; } -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(__i386__) double CDECL sse2_sqrt(double); __ASM_GLOBAL_FUNC( sse2_sqrt, "sqrtsd %xmm0, %xmm0\n\t" @@ -1241,12 +1243,12 @@ __ASM_GLOBAL_FUNC( x87_sqrt, double CDECL sqrt( double x ) { #ifdef __x86_64__ - if (!sqrt_validate(&x)) + if (!sqrt_validate(&x, TRUE)) return x; return sse2_sqrt(x); #elif defined( __i386__ ) - if (!sqrt_validate(&x)) + if (!sqrt_validate(&x, TRUE)) return x; return x87_sqrt(x); @@ -1259,7 +1261,7 @@ double CDECL sqrt( double x ) unsigned int r,t1,s1,ix1,q1; ULONGLONG ix; - if (!sqrt_validate(&x)) + if (!sqrt_validate(&x, TRUE)) return x; ix = *(ULONGLONG*)&x; @@ -3344,12 +3346,25 @@ void __cdecl __libm_sse2_tanf(void) */ void __cdecl __libm_sse2_sqrt_precise(void) { + unsigned int cw; double d; + __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); - d = sqrt( d ); - __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); -} + __control87_2(0, 0, NULL, &cw); + if (cw & _MCW_RC) + { + d = sqrt(d); + __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); + return; + } + if (!sqrt_validate(&d, FALSE)) + { + __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); + return; + } + __asm__ __volatile__( "call " __ASM_NAME( "sse2_sqrt" ) ); +} #endif /* __i386__ */ /*********************************************************************
1
0
0
0
Piotr Caban : msvcrt: Improve sqrt accuracy and performance on i386.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: ba3cc1274d2267355636e5d4eafc5ac69950859c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ba3cc1274d2267355636e5d4…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Feb 1 20:47:14 2021 +0100 msvcrt: Improve sqrt accuracy and performance on i386. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 32971f73543..a4519c03607 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1202,6 +1202,37 @@ __ASM_GLOBAL_FUNC( sse2_sqrt, "ret" ) #endif +#ifdef __i386__ +#define SET_X87_CW \ + "subl $4, %esp\n\t" \ + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") \ + "fnstcw (%esp)\n\t" \ + "movw (%esp), %ax\n\t" \ + "testw $0xc00, %ax\n\t" \ + "jz 1f\n\t" \ + "andw $0xf3ff, %ax\n\t" \ + "movw %ax, 2(%esp)\n\t" \ + "fldcw 2(%esp)\n\t" \ + "1:\n\t" + +#define RESET_X87_CW \ + "movw (%esp), %ax\n\t" \ + "testw $0xc00, %ax\n\t" \ + "jz 1f\n\t" \ + "fldcw (%esp)\n\t" \ + "1:\n\t" \ + "addl $4, %esp\n\t" \ + __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t") + +double CDECL x87_sqrt(double); +__ASM_GLOBAL_FUNC( x87_sqrt, + "fldl 4(%esp)\n\t" + SET_X87_CW + "fsqrt\n\t" + RESET_X87_CW + "ret" ) +#endif + /********************************************************************* * sqrt (MSVCRT.@) * @@ -1214,6 +1245,11 @@ double CDECL sqrt( double x ) return x; return sse2_sqrt(x); +#elif defined( __i386__ ) + if (!sqrt_validate(&x)) + return x; + + return x87_sqrt(x); #else static const double tiny = 1.0e-300;
1
0
0
0
Piotr Caban : msvcrt: Imporve sqrt accuracy and performance on x86_64.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: e53c4bd50921f9eedddb316644dd7847d67e0105 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e53c4bd50921f9eedddb3166…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Feb 1 20:47:08 2021 +0100 msvcrt: Imporve sqrt accuracy and performance on x86_64. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 88 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 26 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 66fd3b5c036..32971f73543 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1165,6 +1165,43 @@ double CDECL sinh( double x ) return ret; } +static inline double CDECL ret_nan( void ) +{ + double x = 1.0; + return (x - x) / (x - x); +} + +BOOL sqrt_validate( double *x ) +{ + short c = _dclass(*x); + + if (c == FP_ZERO) return FALSE; + if (c == FP_NAN) + { +#ifdef __i386__ + *x = math_error(_DOMAIN, "sqrt", *x, 0, *x); +#else + /* set signaling bit */ + *(ULONGLONG*)x |= 0x8000000000000ULL; +#endif + return FALSE; + } + if (signbit(*x)) + { + *x = math_error(_DOMAIN, "sqrt", *x, 0, ret_nan()); + return FALSE; + } + if (c == FP_INFINITE) return FALSE; + return TRUE; +} + +#if defined(__x86_64__) +double CDECL sse2_sqrt(double); +__ASM_GLOBAL_FUNC( sse2_sqrt, + "sqrtsd %xmm0, %xmm0\n\t" + "ret" ) +#endif + /********************************************************************* * sqrt (MSVCRT.@) * @@ -1172,6 +1209,12 @@ double CDECL sinh( double x ) */ double CDECL sqrt( double x ) { +#ifdef __x86_64__ + if (!sqrt_validate(&x)) + return x; + + return sse2_sqrt(x); +#else static const double tiny = 1.0e-300; double z; @@ -1180,21 +1223,13 @@ double CDECL sqrt( double x ) unsigned int r,t1,s1,ix1,q1; ULONGLONG ix; + if (!sqrt_validate(&x)) + return x; + ix = *(ULONGLONG*)&x; ix0 = ix >> 32; ix1 = ix; - /* take care of Inf and NaN */ - if (isnan(x) || (isinf(x) && x > 0)) - return x; - - /* take care of zero */ - if (ix0 <= 0) { - if (((ix0 & ~sign) | ix1) == 0) - return x; /* sqrt(+-0) = +-0 */ - if (ix0 < 0) - return math_error(_DOMAIN, "sqrt", x, 0, (x - x) / (x - x)); - } /* normalize x */ m = ix0 >> 20; if (m == 0) { /* subnormal x */ @@ -1278,6 +1313,7 @@ double CDECL sqrt( double x ) ix <<= 32; ix |= ix1; return *(double*)&ix; +#endif } /********************************************************************* @@ -3424,6 +3460,21 @@ __int64 CDECL llrintf(float x) return unix_funcs->llrintf( x ); } +/********************************************************************* + * _dclass (MSVCR120.@) + * + * Copied from musl: src/math/__fpclassify.c + */ +short CDECL _dclass(double x) +{ + union { double f; UINT64 i; } u = { x }; + int e = u.i >> 52 & 0x7ff; + + if (!e) return u.i << 1 ? FP_SUBNORMAL : FP_ZERO; + if (e == 0x7ff) return (u.i << 12) ? FP_NAN : FP_INFINITE; + return FP_NORMAL; +} + #if _MSVCR_VER>=120 /********************************************************************* @@ -3490,21 +3541,6 @@ float CDECL truncf(float x) return unix_funcs->truncf(x); } -/********************************************************************* - * _dclass (MSVCR120.@) - * - * Copied from musl: src/math/__fpclassify.c - */ -short CDECL _dclass(double x) -{ - union { double f; UINT64 i; } u = { x }; - int e = u.i >> 52 & 0x7ff; - - if (!e) return u.i << 1 ? FP_SUBNORMAL : FP_ZERO; - if (e == 0x7ff) return (u.i << 12) ? FP_NAN : FP_INFINITE; - return FP_NORMAL; -} - /********************************************************************* * _fdclass (MSVCR120.@) *
1
0
0
0
Piotr Caban : msvcr110: Copy utf16 strings in _Gettnames.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: b3fcb0f2c854311bd1604df958a6425c22c657b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b3fcb0f2c854311bd1604df9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 2 18:55:33 2021 +0100 msvcr110: Copy utf16 strings in _Gettnames. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50409
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr120/tests/msvcr120.c | 13 ++++++++++--- dlls/msvcrt/locale.c | 12 ++++++++++++ dlls/msvcrt/tests/locale.c | 4 ++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index 5976a86963a..a68870ac77b 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -171,6 +171,7 @@ static int (__cdecl *p__dpcomp)(double x, double y); static wchar_t** (CDECL *p____lc_locale_name_func)(void); static unsigned int (CDECL *p__GetConcurrency)(void); static void* (CDECL *p__W_Gettnames)(void); +static void* (CDECL *p__Gettnames)(void); static void (CDECL *p_free)(void*); static float (CDECL *p_strtof)(const char *, char **); static int (CDECL *p__finite)(double); @@ -242,6 +243,7 @@ static BOOL init(void) p____lc_locale_name_func = (void*)GetProcAddress(module, "___lc_locale_name_func"); p__GetConcurrency = (void*)GetProcAddress(module,"?_GetConcurrency@details@Concurrency@@YAIXZ"); p__W_Gettnames = (void*)GetProcAddress(module, "_W_Gettnames"); + p__Gettnames = (void*)GetProcAddress(module, "_Gettnames"); p_free = (void*)GetProcAddress(module, "free"); p_strtof = (void*)GetProcAddress(module, "strtof"); p__finite = (void*)GetProcAddress(module, "_finite"); @@ -531,7 +533,7 @@ static void test__GetConcurrency(void) ok(c == si.dwNumberOfProcessors, "expected %u, got %u\n", si.dwNumberOfProcessors, c); } -static void test__W_Gettnames(void) +static void test_gettnames(void* (CDECL *p_gettnames)(void)) { static const char *str[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", @@ -557,7 +559,7 @@ static void test__W_Gettnames(void) if(!p_setlocale(LC_ALL, "english")) return; - ret = p__W_Gettnames(); + ret = p_gettnames(); size = ret->str[0]-(char*)ret; if(sizeof(void*) == 8) ok(size==0x2c0, "structure size: %x\n", size); @@ -572,6 +574,10 @@ static void test__W_Gettnames(void) ok(!lstrcmpW(ret->wstr[i], buf), "ret->wstr[%d] = %s, expected %s\n", i, wine_dbgstr_w(ret->wstr[i]), wine_dbgstr_w(buf)); } + + ok(ret->str[42] + strlen(ret->str[42])+1 == (char*)ret->wstr[0], + "ret->str[42] = %p len = %d, ret->wstr[0] = %p\n", + ret->str[42], strlen(ret->str[42]), ret->wstr[0]); p_free(ret); p_setlocale(LC_ALL, "C"); @@ -1111,7 +1117,8 @@ START_TEST(msvcr120) test__dpcomp(); test____lc_locale_name_func(); test__GetConcurrency(); - test__W_Gettnames(); + test_gettnames(p__W_Gettnames); + test_gettnames(p__Gettnames); test__strtof(); test_remainder(); test_critical_section(); diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 79a8d47d6d5..5a4a701dfc6 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -804,6 +804,10 @@ void* CDECL _Gettnames(void) for(i=0; i<ARRAY_SIZE(cur->str.str); i++) size += strlen(cur->str.str[i])+1; +#if _MSVCR_VER >= 110 + for(i=0; i<ARRAY_SIZE(cur->wstr.wstr); i++) + size += (wcslen(cur->wstr.wstr[i]) + 1) * sizeof(wchar_t); +#endif ret = malloc(size); if(!ret) @@ -817,6 +821,14 @@ void* CDECL _Gettnames(void) ret->str.str[i] = &ret->data[size]; size += len; } +#if _MSVCR_VER >= 110 + for(i=0; i<ARRAY_SIZE(cur->wstr.wstr); i++) { + len = (wcslen(cur->wstr.wstr[i]) + 1) * sizeof(wchar_t); + memcpy(&ret->data[size], cur->wstr.wstr[i], len); + ret->wstr.wstr[i] = (wchar_t*)&ret->data[size]; + size += len; + } +#endif return ret; } diff --git a/dlls/msvcrt/tests/locale.c b/dlls/msvcrt/tests/locale.c index 176e3b5e6e4..030d65de3cb 100644 --- a/dlls/msvcrt/tests/locale.c +++ b/dlls/msvcrt/tests/locale.c @@ -733,6 +733,10 @@ static void test__Gettnames(void) ok(!strcmp(ret->str[i], buf), "ret->str[%i] = %s, expected %s\n", i, ret->str[i], buf); } + ok(ret->wstr[0] != NULL, "ret->wstr[0] = NULL\n"); + ok(ret->str[42] + strlen(ret->str[42])+1 != (char*)ret->wstr[0], + "ret->str[42] = %p len = %d, ret->wstr[0] = %p\n", + ret->str[42], strlen(ret->str[42]), ret->wstr[0]); free(ret); if(!setlocale(LC_TIME, "german"))
1
0
0
0
Piotr Caban : msvcrt: Make __lc_time_data more similar to native.
by Alexandre Julliard
02 Feb '21
02 Feb '21
Module: wine Branch: master Commit: 859261f4809a47fd030b605a6e418b7ac52f0790 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=859261f4809a47fd030b605a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 2 18:55:12 2021 +0100 msvcrt: Make __lc_time_data more similar to native. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/locale.c | 6 ++++++ dlls/msvcrt/msvcrt.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index ba98d31d719..79a8d47d6d5 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -63,12 +63,14 @@ __lc_time_data cloc_time_data = MAKELCID(LANG_ENGLISH, SORT_DEFAULT), #endif 1, 0, +#if _MSVCR_VER == 0 || _MSVCR_VER >= 100 {{L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat", L"Sunday", L"Monday", L"Tuesday", L"Wednesday", L"Thursday", L"Friday", L"Saturday", L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec", L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December", L"AM", L"PM", L"MM/dd/yy", L"dddd, MMMM dd, yyyy", L"HH:mm:ss"}}, +#endif #if _MSVCR_VER >= 110 L"en-US", #endif @@ -1184,10 +1186,12 @@ static __lc_time_data* create_time_data(LCID lcid) return NULL; size += ret; +#if _MSVCR_VER == 0 || _MSVCR_VER >= 100 ret = GetLocaleInfoW(lcid, time_data[i], NULL, 0); if(!ret) return NULL; size += ret*sizeof(wchar_t); +#endif } #if _MSVCR_VER >= 110 size += LCIDToLocaleName(lcid, NULL, 0, 0)*sizeof(wchar_t); @@ -1202,11 +1206,13 @@ static __lc_time_data* create_time_data(LCID lcid) cur->str.str[i] = &cur->data[ret]; ret += GetLocaleInfoA(lcid, time_data[i], &cur->data[ret], size-ret); } +#if _MSVCR_VER == 0 || _MSVCR_VER >= 100 for(i=0; i<ARRAY_SIZE(time_data); i++) { cur->wstr.wstr[i] = (wchar_t*)&cur->data[ret]; ret += GetLocaleInfoW(lcid, time_data[i], (wchar_t*)&cur->data[ret], size-ret)*sizeof(wchar_t); } +#endif #if _MSVCR_VER >= 110 cur->locname = (wchar_t*)&cur->data[ret]; LCIDToLocaleName(lcid, (wchar_t*)&cur->data[ret], (size-ret)/sizeof(wchar_t), 0); diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index c360943b1f0..0a742807430 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -66,6 +66,7 @@ typedef struct __lc_time_data { #endif int unk; int refcount; +#if _MSVCR_VER == 0 || _MSVCR_VER >= 100 union { const wchar_t *wstr[43]; struct { @@ -80,6 +81,7 @@ typedef struct __lc_time_data { const wchar_t *time; } names; } wstr; +#endif #if _MSVCR_VER >= 110 const wchar_t *locname; #endif
1
0
0
0
← Newer
1
...
81
82
83
84
85
86
87
...
92
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
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200