This is the mail archive of the
mailing list for the GCC project.
Re: [discuss] When is RBX used for base pointer?
- From: Michael Matz <matz at suse dot de>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: discuss at x86-64 dot org, gcc at gcc dot gnu dot org
- Date: Wed, 13 Feb 2008 22:52:16 +0100 (CET)
- Subject: Re: [discuss] When is RBX used for base pointer?
- References: <email@example.com>
On Wed, 13 Feb 2008, H.J. Lu wrote:
> We need a callee-saved register for stack alignment.
Can you expand on why?
> In 64bit, our choices are rbx, and r12-r15. r12-r15 need the REX byte
> and r12 also needs the SIB byte. So I'd like to use rbx. x86-64 psABI
> says rbx is callee-saved and optionally used as base pointer. However, I
> couldn't find an example where rbx is used as base pointer. Is this a
> carryover from i386 psABI where ebx is used to hold GOT?
In the large memory model you need a base pointer for the GOT. Of course
we could do the same as in recent i386 and chose an arbitrary register as