Revert "Use MSVC intrinsic sqrt() on x86 for XBRZ"

This reverts commit 55a0a52a39.

Does not make any difference, the performance issue is elsewhere.
This commit is contained in:
Rafael Kitover 2022-02-03 07:57:51 +00:00
parent 55a0a52a39
commit 8bd09c9012
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,13 @@ inline double fastSqrt(double n)
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__x86_64__) || defined(__i386__)) #if (defined(__GNUC__) || defined(__clang__)) && (defined(__x86_64__) || defined(__i386__))
__asm__ ("fsqrt" : "+t" (n)); __asm__ ("fsqrt" : "+t" (n));
return n; return n;
#elif defined(_MSC_VER) && defined(_M_IX86)
// speeds up xBRZ by about 9% compared to std::sqrt which internally uses
// the same assembler instructions but adds some "fluff"
__asm {
fld n
fsqrt
}
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
// On MSVC x64 use intrinsic with /Oi and /fp:fast // On MSVC x64 use intrinsic with /Oi and /fp:fast
return sqrt(n); return sqrt(n);