mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 13:45:27 +00:00
Bug 1076670 - Workaround VS2013 64-bit returning +0 instead of -0 for sin(-0). r=luke
This commit is contained in:
parent
abd8b40060
commit
286458677e
@ -878,12 +878,18 @@ js::math_round(JSContext *cx, unsigned argc, Value *vp)
|
||||
double
|
||||
js::math_sin_impl(MathCache *cache, double x)
|
||||
{
|
||||
return cache->lookup(sin, x, MathCache::Sin);
|
||||
return cache->lookup(math_sin_uncached, x, MathCache::Sin);
|
||||
}
|
||||
|
||||
double
|
||||
js::math_sin_uncached(double x)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
// Workaround MSVC bug where sin(-0) is +0 instead of -0 on x64 on
|
||||
// CPUs without FMA3 (pre-Haswell). See bug 1076670.
|
||||
if (IsNegativeZero(x))
|
||||
return -0.0;
|
||||
#endif
|
||||
return sin(x);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user