Subject: | |
From: | |
Reply To: | |
Date: | Wed, 10 Jul 1996 09:52:48 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Jim writes:
> Does HP3000 (MPE-iX) require boundary alignment for longs or doubles or
> other data types?
No and Yes.
No...MPE does not require this, any more than any *operating system*
does. (I.e., the program would have failed just as nicely on an
HP 9000 running HP-UX.)
Yes..the PA-RISC architecture limits the LDW & STW (load & store 32-bit word)
to work only with addresses that are 4-byte aligned. Similarly,
the LDH and STH (load & store 16-bit halfword) requires addresses that are
2-byte aligned. (Yes, LDB & STB (load & store 8-bit byte) require addresses
that are 1-byte aligned :)
> No...this Is there a C compiler directive to either flag such
> code when recognizable or even to accommodate such code via extra moves
> to/from aligned locations?
Try compiling with the "+u" option, which is documented as:
"resolves this by causing the compiler to generate code to access
pointers with half-word addressing".
I tried it on a simple test, where:
foo (int *i)
{
*i = 1234567;
}
and I passed into foo an address that was a multiple of 2, but not 4,
and the code worked. (Inspection of the code showed that the proper 3
instructions were emitted.)
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler.html
|
|
|