Hi,
On 2014-09-19 12:00:16 +0200, Andres Freund wrote:
>
> barrier.h defines memory barriers for x86 as:
> 32bit:
> #define pg_memory_barrier() \
> __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
> 64bit:
> #define pg_memory_barrier() \
> __asm__ __volatile__ ("lock; addl $0,0(%%rsp)" : : : "memory")
>
> But addl sets condition flags. So this really also needs a "cc" clobber?
> Or am I missing something?
What I missed is that x86 has an implied "cc" clobber for every inline
assembly statement. So forget that.
Greetings,
Andres Freund
-- Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services