[Info-vax] nice for VMS

John Reagan johnrreagan at earthlink.net
Mon Apr 13 09:30:23 EDT 2009


"Richard B. Gilbert" <rgilbert88 at comcast.net> wrote in message

> properly aligned quadword load.  The compilers know how to do it right but 
> if you use Macro and fail to align things properly, your code may run like 
> a dog!

The Macro compiler has extensive alignment tracking to try to guess the 
alignment properties of registers used as address operands.  In general, 
we'll assume byte-alignment and will only use longword alignment if we're 
sure.  You can use the .SET_REGISTERS UNALIGNED/ALIGNED to give a bigger 
hint to the compiler.

So if you say:

MOVL symbol+3,R0

we know the offset of SYMBOL into the psect (and we know the psect's 
base-alignment) so we can tell if SYMBOL+3 is aligned or not and generate 
the appropriate code.

There is also a DCL qualifier /UNALIGNED which tells the compiler to assume 
that ALL memory fetches/stores are unaligned and to generate the 
multi-instruction sequences that will never generate a fault (at the expense 
of more code).   However, that is a huge hammer that is rarely the right 
tool.


John 





More information about the Info-vax mailing list