From: <dan...@ya...> - 2002-04-15 23:14:54
|
Hi. Currently mingw set the default floating point precision at startup to 64 bit (53-bit mantissa). This mean that coprocessor does its intermediate calculations in 53 bits rather than the Intel x87 default of 64 bit mantissa. Accoding to Intel docs this affects only the instructions ADD, SUB, DIV, MUL, and SQRT. For other insns, either the precision is determined by the opcode or extended precision (64-bit mantissa) is used. Do we want to continue this? One problem I see with changing to extended precision (or aleast providing a simple option to set the default as extended) is that any time user code calls the non-ANSI MSVCRT function _fpreset(), it will reset the precision back to 53-bit. Using the alternative C99 function call fesetenv(FE_DFL_ENV), would reset the FP environemnt to Intel default of 64-bit mantissa (at least the way I've written fesetenv.c in mingwex). Having the option of extended precision would allow a real long double type (Currently, GCC defines long double as 80 bits padded to 96 bits. However, the long double type has the same precision as a double because of the call to _fpreset() at runtime startup ). It would *not* mean that we could printf or scanf long doubles, because mscvrt versions of thse functions expect 64 bit reals. Long double math fuctions however would be possible as add-ons to runtime lib. Danny http://messenger.yahoo.com.au - Yahoo! Messenger - A great way to communicate long-distance for FREE! |