mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
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.
This commit is contained in:
parent
88bcdf9da5
commit
f18cad9449
@ -175,7 +175,7 @@ pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
|
|||||||
" lock \n"
|
" lock \n"
|
||||||
" cmpxchgl %4,%5 \n"
|
" cmpxchgl %4,%5 \n"
|
||||||
" setz %2 \n"
|
" setz %2 \n"
|
||||||
: "=a" (*expected), "=m"(ptr->value), "=r" (ret)
|
: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
|
||||||
: "a" (*expected), "r" (newval), "m"(ptr->value)
|
: "a" (*expected), "r" (newval), "m"(ptr->value)
|
||||||
: "memory", "cc");
|
: "memory", "cc");
|
||||||
return (bool) ret;
|
return (bool) ret;
|
||||||
@ -212,7 +212,7 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
|
|||||||
" lock \n"
|
" lock \n"
|
||||||
" cmpxchgq %4,%5 \n"
|
" cmpxchgq %4,%5 \n"
|
||||||
" setz %2 \n"
|
" setz %2 \n"
|
||||||
: "=a" (*expected), "=m"(ptr->value), "=r" (ret)
|
: "=a" (*expected), "=m"(ptr->value), "=q" (ret)
|
||||||
: "a" (*expected), "r" (newval), "m"(ptr->value)
|
: "a" (*expected), "r" (newval), "m"(ptr->value)
|
||||||
: "memory", "cc");
|
: "memory", "cc");
|
||||||
return (bool) ret;
|
return (bool) ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user