Changeset 245127 in webkit
- Timestamp:
- May 9, 2019 3:43:43 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r245083 r245127 1 2019-05-09 Xan López <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 * Source/cmake/DetectSSE2.cmake: Added. 9 * Source/cmake/WebKitCompilerFlags.cmake: Detect SSE2 support and 10 add SSE2 to the global compiler flags. 11 1 12 2019-05-08 Don Olmstead <don.olmstead@sony.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r245093 r245127 1 2019-05-09 Xan López <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 (JSC::MacroAssemblerX86Common::collectCPUFeatures): 11 * assembler/MacroAssemblerX86Common.h: Remove SSE2 flags. 12 1 13 2019-05-08 Yusuke Suzuki <ysuzuki@apple.com> 2 14 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp
r244138 r245127 168 168 static_assert(sizeof(Probe::State) == PROBE_SIZE, "Probe::State::size's matches ctiMasmProbeTrampoline"); 169 169 static_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 #endif175 170 176 171 #undef PROBE_OFFSETOF … … 793 788 { 794 789 CPUID cpuid = getCPUID(0x1); 795 s_sse2CheckState = (cpuid[3] & (1 << 26)) ? CPUIDCheckState::Set : CPUIDCheckState::Clear;796 790 s_sse4_1CheckState = (cpuid[2] & (1 << 19)) ? CPUIDCheckState::Set : CPUIDCheckState::Clear; 797 791 s_sse4_2CheckState = (cpuid[2] & (1 << 20)) ? CPUIDCheckState::Set : CPUIDCheckState::Clear; … … 810 804 } 811 805 812 MacroAssemblerX86Common::CPUIDCheckState MacroAssemblerX86Common::s_sse2CheckState = CPUIDCheckState::NotChecked;813 806 MacroAssemblerX86Common::CPUIDCheckState MacroAssemblerX86Common::s_sse4_1CheckState = CPUIDCheckState::NotChecked; 814 807 MacroAssemblerX86Common::CPUIDCheckState MacroAssemblerX86Common::s_sse4_2CheckState = CPUIDCheckState::NotChecked; -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
r244138 r245127 4198 4198 #endif 4199 4199 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 #endif4228 4229 4200 using CPUID = std::array<unsigned, 4>; 4230 4201 static CPUID getCPUID(unsigned level); … … 4232 4203 JS_EXPORT_PRIVATE static void collectCPUFeatures(); 4233 4204 4234 JS_EXPORT_PRIVATE static CPUIDCheckState s_sse2CheckState;4235 4205 JS_EXPORT_PRIVATE static CPUIDCheckState s_sse4_1CheckState; 4236 4206 JS_EXPORT_PRIVATE static CPUIDCheckState s_sse4_2CheckState; -
trunk/Source/cmake/WebKitCompilerFlags.cmake
r244895 r245127 144 144 if (CMAKE_COMPILER_IS_GNUCXX) 145 145 WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-expansion-to-defined) 146 endif () 147 148 # Force SSE2 fp on x86 builds. 149 if (WTF_CPU_X86 AND NOT CMAKE_CROSSCOMPILING) 150 WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-msse2 -mfpmath=sse) 151 include(DetectSSE2) 152 if (NOT SSE2_SUPPORT_FOUND) 153 message(FATAL_ERROR "SSE2 support is required to compile WebKit") 154 endif () 146 155 endif () 147 156 endif () -
trunk/Tools/ChangeLog
r245095 r245127 1 2019-05-09 Xan López <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 * Scripts/webkitdirs.pm: 9 (generateBuildSystemFromCMakeProject): Do not add SSE2 flags here 10 for x86 builds. This is now handled in WebKitCompilerFlags.cmake. 11 1 12 2019-05-08 Adrian Perez de Castro <aperez@igalia.com> 2 13 -
trunk/Tools/Scripts/webkitdirs.pm
r245087 r245127 2227 2227 push @args, '"' . $cmakeSourceDir . '"'; 2228 2228 2229 # Compiler options to keep floating point values consistent2230 # between 32-bit and 64-bit architectures. This makes us use SSE2231 # when our architecture is 32-bit ('i686') or when it's not but2232 # the user has requested a 32-bit build.2233 if ((architecture() eq "i686" || (architecture() eq "x86_64" && shouldBuild32Bit())) && !isCrossCompilation() && !isAnyWindows()) {2234 $ENV{'CFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse " . ($ENV{'CFLAGS'} || "");2235 $ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse " . ($ENV{'CXXFLAGS'} || "");2236 }2237 2238 2229 # We call system("cmake @args") instead of system("cmake", @args) so that @args is 2239 2230 # parsed for shell metacharacters.
Note: See TracChangeset
for help on using the changeset viewer.