HP3000-L Archives

July 1996, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Wed, 10 Jul 1996 09:52:48 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
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

ATOM RSS1 RSS2