Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Tom Linden <tom@thirdmillenium.com>
Subject: Re: This may be a really dumb question
Date: Wed, 24 Sep 1997 10:12:33 -0700 (PDT)	[thread overview]
Message-ID: <5cd6d7a736058cacb929c43d3d67a6f1.axp-list@archive.invalid> (raw)
In-Reply-To: <199709241639.MAA18235@rrdjazz.nist.gov>

I think you missed my point.  The mission statement of the design team 
was flawed as evidenced by the fact that later revisions have added new 
features such as byte load and store, and I am happy to hear unaligned
loads and assume stores.   There are really two problems, (1) there is 
about a couple of hundred billion lines of code in production most of 
which is unaligned and (2) most languages provide for some type of 
aliasing of data types which could lead to unaligned code.  Even if the 
compiler did a better job of detecting aliasing it doesn't mean that you 
could align things (e.g. fortran named common).  IBM new this when they 
designed their chip so that unaligned access cost is only one clock tick.

On the first alphas, 16bit assignment of the form c = a + b; took 19 
ticks,  but 32bit only 4 ticks (if I remember correctly)  that in my
view is a design flaw.

So you really have to live with unaligned acces, of course you always 
have the option when writing new code that you can more carefully align 
things.

On Wed, 24 Sep 1997, Przemek Klosowski wrote:

> 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
> 
> 

--
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

  reply	other threads:[~1997-09-24 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-24 16:39 This may be a really dumb question Przemek Klosowski
1997-09-24 17:12 ` Tom Linden [this message]
1997-09-28  4:23 ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
1997-09-25  0:57 Uncle George
1997-09-24  5:32 Jim Paradis
1997-09-24  1:28 Jim Paradis
     [not found] <Pine.LNX.3.95.970923051536.527L-100000@sheerx.eni.net>
1997-09-24  1:10 ` Tom Linden
1997-09-24 16:38   ` Volker Barthelmann
1997-09-28  3:39   ` Richard Henderson
1997-09-23 12:15 Sheer Panic
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox