You can set the FPU precision for the main thread by linking CRT_fp8.o or CRT_f10.o. Extended precision is the default for most mingw-w64 based toolchains as the math library used in mingw-w64 is based on this. The question is: what happens when a new thread is started?.
Answer: Windows starts new threads NEVER with extended precision, because double precision is the default for MS VS Studio and the Win32 API. To get consistent behaviour inside a mingw-w64 based project the FPU precision must be coded consistently by the programmer itself. Or you have to use the patch https://sourceforge.net/p/mingw-w64/mingw-w64/ci/295fafc : consistent behaviour will be guaranteed automatically at least for pthreads. I guess this patch is not included in the v8 of mingw-w64. If you are not sure what is happening use: https://github.com/jevinskie/fpudump to print out the FPU state anywhere in your program. It may only work with C, but not with C++ programs, but I'm not sure. Am Do., 6. Mai 2021 um 10:11 Uhr schrieb Benjamin Bihler < [email protected]>: > It may have to do something with the commit you have mentioned. I am not > sure... I am a compiler end user, not a compiler developer. What does that > mean? That linking CRT_fp8 or CRT_fp10 is not the right way anymore to set > x87 precision? > > Benjamin > > -----Ursprüngliche Nachricht----- > Von: Liu Hao [mailto:[email protected]] > Gesendet: Dienstag, 4. Mai 2021 16:56 > An: [email protected]; Carl Kleffner < > [email protected]> > Betreff: Re: [Mingw-w64-public] Setting Floating-Point Operation Precision > Changes With Gcc 10.3 > > 在 2021-05-04 22:46, Carl Kleffner 写道: > > I can't reproduce this behaviour. With gcc-10.3 on msys2/ucrt64 as > > well > as > > msy2/mingw64 I get consistent results, regardless if I link > > CRT_fp10.o, CRT_fp8.o or none of them. > > > > > > Does it have something to do with > https://sourceforge.net/p/mingw-w64/mingw-w64/ci/295fafc? > > > -- > Best regards, > Liu Hao > > > _______________________________________________ > Mingw-w64-public mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
