summaryrefslogtreecommitdiff
blob: f14a269ee3fc523d752fd635f145e487cb9451a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- a/js/src/jslock.cpp	2012-04-06 16:24:51.000000000 -0500
+++ b/js/src/jslock.cpp	2012-06-21 20:57:00.877937542 -0500
@@ -150,17 +150,22 @@
 
 static JS_ALWAYS_INLINE int
 NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
 {
     unsigned int res;
 
     __asm__ __volatile__ (
                           "lock\n"
+/* GCC's x32 abi support */
+#if defined(__LP64__)
                           "cmpxchgq %2, (%1)\n"
+#else
+                          "cmpxchg %2, (%1)\n"
+#endif
                           "sete %%al\n"
                           "movzbl %%al, %%eax\n"
                           : "=a" (res)
                           : "r" (w), "r" (nv), "a" (ov)
                           : "cc", "memory");
     return (int)res;
 }