From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH (take #2)] i386: kill CONFIG_REGPARM completely
Date: Wed, 24 May 2006 13:36:50 -0700 (PDT) [thread overview]
Message-ID: <e52g52$v80$1@terminus.zytor.com> (raw)
In-Reply-To: Pine.LNX.4.61.0605220739580.26623@chaos.analogic.com
Followup to: <Pine.LNX.4.61.0605220739580.26623@chaos.analogic.com>
By author: "linux-os \(Dick Johnson\)" <linux-os@analogic.com>
In newsgroup: linux.dev.kernel
>
> On ix86 there are not enough registers to pass a significant parameter
> list all in registers! Like when you are printk()ing a dotted-quad IP
> address, etc. Registers ESI, EDI, and EBX are precious, that leaves
> EAX, ECX, EDX and possibly EBP for only 4 parameters. You need 5
> for the dotted quad IP address. If the compiler were to use the
> precious registers, the contents need to be saved on the stack.
> That negates any advantage to passing parameters in registers.
>
> This means that REGPARM will always remain a "hint" to the compiler,
> not some absolute order.
>
Bullshit.
-mregparm=N is an absolute order. On i386 it has the semantics of
passing the first N dword-sized non-varadic arguments in registers
%eax, %edx, and %ecx (in that order). The rest are passed on the
stack; that is true for any ABI.
printk() is varadic; the only argument which will be put in a register
is the formatting string (which goes into %eax).
-hpa
next prev parent reply other threads:[~2006-05-24 20:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-20 2:53 [PATCH] i386: don't consider regparm EXPERIMENTAL anymore Chris Wedgwood
2006-05-20 9:06 ` Christoph Hellwig
2006-05-20 20:13 ` [PATCH] i386: kill CONFIG_REGPARM completely Chris Wedgwood
2006-05-20 21:07 ` Chris Wedgwood
2006-05-20 21:20 ` [RFC PATCH (take #2)] " Chris Wedgwood
2006-05-20 22:00 ` Matheus Izvekov
2006-05-20 23:24 ` Chris Wedgwood
2006-05-22 11:47 ` linux-os (Dick Johnson)
2006-05-23 7:55 ` Helge Hafting
2006-05-24 20:36 ` H. Peter Anvin [this message]
2006-05-29 19:03 ` [PATCH] i386: don't consider regparm EXPERIMENTAL anymore Adrian Bunk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='e52g52$v80$1@terminus.zytor.com' \
--to=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox