Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Christian Groessler" <cpg@aladdin.de>
To: Richard Henderson <rth@cygnus.com>
Cc: egcs@egcs.cygnus.com, axp-list@redhat.com
Subject: Re: problem with unaligned access on Alpha
Date: Thu, 24 Jun 1999 09:54:04 +0100	[thread overview]
Message-ID: <4125679A.00312E69.00@saturn.aladdin.de> (raw)



On 6/23/99 6:35:21 PM Richard Henderson  wrote:
>
>On Tue, Jun 22, 1999 at 11:59:46AM +0100, Christian Groessler wrote:
>> #define READ_WORD(a)          (*(unsigned short *)(a))
>...
>> I would expect the "val=READ_WORD()" line to generate an unaligned
access
>> exception, but this doesn't happen.
>
>You expect incorrectly.
>
>In general you'll only get an unaligned access trap if we'd issued
>an `ldwu' instruction, which we can only do when compiling for EV56
>or higher.

I assume for shorts only. If I replace "unsigned short *" with "unsigned
int *"
I do get unaligned traps.


>> I looked at the generated assembler code (with my little only alpha
>> assembler knowledge), and it seems that the compiler is generating
>> code for unaligned access but somehow forgets to get the byte at
(adress+1).
>
>Nope, we're generating code for an _aligned_ word access in
>the only way that is possible on EV4.  An unaligned word
>access doubles the length of the sequence.

Now I see. The code for aligned word access breaks when the
word is unaligned at address+7, if I understand the assembly code
correctly. My problem is/was, that the code breaks _silently_, but
maybe this case is hard to detect (to give a warning etc.).

Thanks for the info.

regards,
chris



             reply	other threads:[~1999-06-24  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-24  8:54 Christian Groessler [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-06-29  9:12 problem with unaligned access on Alpha Wessels, Hans
1999-06-29 15:07 ` Michal Jaegermann
1999-07-05 17:23   ` Maciej W. Rozycki
1999-06-24  8:29 Christian Groessler
1999-06-24 15:26 ` Michal Jaegermann
1999-06-23 10:23 Christian Groessler
1999-06-23 14:55 ` Maciej W. Rozycki
1999-06-23 14:56 ` Michal Jaegermann
1999-06-23 16:23   ` Maciej W. Rozycki
1999-06-24  7:02     ` Michal Jaegermann
1999-06-25 20:21       ` Maciej W. Rozycki
1999-06-22 10:59 Christian Groessler
1999-06-22 12:32 ` Stefan Katzenbeisser
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