在 2026-10-25 22:24, Pali Rohár 写道:
I checked different 32-bit x86 crtdll and msvcr* versions of their _fpreset function and the results are quite surprising.32-bit x86 x87 SSE crtdll 64-bit nothing msvcrt10 64-bit nothing msvcrt20 64-bit nothing msvcrt40 53-bit nothing msvcrt (4.2/5.0/6.0) 53-bit nothing msvcrt (nt4/98/me/2k/xp/2003sp1) 53-bit nothing msvcrt (2003sp2,vista,7,8,8.1,10) 53-bit reset msvcr70 53-bit nothing msvcr71 53-bit nothing msvcr80 53-bit reset msvcr90 53-bit reset msvcr100 53-bit reset msvcr110 53-bit reset msvcr120 53-bit reset ucrt 53-bit reset 64-bit x86 everything nothing reset
In Microsoft 16-bit compiler, `long double` was 10 bytes [1]. It's only since their 32-bit compiler that `long double` is 8 bytes.
[1] https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa246459(v=vs.60)
So it is needed to fix _fpreset in CRT_fp8.c for crtdll, msvcrt10 and msvcrt20 builds because it does not set x87 precision to 53-bit mantisa. And it is also needed to fix all CRT_fp*.c for pre-msvcr80 builds because it does not reset SSE MXCSR.
I don't think these are issues. Code which still links against crtdll or msvcr40- shouldn't use SSE, as these DLLs predate SSE. And when msvcr7[01] were created, AMD64 was not a thing; the 64-bit platform at that time was Itanium.
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
