qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] tcg: store constants without using registers when


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [RFC] tcg: store constants without using registers when possible
Date: Mon, 28 Sep 2009 21:22:46 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Sep 28, 2009 at 09:08:32PM +0300, Blue Swirl wrote:
> On Mon, Sep 28, 2009 at 12:12 PM, Aurelien Jarno <address@hidden> 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
address@hidden                 http://www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]