qemu-devel.nongnu.org archive mirror
 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] [RFC] tcg: store constants without using registers when possible
Date: Mon, 28 Sep 2009 21:22:46 +0200	[thread overview]
Message-ID: <20090928192246.GA6691@hall.aurel32.net> (raw)
In-Reply-To: <f43fc5580909281108p1720e98dm421b858715da6392@mail.gmail.com>

On Mon, Sep 28, 2009 at 09:08:32PM +0300, Blue Swirl wrote:
> On Mon, Sep 28, 2009 at 12:12 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > Currently only implemented for x86/x86_64. It may also be implemented
> > for targets that keep one register for TCG internal use.
> 
> Nice, but do you think the op will be used often?

It is used each time a constant is written to a global TCG variable and
written back to memory. A constant propagation patch like the ones Filip
proposed a few months ago increase the number of those cases.

> > --- a/tcg/sparc/tcg-target.c
> > +++ b/tcg/sparc/tcg-target.c
> > @@ -392,6 +392,15 @@ static inline void tcg_out_st(TCGContext *s, TCGType type, int arg,
> >         tcg_out_ldst(s, arg, arg1, arg2, STX);
> >  }
> >
> > +static inline int tcg_out_sti(TCGContext *s, TCGType type, tcg_target_long val,
> > +                              int arg1, tcg_target_long arg2)
> > +{
> > +    /* movl */
> > +    tcg_out_modrm_offset(s, 0xc7, 0, arg1, arg2);
> > +    tcg_out32(s, val);
> > +    return 1;
> > +}
> > +
> 
> Sparc doesn't have store immediate ops, except for val == 0 case:
> 
> static inline int tcg_out_sti(TCGContext *s, TCGType type, tcg_target_long val,
>                               int arg1, tcg_target_long arg2)
> {
>   if (val != 0) {
>     return 0;
>   }
>   /* clr/clrx */
>   tcg_out_st(s, type, TCG_REG_G0, arg1, arg2);
>   return 1;
> }
> 

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

      reply	other threads:[~2009-09-28 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28  9:12 [Qemu-devel] [RFC] tcg: store constants without using registers when possible Aurelien Jarno
2009-09-28 18:08 ` Blue Swirl
2009-09-28 19:22   ` Aurelien Jarno [this message]

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=20090928192246.GA6691@hall.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).