From: Jeff Garzik <jgarzik@pobox.com>
To: Nagendra Singh Tomar <nagendra_tomar@adaptec.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [OT] caller-save/callee-save register styles
Date: Mon, 8 Sep 2003 10:21:15 -0400 [thread overview]
Message-ID: <20030908142115.GA3497@gtf.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0309072348090.16598-100000@localhost.localdomain>
On Sun, Sep 07, 2003 at 11:54:59PM +0530, Nagendra Singh Tomar wrote:
> I would like to know various people's experiences about the caller-save
> and callee-save style of preserving register values across procedure
> calls. I feel that the ABI specification should specify that but I was
> unable to figure that out in the ELF-ABI specification.
The i386 ELF ABI spec _does_ specify that.
> What I have personally seen is only callee-save style in which the
> modified registers are PUSHed on the stack on entering the function and
> POPed on leaving the function. That means the caller can assume that all
> the regsiter values will be same just before and after the 'call'
> instruction.
The caller assumes nothing; the caller is _guaranteed_ the register
rules described in the i386 ELF ABI.
Compiler writers will sometimes simply avoid registers they must save
and restore across function calls. That allows them to avoid push'ing
and pop'ing outside of calling another function.
Jeff
next prev parent reply other threads:[~2003-09-08 14:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-07 18:24 [OT] caller-save/callee-save register styles Nagendra Singh Tomar
2003-09-08 14:21 ` Jeff Garzik [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-09-08 9:33 Mikael Pettersson
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=20030908142115.GA3497@gtf.org \
--to=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nagendra_tomar@adaptec.com \
/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