Address error quietly fixed on 680x0 systems

Guy Harris guy at auspex.UUCP
Sat Jan 28 15:16:12 AEST 1989


>Looking at the code generated by cc I see a long move: no smarts
>in the compiler therefore. So the only mechanism that I can be fixing
>this is an address error trap that quietly moves unaligned objects
>byte-by-byte as requested.

Wrongo.  The 68020 (as appears in the Sun-3), and a variety of other
chips/machines, don't *take* address error traps when you give them an
unaligned address; they just fetch the data.  RTFM (TFM being, in this
case, Motorola's 68020 book).  Furthermore, the 68000 (as appears in
most Macs) and 68010 only require 2-byte alignment, even for 4-byte
quantities (TFM being, in this case, Motorola's 68000/68008/68010 book). 

>Simple timing experiments on the Sun3 don't appear to bear this out,
>however; I saw a 50% increase in runtime with writes to an odd address
>but would have expected more (the trap mechanisms on the 68k aren't
>super fast after all). Enlightenment?

Off-boundary references are, however, slower than on-boundary references.



More information about the Comp.lang.c mailing list