Subject: Re: improving ssh performance on sun4m systems
To: Charles Shannon Hendrix <shannon@widomaker.com>
From: Todd Vierling <tv@wasabisystems.com>
List: port-sparc
Date: 03/15/2002 10:46:22
On Fri, 15 Mar 2002, Charles Shannon Hendrix wrote:

: > I can pretty much assume that 80%+ of the speed increase is due to using the
: > mul/div v8 builtin.  This speed can be achieved without a completely
: > separate snapshot by implementing the libc v8 extension I mentioned earlier.
:
: I'm not sure that's all of it, because programs not using that at all are
: getting boost, though that might just be from instruction reordering.

Oh, I'm sure there's boost, but I'd be curious to see an analysis.  The
speed difference between mul/div on v7 and v8 is *huge*.

: In any case, the library extension you mention will not speed up the code
: outside of the libraries.

Huh!?  Having an overlay listed in ld.so.conf will affect *all* code
(program or library) using the (shared) libc, without recompiling.

That's the reason, for instance, that libmi387.so exists on the i386 port.
In that case, everything that uses libm will get the i387 speedups if an
i387 is present, but will use the C emulation (to avoid expensive kernel FPU
emulation) if not.

The sparc compiler, in the v7 default mode, emits a call to
.[u]{mul,div,mod} for the corresponding mul/div instructions; these
functions can be replaced by the v8 instruction and a RET, without even
needing a save/restore.  You get most of the speedup without having to
recompile the whole shebang.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi & NetBSD:  Run with it.
-- CDs, Integration, Embedding, Support -- http://www.wasabisystems.com/