All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 05/10] tcg/mips: use stack for TCG temps
Date: Sat, 22 Sep 2012 19:25:09 +0200	[thread overview]
Message-ID: <20120922172509.GA27699@ohm.aurel32.net> (raw)
In-Reply-To: <CAAu8pHt7ReX8VyrqM7EV5k-2EtcT=bQDNTft669C_GzSgyweoQ@mail.gmail.com>

On Sat, Sep 22, 2012 at 02:37:35PM +0000, Blue Swirl wrote:
> On Fri, Sep 21, 2012 at 4:43 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > Use stack instead of temp_buf array in CPUState for TCG
> > temps.
> >
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> >  tcg/mips/tcg-target.c |   10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
> > index 0ea6a76..c05169f 100644
> > --- a/tcg/mips/tcg-target.c
> > +++ b/tcg/mips/tcg-target.c
> > @@ -1538,11 +1538,15 @@ static void tcg_target_qemu_prologue(TCGContext *s)
> >  {
> >      int i, frame_size;
> >
> > -    /* reserve some stack space */
> > +    /* reserve some stack space, also for TCG temps. */
> >      frame_size = ARRAY_SIZE(tcg_target_callee_save_regs) * 4
> > -                 + TCG_STATIC_CALL_ARGS_SIZE;
> > +                 + TCG_STATIC_CALL_ARGS_SIZE
> > +                 + CPU_TEMP_BUF_NLONGS * sizeof(long);
> >      frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1) &
> >                   ~(TCG_TARGET_STACK_ALIGN - 1);
> > +    tcg_set_frame(s, TCG_REG_SP, ARRAY_SIZE(tcg_target_callee_save_regs) * 4
> > +                  + TCG_STATIC_CALL_ARGS_SIZE,
> > +                  CPU_TEMP_BUF_NLONGS * sizeof(long));
> 
> My version used frame_size instead of duplicating a part of the
> calculations, wouldn't that take stack alignment also in
> consideration?
> 
> http://lists.nongnu.org/archive/html/qemu-devel/2011-06/msg02566.html

Oh haven't seen this patch before. Well the choice is basically between
adding one value and subtracting one, not sure what is the best.

About the alignment, do we require some specific alignment for the
temps? As long as they are aligned wrt size, I think it's fine.

> >
> >      /* TB prologue */
> >      tcg_out_addi(s, TCG_REG_SP, -frame_size);
> > @@ -1597,6 +1601,4 @@ static void tcg_target_init(TCGContext *s)
> >      tcg_regset_set_reg(s->reserved_regs, TCG_REG_GP);   /* global pointer */
> >
> >      tcg_add_target_add_op_defs(mips_op_defs);
> > -    tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf),
> > -                  CPU_TEMP_BUF_NLONGS * sizeof(long));
> >  }
> > --
> > 1.7.10.4
> >
> >
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2012-09-22 17:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 16:43 [Qemu-devel] [PATCH 00/10] tcg/mips: cleanup and improvements Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 01/10] tcg-mips: fix wrong usage of 'Z' constraint Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 02/10] tcg/mips: kill warnings in user mode Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 03/10] tcg/mips: use TCGArg or TCGReg instead of int Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 04/10] tcg/mips: don't use global pointer Aurelien Jarno
2012-09-21 18:18   ` Richard Henderson
2012-09-21 21:13     ` Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 05/10] tcg/mips: use stack for TCG temps Aurelien Jarno
2012-09-22 14:37   ` Blue Swirl
2012-09-22 17:25     ` Aurelien Jarno [this message]
2012-09-22 18:09       ` Blue Swirl
2012-09-22 18:17         ` Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 06/10] tcg/mips: optimize brcond arg, 0 Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 07/10] tcg/mips: optimize bswap{16, 16s, 32} on MIPS32R2 Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 08/10] tcg/mips: implement rotl/rotr ops " Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 09/10] tcg/mips: implement deposit op " Aurelien Jarno
2012-09-21 16:43 ` [Qemu-devel] [PATCH 10/10] tcg/mips: implement movcond " Aurelien Jarno
2012-09-21 19:33 ` [Qemu-devel] [PATCH 00/10] tcg/mips: cleanup and improvements Richard Henderson

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=20120922172509.GA27699@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.