Architectures with strict alignment?

perryh at pluto.rain.com perryh at pluto.rain.com
Sat Dec 29 15:15:50 PST 2007


"M. Warner Losh" <bsdimp.com!imp at agora.rdrop.com> wrote:

> In message: <fl4c8o$vpu$1 at ger.gmane.org>
>             Ivan Voras <ivoras at freebsd.org> writes:
> : Which of the architectures FreeBSD supports (if any) have strict
> : memory alignment requirements? (in the sense that accessing a
> : 32-bit integer not aligned on a 32-bit address results in a
> : hardware trap/exception).
>
> Sparc64, powerpc, arm, and (thanks to Juniper and others) mips.

The degree to which a PowerPC imposes a strict alignment requirement
depends on both the particular processor model and the operation
being performed.

For ordinary integer arithmetic and logical operations, newer
PPC processors tend to be more tolerant (although misalignment
will typically carry a performance penalty).  For the semaphore
primitives (lwarx/stwcx.) most PPC will require proper alignment
and some will fault if the operand address is cache-inhibited
(even though correctly aligned).


More information about the freebsd-hackers mailing list