Re: [discuss] When is RBX used for base pointer?

2008-02-13 Thread Michael Matz
Hi, 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

Re: [discuss] When is RBX used for base pointer?

2008-02-13 Thread H.J. Lu
On Feb 13, 2008 1:52 PM, Michael Matz <[EMAIL PROTECTED]> wrote: > Hi, > > On Wed, 13 Feb 2008, H.J. Lu wrote: > > > We need a callee-saved register for stack alignment. > > Can you expand on why? Our proposal is at http://gcc.gnu.org/ml/gcc/2007-12/msg00567.html For most cases, we can align sta

Re: [discuss] When is RBX used for base pointer?

2008-02-13 Thread Michael Matz
Hi, On Wed, 13 Feb 2008, H.J. Lu wrote: > Our proposal is at > > http://gcc.gnu.org/ml/gcc/2007-12/msg00567.html > > For most cases, we can align stack with RBP/RSP. But > we need an extra register when there is dynamic stack > allocation or nested functions. It has to be callee-saved > to work

Re: [discuss] When is RBX used for base pointer?

2008-02-13 Thread H.J. Lu
On Feb 13, 2008 2:49 PM, Michael Matz <[EMAIL PROTECTED]> wrote: > Hi, > > On Wed, 13 Feb 2008, H.J. Lu wrote: > > > Our proposal is at > > > > http://gcc.gnu.org/ml/gcc/2007-12/msg00567.html > > > > For most cases, we can align stack with RBP/RSP. But > > we need an extra register when there is dy

Re: [discuss] When is RBX used for base pointer?

2008-02-13 Thread Jan Hubicka
> Hi, > > 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 rb

Re: [discuss] When is RBX used for base pointer?

2008-02-13 Thread Jan Hubicka
> On Feb 13, 2008 2:49 PM, Michael Matz <[EMAIL PROTECTED]> wrote: > > Hi, > > > > On Wed, 13 Feb 2008, H.J. Lu wrote: > > > > > Our proposal is at > > > > > > http://gcc.gnu.org/ml/gcc/2007-12/msg00567.html > > > > > > For most cases, we can align stack with RBP/RSP. But > > > we need an extra reg

Re: [discuss] When is RBX used for base pointer?

2008-02-14 Thread H.J. Lu
> > Hi, > > > > 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. x

Re: [discuss] When is RBX used for base pointer?

2008-02-14 Thread Jan Hubicka
> > > Hi, > > > > > > 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'

RE: [discuss] When is RBX used for base pointer?

2008-02-18 Thread Ye, Joey
On Wed, 13 Feb 2008, H.J. Lu wrote: >> Recent i386 use arbitrary register as GOT pointer only for leaf >> function. When you call something, the GOT entry uses EBX too. >> We use RBX for large PIC model. But I am with Michael here that I don't >> see reason why choice of register needs to be

Re: [discuss] When is RBX used for base pointer?

2008-02-20 Thread Jan Hubicka
Hi, > Michael, Jan, > > When aligning stack for those functions who have dynamic stack > allocation, we must use an available callee-saved register in prologue. > We named this hard register DRAP. It is worthwhile to emphasize that > *free* here means "free in prologue". After prologue, a virtual

RE: [discuss] When is RBX used for base pointer?

2008-02-25 Thread Ye, Joey
Honza, > Honza said: > I am bit confused here. If I wanted a free register in prologue only, I > would probably look at the caller saved ones. But I gues it is just > typo. > I don't see much value in making the register callee-saved especially if > you say that virtual reg (pseudo?) is used af