Title: [199280] releases/WebKitGTK/webkit-2.4/Source/WTF
Revision
199280
Author
[email protected]
Date
2016-04-10 00:45:11 -0700 (Sun, 10 Apr 2016)

Log Message

Merge r166234 - [ARM64] GCC generates wrong code with -O2 flag in WTF::weakCompareAndSwap
https://bugs.webkit.org/show_bug.cgi?id=130500

Reviewed by Filip Pizlo.

Set the first operand to the exact register in the inline assembly with GCC.

* wtf/Atomics.h:
(WTF::weakCompareAndSwap):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog (199279 => 199280)


--- releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog	2016-04-10 03:38:44 UTC (rev 199279)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/ChangeLog	2016-04-10 07:45:11 UTC (rev 199280)
@@ -1,3 +1,15 @@
+2014-03-25  Gabor Rapcsanyi  <[email protected]>
+
+        [ARM64] GCC generates wrong code with -O2 flag in WTF::weakCompareAndSwap
+        https://bugs.webkit.org/show_bug.cgi?id=130500
+
+        Reviewed by Filip Pizlo.
+
+        Set the first operand to the exact register in the inline assembly with GCC.
+
+        * wtf/Atomics.h:
+        (WTF::weakCompareAndSwap):
+
 2015-06-22  YunQiang Su  <[email protected]>
 
         [WTF] Platform.h: use _ABI64 instead of _MIPS_SIM_ABI64 to determine MIPS N64

Modified: releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/Atomics.h (199279 => 199280)


--- releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/Atomics.h	2016-04-10 03:38:44 UTC (rev 199279)
+++ releases/WebKitGTK/webkit-2.4/Source/WTF/wtf/Atomics.h	2016-04-10 07:45:11 UTC (rev 199280)
@@ -113,6 +113,20 @@
         : "r"(expected), "r"(newValue)
         : "memory");
     result = !result;
+#elif CPU(ARM64) && COMPILER(GCC)
+    unsigned tmp;
+    unsigned result;
+    asm volatile(
+        "mov %w1, #1\n\t"
+        "ldxr %w2, [%0]\n\t"
+        "cmp %w3, %w2\n\t"
+        "b.ne 0f\n\t"
+        "stxr %w1, %w4, [%0]\n\t"
+        "0:"
+        : "+r"(location), "=&r"(result), "=&r"(tmp)
+        : "r"(expected), "r"(newValue)
+        : "memory");
+    result = !result;
 #elif CPU(ARM64)
     unsigned tmp;
     unsigned result;
@@ -153,6 +167,20 @@
         : "memory"
         );
     return result;
+#elif CPU(ARM64) && COMPILER(GCC)
+    bool result;
+    void* tmp;
+    asm volatile(
+        "mov %w1, #1\n\t"
+        "ldxr %x2, [%0]\n\t"
+        "cmp %x3, %x2\n\t"
+        "b.ne 0f\n\t"
+        "stxr %w1, %x4, [%0]\n\t"
+        "0:"
+        : "+r"(location), "=&r"(result), "=&r"(tmp)
+        : "r"(expected), "r"(newValue)
+        : "memory");
+    return !result;
 #elif CPU(ARM64)
     bool result;
     void* tmp;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to