Bug 194853 - [JSC][x86] Drop support for x87 floating point
Summary: [JSC][x86] Drop support for x87 floating point
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-20 02:49 PST by Xan Lopez
Modified: 2019-04-19 12:01 PDT (History)
13 users (show)

See Also:


Attachments
Drop x87 support (44.59 KB, patch)
2019-02-20 02:53 PST, Xan Lopez
no flags Details | Formatted Diff | Diff
Drop x87 support (44.16 KB, patch)
2019-02-20 03:55 PST, Xan Lopez
no flags Details | Formatted Diff | Diff
Drop x87 support (44.18 KB, patch)
2019-02-20 04:07 PST, Xan Lopez
keith_miller: review+
keith_miller: commit-queue-
Details | Formatted Diff | Diff
Drop x87 support (44.04 KB, patch)
2019-03-21 05:44 PDT, Xan Lopez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xan Lopez 2019-02-20 02:49:50 PST
A x86/32bit build (see bug #194147) fails a number of stress tests because of one-off rounding errors in floating point operations. This is caused by the use of extended precision FP registers, which is what x87 does unless told otherwise. We can work around this in a number of ways: forcing SSE2 for x86 at build time, forcing the use of double precision registers in x87, etc. After some digging up, though, it was noticed that other browsers are increasing their minimum requirements for intel hardware to pentium4/SSE2, as:

* Firefox: https://support.mozilla.org/en-US/kb/your-hardware-no-longer-supported
* Chrome: https://support.google.com/chrome/a/answer/7100626?hl=en

This simplifies our code, and intel hardware without SSE2 is in practice extremely rare. The following patch assumes SSE2 throughout the codebase, removes x87 support in certain places, and gets rid of a few obsolete comments. I have left in place SSE2 detection in MacroAssemblerX86 class, and required it through a static_assert. It's just a few lines of C++ code and it seems much easier than adding a lot of new CMake code to do the same thing.
Comment 1 Xan Lopez 2019-02-20 02:53:01 PST
Created attachment 362490 [details]
Drop x87 support
Comment 2 Caio Lima 2019-02-20 03:55:03 PST
Comment on attachment 362490 [details]
Drop x87 support

LGTM. I wonder what EWS thinks about it.
Comment 3 Xan Lopez 2019-02-20 03:55:52 PST
Created attachment 362491 [details]
Drop x87 support
Comment 4 Xan Lopez 2019-02-20 04:07:35 PST
Created attachment 362492 [details]
Drop x87 support
Comment 5 Keith Miller 2019-03-11 10:03:45 PDT
Comment on attachment 362492 [details]
Drop x87 support

r=me. Can we make sure no one else wants this on webkit-dev before landing though?
Comment 6 Xan Lopez 2019-03-11 11:01:20 PDT
(In reply to Keith Miller from comment #5)
> Comment on attachment 362492 [details]
> Drop x87 support
> 
> r=me. Can we make sure no one else wants this on webkit-dev before landing
> though?

Sent the email, let's see: https://lists.webkit.org/pipermail/webkit-dev/2019-March/030529.html
Comment 7 Don Olmstead 2019-03-11 14:01:33 PDT
WinCairo can technically build in 32-bit mode but we don't provide that anyways. Minimum install for Windows definitely requires a PC with SSE2 support so we're fine with this. PlayStation is x64 so again no problem.

Will let someone from the AppleWin side chime in here but honestly it doesn't seem like an issue.
Comment 8 Xan Lopez 2019-03-21 05:44:09 PDT
Created attachment 365539 [details]
Drop x87 support

Seems nobody has anything against this, so let's do it. Patch rebased against master.
Comment 9 Don Olmstead 2019-03-21 09:02:29 PDT
Comment on attachment 365539 [details]
Drop x87 support

Xan in the future after you get a r+ you can just replace the NOBODY (OOPS!) and just ask for a cq+ or if you're a committer just commit it.
Comment 10 WebKit Commit Bot 2019-03-21 09:29:37 PDT
Comment on attachment 365539 [details]
Drop x87 support

Clearing flags on attachment: 365539

Committed r243293: <https://trac.webkit.org/changeset/243293>
Comment 11 WebKit Commit Bot 2019-03-21 09:29:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2019-03-21 09:30:22 PDT
<rdar://problem/49109764>
Comment 13 karogyoker2+webkit 2019-04-19 11:37:07 PDT
(In reply to Don Olmstead from comment #7)
> WinCairo can technically build in 32-bit mode but we don't provide that
> anyways. Minimum install for Windows definitely requires a PC with SSE2
> support so we're fine with this. PlayStation is x64 so again no problem.
> 
> Will let someone from the AppleWin side chime in here but honestly it
> doesn't seem like an issue.

Except one thing: AMD Athlon XP processors on Linux are now cannot start the browser at all. I was using GNOME Web (epiphany-browser) on Lubuntu 18 until the latest WebKitGTK update, but since this SSE2 requirement, my computer became unable to use WebKit. So, this is an issue for me. It was working fine without SSE2, pages using JavaScript heavily (like agar.io and slither.io) and even YouTube videos worked just fine.

About one year ago I fixed the hardcoded SSE2 requirement, and it was working great until now.

Here I fixed the dependency on SSE2 last year (now it is a problem again):
https://bugs.webkit.org/show_bug.cgi?id=188145
Comment 14 Yusuke Suzuki 2019-04-19 12:01:36 PDT
(In reply to karogyoker2+webkit from comment #13)
> (In reply to Don Olmstead from comment #7)
> > WinCairo can technically build in 32-bit mode but we don't provide that
> > anyways. Minimum install for Windows definitely requires a PC with SSE2
> > support so we're fine with this. PlayStation is x64 so again no problem.
> > 
> > Will let someone from the AppleWin side chime in here but honestly it
> > doesn't seem like an issue.
> 
> Except one thing: AMD Athlon XP processors on Linux are now cannot start the
> browser at all. I was using GNOME Web (epiphany-browser) on Lubuntu 18 until
> the latest WebKitGTK update, but since this SSE2 requirement, my computer
> became unable to use WebKit. So, this is an issue for me. It was working
> fine without SSE2, pages using JavaScript heavily (like agar.io and
> slither.io) and even YouTube videos worked just fine.
> 
> About one year ago I fixed the hardcoded SSE2 requirement, and it was
> working great until now.
> 
> Here I fixed the dependency on SSE2 last year (now it is a problem again):
> https://bugs.webkit.org/show_bug.cgi?id=188145

We decide we no longer support it.
https://lists.webkit.org/pipermail/webkit-dev/2019-March/030569.html