Re: [2.4] gcc3 warns about type-punned pointers ?

From: Jamie Lokier
Date: Sat Aug 30 2003 - 06:34:27 EST


Willy Tarreau wrote:
> On Sat, Aug 30, 2003 at 08:27:44AM +0200, Antonio Vargas wrote:
> > That was my fault for introducing an exchange instruction
> > into an assignement discussion, but I don't know of any
> > x86 instruction which can load 64bits to memory atomically,
> > is there any???
>
> perhaps "pusha", but it will load fare more than you need, and I don't know
> if it's lockable.

"pusha" does not promise 64 bit writes. It can't be interrupted, but
I see nothing that ensures the multiple 32 bit words are combined into
atomic 64 bit writes as seen by other CPUs or peripherals.

> Some MMX instruction might do it too, although not sure.

Yes, if you want a 64 bit write and don't want to use cmpxchg8b, MMX
will do it.

You can also do it with the floating-point "fistpll" instruction (also
called "fistpq").

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/