This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH, i386]: PR 36793: x86-64 does not get __sync_synchronize right
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 23 Nov 2008 14:57:23 -0500 (EST)
- Subject: Re: [RFC PATCH, i386]: PR 36793: x86-64 does not get __sync_synchronize right
H.J. Lu writes:
>I am not sure how useful that is for 32bit since it will generate a
>nop for most machines which do need mfence.
I don't understand what you're saying. Using "lock orb" should result
in a memory fence on any IA-32 SMP system, old or new. It's just a more
heavyweight way of ordering loads and stores.
The Linux kernel apparently takes the same approach, using either "lock
addl" or "mfence" depending on whether SSE2 instructions are available
at compile time.
Ross Ridge