reactos/sdk
Colin Finck bd0a28d1e4 Fix the MSVC version of ldexp filling up the FPU stack and bailing out with #IND after a few calls. Additionally, add it back to libcntpr.
MSVC was previously given a "result" variable to copy the fscale result from st(0). This led to another "fld" FPU stack push at the very end without popping the source value from the FPU stack.
Moreover, this copy isn't even needed: A simple "fstp st(1)" at the end pops an element from the FPU stack while effectively storing the result in st(0), the register used for returning a double value.
This problem didn't affect GCC, as it is only given the "fscale" instruction and does all necessary stack operations itself.

However, looking into the CRT sources, I found many other i386 implementations with inline assembly suffering from the same problem.
Fortunately, they have been replaced by pure assembly implementations a while ago, so it's time to finally remove them.
ldexp would have also been a candidate for a pure assembly implementation, but the required check for NaN and setting errno (verified on Win2003) already outweighs the benefits.
And we cannot just do a NaN check with FUCOMI as this is an i686/pentiumpro instruction while we're still targeting i586/pentium.

I'm also using this opportunity to clean up the ldexp.c header and only put in the remaining contributors as returned by "git blame".

Thanks to NightWolve1975 for reporting the problem! (https://twitter.com/nightwolve1975/status/1099042477531643912)
2019-03-03 16:11:27 +01:00
..
cmake [CMAKE] msvc.cmake: Remove 2 now redundant '/GF' (#1239) 2019-02-10 16:46:23 +01:00
include [XDK] Remove _M_AMD64 special case 2019-02-25 20:00:35 +01:00
lib Fix the MSVC version of ldexp filling up the FPU stack and bailing out with #IND after a few calls. Additionally, add it back to libcntpr. 2019-03-03 16:11:27 +01:00
tools [WIDL] Sync with Wine Staging 4.0. CORE-15682 2019-01-29 13:18:09 +01:00