On Fri, 13 Dec 2019, Liu Hao wrote:
Two testcases have been attached, the first one is for `double` and the
other is for `float`. They compile and run fine with Glibc on Linux but
fails on x64.
Side note: The test may fail on x86 without excess casts, due to the
fact that x87 extending format is used for intermediate results, which
always cause double-rounding errors. In order for the test to pass,
hardware single-precision floating-point arithmetic must be enabled by
using GCC's `-msse -mfpmath=sse` options.
Do you mean in the testcase itself, or in the implementation of the fma
function?
If the latter, should we build that part of mingw-w64-crt with specific
compiler flags, or perhaps with the implementation converted to assembly
(either inline or separate) to enforce the right form?
+static inline void break_down(iec559_double *restrict lo, iec559_double
*restrict hi, double x) {
+ hi->f = x;
+ /* Erase low-order significant bits. `hi->f` now has only 32
significant bits. */
32 bits? I can't get that number to add up properly, regardless if
including the sign/exponent or omitting it...
+static inline void break_down(iec559_float *restrict lo, iec559_float
*restrict hi, float x) {
+ hi->f = x;
+ /* Erase low-order significant bits. `hi->f` now has only 32
significant bits. */
Ditto
Other than these details, the implementations look good to me.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public