Attempt to fix GTK again after r193125
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Dec 2015 22:32:59 +0000 (22:32 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Dec 2015 22:32:59 +0000 (22:32 +0000)
Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-12-03

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::supportsLZCNT):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193377 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h

index 3c84e2c..c7f0ea8 100644 (file)
@@ -1,5 +1,12 @@
 2015-12-03  Benjamin Poulain  <bpoulain@apple.com>
 
+        Attempt to fix GTK again after r193125
+
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::supportsLZCNT):
+
+2015-12-03  Benjamin Poulain  <bpoulain@apple.com>
+
         Attempt to fix GTK after r193125
 
         * assembler/MacroAssemblerX86Common.h:
index e933742..6814385 100644 (file)
@@ -1723,6 +1723,16 @@ protected:
             __cpuid(cpuInfo, 0x80000001);
             flags = cpuInfo[2];
 #elif COMPILER(GCC_OR_CLANG)
+#if CPU(X86_64)
+            asm (
+                "movl $0x80000001, %%eax;"
+                "cpuid;"
+                "movl %%ecx, %0;"
+                : "=g" (flags)
+                :
+                : "%eax", "%ebx", "%ecx", "%edx"
+                );
+#else
             asm (
                 "movl $0x80000001, %%eax;"
                 "pushl %%ebx;"
@@ -1734,6 +1744,7 @@ protected:
                 : "%eax", "%ecx", "%edx"
                 );
 #endif
+#endif // COMPILER(GCC_OR_CLANG)
             s_lzcntCheckState = (flags & 0x20) ? LZCNTCheckState::Set : LZCNTCheckState::Clear;
         }
         return s_lzcntCheckState == LZCNTCheckState::Set;