[Webkit-unassigned] [Bug 223987] New: Hard dependency on SSE2 instruction set for i386 platform (32-bit Intel / x86)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 31 00:46:11 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=223987

            Bug ID: 223987
           Summary: Hard dependency on SSE2 instruction set for i386
                    platform (32-bit Intel / x86)
           Product: WebKit
           Version: WebKit Local Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cparke at parkerfamily.name
                CC: bugs-noreply at webkitgtk.org

In previous bugs on this same issue like Bug #188145 (2018), it was emphasized: 

Quote Michael Catanzaro, developer at Igalia[1]:
"For WebKitGTK+, SSE2 instructions are forbidden (except when building for x86_64) because that's what our distributors require. But I doubt all developers are aware of this, and I also doubt anybody ever tests on such old hardware. So it might require some effort to audit the codebase for unwanted SSE2 instructions to make sure they're not there and fix them if so."

We are now 3 years later, but apparently SSE2 on the x86 platform is back with little regard for that comment.  The CMAKE configure itself is now enabling SSE2 in the code generation!  Using the source tarball posted at https://webkitgtk.org/ (which involves installing a ton of dev packages one at a time), I built the WebKitGTK v2.32.0 (latest stable). 

However, I found this logic in use when setting up the C flags:

Source/cmake/WebKitCompilerFlags.cmake:
    # Force SSE2 fp on x86 builds.
    if (WTF_CPU_X86 AND NOT CMAKE_CROSSCOMPILING)
        WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-msse2 -mfpmath=sse)
        include(DetectSSE2)
        if (NOT SSE2_SUPPORT_FOUND)
            message(FATAL_ERROR "SSE2 support is required to compile WebKit")
        endif ()
    endif ()

Any doubt if this is actually in use is dispelled, both because I find the '-msse2' actually appearing on the C++ compiler command line throughout the build, as well as of course the actual test on a Pentium III (SSE-only processor) laptop using Python 3.6:

$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version('WebKit2', '4.0')
>>> from gi.repository import WebKit2
>>> context = WebKit2.WebContext.get_default()
Illegal instruction
$ 


Honestly, I do not understand what the motivation has been over the last few years leading to new adoption of the SSE2 instruction set on the 32-bit platform.  SSE2 came out from Intel in 2004 (that's 17 years ago) at about the same time as x86-64 (64-bit Intel) architecture, and until recently it's only been used on 64-bit systems.  It provides a modest performance boost, that's all, as far as I understand it.  In most cases, all this is doing is obsoleting the older systems that are still in use.  WebKitGtk is used in a lot of places, including the Midori lightweight web browser (the kind of thing an older machine needs to use) and even 'ubiquity', the installer program for the Ubuntu operating system and its derivatives (it's used to display the slideshow).  That last one is where this burned me up, as I couldn't even install Linux properly on the old machine because of new SSE2 use.

Is SSE2 really needed for WebKitGtk?  Or, can I simply change the compiler flag in that Makefile to "-sse" and now my WebKitGtk will run just fine on SSE-only hardware such as the Pentium III?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210331/1d81fe9e/attachment.htm>


More information about the webkit-unassigned mailing list