Skip to content

Commit f18cad9

Browse files
committed
Fix atomic ops inline x86 inline assembly for older 32bit gccs.
Some x86 32bit versions of gcc apparently generate references to the nonexistant %sil register when using when using the r input constraint, but not with the =q constraint. The latter restricts allocations to a/b/c/d which should all work.
1 parent 88bcdf9 commit f18cad9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/include/port/atomics/arch-x86.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
175175
" lock \n"
176176
" cmpxchgl %4,%5 \n"
177177
" setz %2 \n"
178-
: "=a" (*expected), "=m"(ptr->value), "=r" (ret)
178+
: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
179179
: "a" (*expected), "r" (newval), "m"(ptr->value)
180180
: "memory", "cc");
181181
return (bool) ret;
@@ -212,7 +212,7 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
212212
" lock \n"
213213
" cmpxchgq %4,%5 \n"
214214
" setz %2 \n"
215-
: "=a" (*expected), "=m"(ptr->value), "=r" (ret)
215+
: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
216216
: "a" (*expected), "r" (newval), "m"(ptr->value)
217217
: "memory", "cc");
218218
return (bool) ret;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy