From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199709241639.MAA18235@rrdjazz.nist.gov> Date: Wed, 24 Sep 1997 12:39:10 -0400 From: Przemek Klosowski Subject: Re: This may be a really dumb question Tom Linden wrote Most risc machines can only accept a datum on a natural boundary, thus a 32 bit integer's address has to be evenely divisible by 4. Correct so far... This is not true with the Power PC, BTW The alpha design team didn't really know what they were doing. In any event to answer your question, its the job of the compiler to properly align things. If you get this message then its really a compiler bug, i.e. the compiler that was used but it is is no longer so in this paragraph. The Alpha team knew well what they were doing. Any modern memory is organized in words (often 4 or 8 bytes, sometimes even 16 bytes), so non-aligned access is a bad match, and, if the loaded item crosses memory word boundary, requires two memory cycles. There are ways of handling this (caches/prefetching), but they complicate things; that is why initial Alpha architecture simply dropped unaligned loads (BTW, they were added in a recent revision). Sometimes, however, unaligned loads are necessary. In particular, the Ethernet packets, which are delivered by hardware as a binary block, have internal parts that aren't aligned. If one just grabs them, one ends up with an unaligned load. Of course it is possible to copy them byte by byte to an aligned buffer and access it there, but this requires special-case code in the driver, which wasn't done. In any case, the compiler doesn't figure here. p -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com