[gomp] i386 cmpxchg8b and x86_64 cmpxchg16b support

Andi Kleen ak@suse.de
Tue Oct 11 01:22:00 GMT 2005


On Tuesday 11 October 2005 03:12, Richard Henderson wrote:
> On Tue, Oct 11, 2005 at 01:34:34AM +0200, Andi Kleen wrote:
> > > +#ifdef __x86_64__
> >
> > This needs to be #if defined(__i386__) || defined(__x86_64__)
> > otherwise you will crash on most i386 boxes.
>
> Shouldn't.  With __i386__ we shouldn't have emitted the cmpxchg16b
> and instead we should have emitted a mutex lock/unlock pair.

16 byte CMPXCHG16 is legal in 32bit code so I would have expected
-march=nocona to emit it there too. If not it should.

-Andi



More information about the Gcc-patches mailing list