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

2024-10-21 Thread Pali Rohár
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 ++- .../lib-common/ucrtbase-common.def.in

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

2024-10-21 Thread LIU Hao
在 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 take a look later. Attached is a patch

[Mingw-w64-public] [PATCH v2] winpthreads: also use SetThreadDescription to set thread name

2024-10-21 Thread Antonin Décimo
Using SetThreadDescription has the advantage that on recent Visual Studio / Windows, the thread name is always available regardless of whether a debugger was attached, is also available in crash dumps, and to other tools. Quoting MSDN at Set a thread name in C/C++: https://learn.microsoft.com/en-u

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

2024-10-21 Thread LIU Hao
在 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 be able to just skip runtime check th

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

2024-10-21 Thread Jacek Caban
On 21.10.2024 03:25, LIU Hao wrote: 在 2024-10-19 21:49, Morilli 写道: This speeds up all floating-point rounding and exception functions by only querying cpuid once and storing its result. This helps when such functions are repeatedly called. This fixes https://sourceforge.net/p/mingw-w64/bugs/995

Re: [Mingw-w64-public] [PATCH] headers: Fix intsafe.h

2024-10-21 Thread Jacek Caban
On 20.10.2024 21:33, David Grayson wrote: Fix ULongToChar to return -1 on overflow, like it does in the SDK. Fix LongLongToUIntPtr and LongLongToULongPtr so they work on 32-bit. Remove about 150 macros added this year that just redefine an existing function. Please consider running the new and

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

2024-10-21 Thread Morilli
> Do you think it's acceptable to drop this check, assuming SSE is available > everywhere on x86? Most likely yes. The reason I didn't do this here is because this explicit check was intentionally put there (in f3ff0bcc88696e00d40cef4fe913160e1cca6370). Given, this was 15 years ago, so perhaps th