Changeset 243989 in webkit


Ignore:
Timestamp:
Apr 8, 2019 3:16:22 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[CMake] Detect SSE2 at compile time
https://bugs.webkit.org/show_bug.cgi?id=196488

Patch by Xan Lopez <Xan Lopez> on 2019-04-08
Reviewed by Carlos Garcia Campos.

.:

  • CMakeLists.txt: Use FindSSE2.cmake to detect SSE2 support.
  • Source/cmake/FindSSE2.cmake: Added.

Source/JavaScriptCore:

  • assembler/MacroAssemblerX86Common.cpp: Remove unnecessary (and

incorrect) static_assert.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r243441 r243989  
    115115endif ()
    116116
     117#---------------------------
     118# Make sure SSE2 is present.
     119#---------------------------
     120if (WTF_CPU_X86)
     121    include(FindSSE2)
     122    if (NOT SSE2_SUPPORT_FOUND)
     123        message(FATAL_ERROR "SSE2 support is required to compile WebKit")
     124    endif ()
     125endif ()
     126
    117127# -----------------------------------------------------------------------------
    118128# Determine the operating system
  • trunk/ChangeLog

    r243934 r243989  
     12019-04-08  Xan Lopez  <xan@igalia.com>
     2
     3        [CMake] Detect SSE2 at compile time
     4        https://bugs.webkit.org/show_bug.cgi?id=196488
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * CMakeLists.txt: Use FindSSE2.cmake to detect SSE2 support.
     9        * Source/cmake/FindSSE2.cmake: Added.
     10
    1112019-04-05  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r243967 r243989  
     12019-04-08  Xan Lopez  <xan@igalia.com>
     2
     3        [CMake] Detect SSE2 at compile time
     4        https://bugs.webkit.org/show_bug.cgi?id=196488
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * assembler/MacroAssemblerX86Common.cpp: Remove unnecessary (and
     9        incorrect) static_assert.
     10
    1112019-04-07  Michael Saboff  <msaboff@apple.com>
    212
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp

    r243293 r243989  
    168168static_assert(sizeof(Probe::State) == PROBE_SIZE, "Probe::State::size's matches ctiMasmProbeTrampoline");
    169169static_assert((PROBE_EXECUTOR_OFFSET + PTR_SIZE) <= (PROBE_SIZE + OUT_SIZE), "Must have room after ProbeContext to stash the probe handler");
    170 
    171 #if CPU(X86)
    172 // SSE2 is a hard requirement on x86.
    173 static_assert(isSSE2Present(), "SSE2 support is required in JavaScriptCore");
    174 #endif
    175170
    176171#undef PROBE_OFFSETOF
     
    793788        {
    794789            CPUID cpuid = getCPUID(0x1);
    795             s_sse2CheckState = (cpuid[3] & (1 << 26)) ? CPUIDCheckState::Set : CPUIDCheckState::Clear;
    796790            s_sse4_1CheckState = (cpuid[2] & (1 << 19)) ? CPUIDCheckState::Set : CPUIDCheckState::Clear;
    797791            s_sse4_2CheckState = (cpuid[2] & (1 << 20)) ? CPUIDCheckState::Set : CPUIDCheckState::Clear;
     
    810804}
    811805
    812 MacroAssemblerX86Common::CPUIDCheckState MacroAssemblerX86Common::s_sse2CheckState = CPUIDCheckState::NotChecked;
    813806MacroAssemblerX86Common::CPUIDCheckState MacroAssemblerX86Common::s_sse4_1CheckState = CPUIDCheckState::NotChecked;
    814807MacroAssemblerX86Common::CPUIDCheckState MacroAssemblerX86Common::s_sse4_2CheckState = CPUIDCheckState::NotChecked;
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h

    r243293 r243989  
    41984198#endif
    41994199
    4200 #if CPU(X86)
    4201 #if OS(MAC_OS_X)
    4202 
    4203     // All X86 Macs are guaranteed to support at least SSE2,
    4204     static bool isSSE2Present()
    4205     {
    4206         return true;
    4207     }
    4208 
    4209 #else // OS(MAC_OS_X)
    4210     static bool isSSE2Present()
    4211     {
    4212         if (s_sse2CheckState == CPUIDCheckState::NotChecked)
    4213             collectCPUFeatures();
    4214         return s_sse2CheckState == CPUIDCheckState::Set;
    4215     }
    4216 
    4217 #endif // OS(MAC_OS_X)
    4218 #elif !defined(NDEBUG) // CPU(X86)
    4219 
    4220     // On x86-64 we should never be checking for SSE2 in a non-debug build,
    4221     // but non debug add this method to keep the asserts above happy.
    4222     static bool isSSE2Present()
    4223     {
    4224         return true;
    4225     }
    4226 
    4227 #endif
    4228 
    42294200    using CPUID = std::array<unsigned, 4>;
    42304201    static CPUID getCPUID(unsigned level);
     
    42324203    JS_EXPORT_PRIVATE static void collectCPUFeatures();
    42334204
    4234     JS_EXPORT_PRIVATE static CPUIDCheckState s_sse2CheckState;
    42354205    JS_EXPORT_PRIVATE static CPUIDCheckState s_sse4_1CheckState;
    42364206    JS_EXPORT_PRIVATE static CPUIDCheckState s_sse4_2CheckState;
Note: See TracChangeset for help on using the changeset viewer.