Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some more patches for GCC on NetBSD/VAX coming soon...



On Wed, 30 Mar 2016, Johnny Billquist wrote:

> > > One thing you may find is that shared libraries have a significant
> > > performance penalty over static linking on VAX
> > It would be interesting to do some real timing measurements here, since
> > the vax assembler itself is virtually PIC and shouldn't give any
> > performance
> > penalty.
> 
> Someone did a year or two ago, and showed that the penalty was small. I'll try
> to locate the post later today.

 VAX supports PC-relative addressing for pretty much all operations, with 
only obscure corner cases restricted and consequently requiring a longer 
sequence making use of an auxiliary address register.  This means all 
symbols local to a module (be it an executable or a DSO) can be accessed 
off the PC and no separate GOT pointer has to be maintained nor a register 
wasted for it.  So virtually all the penalty is supposed to come from GOT 
indirection needed for preemptible (global) symbols, and should be minimal 
as you've noted.  Any other cause is a suspected bug.

 To avoid unnecessary penalty though it's important to set the export 
class (visibility) correctly for symbols in DSOs which are not meant to be 
exported, so that GOT indirection is not used for them needlessly.

 NB the use of byte and especially word displacements may actually make 
the execution of operations using PC-relative addressing faster than 
corresponding operations using absolute addressing, both accessing the 
same symbol, due to a shorter instruction encoding.

  Maciej


Home | Main Index | Thread Index | Old Index