[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bzip2 unaligned trap



On Fri, 26 Aug 2005, Steve Langasek wrote:

See:

	arch/ppc/traps.c AlignmentException -> fix_alignment()
	arch/ppc/align.c -> fix_alignment

Seems at least several models of PPC (all?) do trap on unaligned
access, the kernel just doesn't complain as it does on Alpha.


And which of the instructions on ppc32 requires 64-bit alignment? That's really the big issue with alpha -- as a 64-bit arch, it has instructions that take 64-bit words that have to be aligned on 8-byte boundaries, which is not a condition that people used to writing code for 32-bit archs will normally check for.

It's not about 64bit-ness.

It's been a long while since I read an Alpha architecture manual, but I distinctly remember Alpha instructions can operate on byte, word, double and quad-word operands. Words must be word aligned, double double-boundary aligned, etc.

PPC, AIUI, is similar, as is SPARC. No sane general purpose architecture could try demand that sub-64bit words be 64bit aligned.

Note again that x86 too will be slow if you try access a word on non-word aligned boundary.

regards,
--
Paul Jakma	paul@clubi.ie	paul@jakma.org	Key ID: 64A2FF6A
Fortune:
Paranoid Club meeting this Friday.  Now ... just try to find out where!



Reply to: