Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 1996 17:51:32 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        sommerfeld@orchard.medford.ma.us, travis@EvTech.com
Cc:        hackers@freebsd.org, tech-kern@NetBSD.ORG
Subject:   Re: Kernel calls - args in registers
Message-ID:  <199611200651.RAA30936@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I've been looking at this a bit lately, and noticed that, as you
>point out, gcc doesn't use registers on the x86 by default (IMHO it should
>have, at least if you can configure that for free Unixes -- it's not like we
>had a historical baggage commercial compiler to be call-level compatible
>with).

Well, gcc didn't officially support passing args in registers until
2.7, and it still doesn't quite work - function calls through a
pointer sometimes clobber one of the args.  Example: FreeBSD qsort().

My version of FreeBSD works when compiled with -mrtd (callee pops),
but I gave up on getting -mregparm=N to work when I hit this problem.
-mrtd doesn't make much difference.  It gives slightly smaller code and
is a few percent faster on 486's (because `ret N' is just as fast as
`ret') and a few percent slower on Pentiums (because `ret N' is one
nonpairable cylce slower than `ret').

-mregparm=2 gives slightly larger code.  I think it won't make much
difference to the speed when it works.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611200651.RAA30936>