From:  Dan Gohman <sunfish@mozilla.com>
Date:  04 Jan 2017 17:58:35 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.tech.js-engine.internals
Subject:  

Re: PSA: the JS shell must now be compiled with SSE2 support on x86 platforms

NNTP-Posting-Host:  63.245.214.181

-ffloat-store does address some issues on x87, but not all.

By itself, -ffloat-store does double rounding (80-bit then 64-bit) which
can produce different results than rounding directly to 64-bit in a single
step.

When it can, SpiderMonkey also sets the x87's precision control field to
64-bit (see js::FIX_FPU), which avoids most of the double-rounding
differences. However, the x87's precision control field only changes the
effective size of the fractional part, and not the exponent part, so it
still rounds differently than single-step rounding in extreme cases, for
example 0x1.db3bd2a286944p-599 * 0x1.ce910af1d55cap-425.

Also, the x87's load instructions automatically convert sNaN to qNaN, which
is a different bit pattern, which can be observed in various places in wasm.

Dan


On Tue, Jan 3, 2017 at 11:45 PM,  wrote:

> I quess I was dealing with this problem.
>
> "-ffloat-store" gcc option was working for me to fix floating point
> correctness issues. To make jstests passing on x86...
>
>
> On Tuesday, January 3, 2017 at 11:48:49 AM UTC+1, Benjamin Bouvier wrote:
> > Following
> > https://groups.google.com/d/topic/mozilla.dev.platform/
> v3Mz5iuMkig/discussion,
> > Firefox builds now include SSE2 flags on all tier-1 32-bits x86
> platforms.
> > The Spidermonkey JS shell using a different build system, the SSE2 flags
> > have not been included until bug 1326027 landed. Bug 1326027 also
> included
> > changes that require SSE2 to be enabled on these platforms (= x86 and
> ARM32
> > simulator, since it uses x86 as an host).
> >
> > If you see wasm related failures when building on x86 32-bits, add these
> > flags to your compiler flags:
> > - "-msse -msse2 -mfpmath=sse" on linux32 builds, with gcc or clang
> > - "-arch:SSE2" on win32 builds, with cl
> >
> > If you simply use the autospider.py tool [1], these flags will now be
> > included by default. This is what's used on our CI infrastructure.
> >
> > Building without SSE2 support on x86 is still possible, but it will
> impact
> > WebAssembly correctness in all running modes.
> >
> > Cheers,
> > Benjamin
> >
> > [1]
> > http://searchfox.org/mozilla-central/source/js/src/devtools/automation/
> autospider.py
>
> _______________________________________________
> dev-tech-js-engine-internals mailing list
> dev-tech-js-engine-internals@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
>