[net.lang.c] pointer alignment on a Vax 780

shekita@crystal.UUCP (06/24/85)

Are there any alignment constraints on the Vax 780?
Could one, for example, set an integer pointer to
the middle of a machine word? 

If there aren't alignment constraints, is it faster
to compare two word-aligned integers?

stew@harvard.ARPA (Stew Rubenstein) (06/26/85)

> Are there any alignment constraints on the Vax 780?
> Could one, for example, set an integer pointer to
> the middle of a machine word? 
> 
> If there aren't alignment constraints, is it faster
> to compare two word-aligned integers?

There are no constraints, but there is definitely a speed penalty for
fetching non-aligned data.  longwords should be aligned on longword
boundaries, quadwords on quadwords, etc., for best performance.  I have
even heard of differences in benchmark timing based on the alignment
of the instruction stream, though this is harder to predict and control.