[cpp-threads] RE: volatile, memory models, threads

Ben Hutchings ben at decadentplace.org.uk
Thu Mar 2 11:40:06 GMT 2006


Nick Maclaren wrote:
> "Boehm, Hans" <hans.boehm at hp.com> wrote:
> >
> > I don't know whether we have to address misaligned scalars.  I guess
> > they still exist in standard code with standard ABIs on M68Ks, and maybe
> > a few other older architectures?
> 
> It depends what you mean by misaligned.  I know of no language that
> permits misalignment for the most basic of types (though there may
> be some), but most do so for the less basic.

Since the 68000 had a 16-bit bus, older m68k ABIs require only 16-bit
alignment of 32-bit values, and later m68k processors accept that.
However, atomic access to a 32-bit value on these later processors
requires 32-bit alignment (or at least that the entire value is in a
single cache line).

> For example, float and double must be aligned in all languages I know,
> but complex float, complex double and (arguably) long double need not
> be.

All i386 ABIs, AFAIK, use 64-bit doubles but only require 32-bit
alignment for them.  Again this means it would be necessary to increase
alignment where atomic access is needed.

> The same applies to array and string descriptors (e.g. pointer
> plus length) in languages that have those.

Ben.

-- 
Ben Hutchings
Lowery's Law:
             If it jams, force it. If it breaks, it needed replacing anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.decadentplace.org.uk/pipermail/cpp-threads/attachments/20060302/592781a8/attachment.pgp


More information about the cpp-threads mailing list