Re: [Mingw-w64-public] [PATCH] crt: Speedup __mingw_has_sse by storing cpuid result

2024-10-22 Thread LIU Hao
在 2024-10-22 23:32, Ozkan Sezer 写道: A minor tweak would be like: if (__has_sse < 0) { int cpuInfo[4], infoType = 1; int o_flag, n_flag; There's already a half-way return in that function, so personally I prefer more half-way returns rather than this kinda large if-statement which

Re: [Mingw-w64-public] [PATCH v2] crt: Fix building of libmsvcrtd.a import library

2024-10-22 Thread Pali Rohár
On Wednesday 23 October 2024 00:06:01 Martin Storsjö wrote: > On Tue, 22 Oct 2024, Pali Rohár wrote: > > > On Tuesday 22 October 2024 23:52:11 Martin Storsjö wrote: > > > On Sat, 19 Oct 2024, Pali Rohár wrote: > > > > > > > libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot >

Re: [Mingw-w64-public] [PATCH v2] crt: Fix building of libmsvcrtd.a import library

2024-10-22 Thread Pali Rohár
On Tuesday 22 October 2024 23:52:11 Martin Storsjö wrote: > On Sat, 19 Oct 2024, Pali Rohár wrote: > > > libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot > > include libmsvcrt_extra.a library which object files are compiled with > > -D__LIBMSVCRT_OS__ which instruct code to a

Re: [Mingw-w64-public] [PATCH v2] crt: Fix building of libmsvcrtd.a import library

2024-10-22 Thread Martin Storsjö
On Tue, 22 Oct 2024, Pali Rohár wrote: On Tuesday 22 October 2024 23:52:11 Martin Storsjö wrote: On Sat, 19 Oct 2024, Pali Rohár wrote: libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot include libmsvcrt_extra.a library which object files are compiled with -D__LIBMSVCRT_O

Re: [Mingw-w64-public] [PATCH] crt: Speedup __mingw_has_sse by storing cpuid result

2024-10-22 Thread Jacek Caban
On 22.10.2024 17:17, LIU Hao wrote: 在 2024-10-22 22:18, Jacek Caban 写道: Style-wise, I would perhaps prefer a solution that uses fewer #ifdefs. We could for example change __mingw_has_sse to always return true when it's defined. It would limit optimization opportunities for the compiler, so per

Re: [Mingw-w64-public] [PATCH] crt: Disable float env functions for all CRT import libraries

2024-10-22 Thread Martin Storsjö
On Mon, 21 Oct 2024, Pali Rohár wrote: See commit e5d1fe451b81 ("ucrt: Don't use the float env functions from the UCRTt library") for more details. --- .../api-ms-win-crt-runtime-l1-1-0.def.in | 18 +++--- mingw-w64-crt/lib-common/msvcr120_app.def.in | 24 ++- .../li

Re: [Mingw-w64-public] [PATCH v2] crt: Fix building of libmsvcrtd.a import library

2024-10-22 Thread Martin Storsjö
On Sat, 19 Oct 2024, Pali Rohár wrote: libmsvcrtd.a is import library for msvcrtd.dll and therefore it cannot include libmsvcrt_extra.a library which object files are compiled with -D__LIBMSVCRT_OS__ which instruct code to access msvcrt.dll library. Add a new static library libmsvcrtd_extra.a w

Re: [Mingw-w64-public] [PATCH] crt: Speedup __mingw_has_sse by storing cpuid result

2024-10-22 Thread Ozkan Sezer
On Tue, Oct 22, 2024 at 6:19 PM LIU Hao wrote: > > 在 2024-10-22 22:18, Jacek Caban 写道: > > Style-wise, I would perhaps prefer a solution that uses fewer #ifdefs. We > > could for example change > > __mingw_has_sse to always return true when it's defined. It would limit > > optimization opportuni

Re: [Mingw-w64-public] [PATCH] crt: Speedup __mingw_has_sse by storing cpuid result

2024-10-22 Thread LIU Hao
在 2024-10-22 22:18, Jacek Caban 写道: Style-wise, I would perhaps prefer a solution that uses fewer #ifdefs. We could for example change __mingw_has_sse to always return true when it's defined. It would limit optimization opportunities for the compiler, so perhaps we could have it in a header and

Re: [Mingw-w64-public] [PATCH] crt: Speedup __mingw_has_sse by storing cpuid result

2024-10-22 Thread Jacek Caban
On 21.10.2024 13:11, LIU Hao wrote: 在 2024-10-21 18:30, Jacek Caban 写道: I'm not sure about 32-bit targets, I'd expect that it would be mostly fine assumption, but it would contradict efforts to support crts from win9x era. For 64-bit it's always available, SSE is a requirement there, we should

Re: [Mingw-w64-public] [PATCH] crt: Speedup __mingw_has_sse by storing cpuid result

2024-10-22 Thread Jacek Caban
On 21.10.2024 16:50, LIU Hao wrote: 在 2024-10-21 19:11, LIU Hao 写道: BTW, affected functions seem to be available in modern msvcrt (msvcr120 and UCRT), so another solution for the bug would be to move those function out of mingwex and use implementation provided by OS when possible. I can tak