winpthreads: Call `_fpreset()` for new threads

This is necessary for math functions taking `long double` arguments to
work reliably, as by default, new threads have their x87 precision set
to 53 bits.

Note the x87 control word can't be set in the TLS callback. It gets
overwritten before the thread procedure begins execution. There is NO
workaround for the win32 thread model, other than requiring users to
call `_fpreset()` themselves.

Reference: https://sourceforge.net/p/mingw-w64/mailman/message/37084134/
Signed-off-by: Liu Hao <lh_mouse@126.com>
1 file changed