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 whe


From: Blue Swirl
Subject: Re: [Qemu-devel] [RFC] tcg: store constants without using registers when possible
Date: Mon, 28 Sep 2009 21:08:32 +0300

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?

> --- 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;
}




reply via email to

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