|Layout of Structs firstname.lastname@example.org (1989-05-28)|
|Re: Layout of Structs email@example.com (1989-05-31)|
|Re: Layout of Structs firstname.lastname@example.org (1989-06-02)|
|Re: Layout of Structs aglew@mcdurb.Urbana.Gould.COM (1989-06-04)|
|Date:||4 Jun 89 19:34:00 GMT|
|Nf-From:||mcdurb.Urbana.Gould.COM!aglew Jun 4 14:34:00 1989|
>> Case in point: on a 68020, are longs 16-bit aligned or 32-bit aligned?
>> Compilers differ.
>The 68020 has a 32 bit data path. One would assume (hope?) that the compiler
>would be smart enough to lay out the long on a 32 bit boundry to prevent
>the additional bus cycle.
On Motorola SYSTEM V/68 the compiler normally lays out scalar 32 bit
quantities (ints, etc.) on 32 bit boundaries. This behaviour is controlled
by an environment varaible DBLALIGN, which is normally on. (DBL because
32 bits is a "double-word" in 68K speak).
However, 32 bit fields within structures are normally laid out on 16 bit
boundaries, for compatibility with pre-68020 data structures - all these
data files that have 32 bit quanties at 16 bit alignments. This behaviour
is controlled by a variable STALIGN, which is normally off. Setting STALIGN
gets you a performance boost for your own code, but may not be compatible
with system headers, etc.
Return to the
Search the comp.compilers archives again.