qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 8/x] ppc: Convert op_set_FT0 to TCG


From: Aurélien Jarno
Subject: Re: [Qemu-devel] [PATCH 8/x] ppc: Convert op_set_FT0 to TCG
Date: Thu, 4 Sep 2008 22:36:19 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Sep 04, 2008 at 07:59:37PM +0200, Andreas Färber wrote:
> Replace op_set_FT0 with tcg_gen_movi_i64.
>
> Signed-off-by: Andreas Faerber <address@hidden>
>
> ---
> Here's a small one since we now seem to be both working on ppc.
>
> I'm not sure if this is correct since the dyngen op set the upper half  
> to zero. Do we need an explicit cast to 32 bits for the immediate  
> argument to assure they will be zero? Or was that just to avoid garbage 
> with dyngen?

No we don't. If you like at the instruction decoding, or at the PowerPC
manual, you will see that the resulting number is always representable
with a 32-bit variable. In dyngen, I guess it was to avoid passing both 
PARAM1 and PARAM2.

Patch applied.

>
> Andreas
>
>  target-ppc/op.c        |   10 ----------
>  target-ppc/translate.c |    2 +-
>  2 files changed, 1 insertions(+), 11 deletions(-)
>
> diff --git a/target-ppc/op.c b/target-ppc/op.c
> index a31b41f..81329e3 100644
> --- a/target-ppc/op.c
> +++ b/target-ppc/op.c
> @@ -424,16 +424,6 @@ void OPPROTO op_load_fpscr_FT0 (void)
>      RETURN();
>  }
>
> -void OPPROTO op_set_FT0 (void)
> -{
> -    CPU_DoubleU u;
> -
> -    u.l.upper = 0;
> -    u.l.lower = PARAM1;
> -    FT0 = u.d;
> -    RETURN();
> -}
> -
>  void OPPROTO op_load_fpscr_T0 (void)
>  {
>      T0 = (env->fpscr >> PARAM1) & 0xF;
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index 9dd2506..5139ae6 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -2090,7 +2090,7 @@ GEN_HANDLER(mtfsfi, 0x3F, 0x06, 0x04, 0x006f0800, 
> PPC_FLOAT)
>      bf = crbD(ctx->opcode) >> 2;
>      sh = 7 - bf;
>      gen_optimize_fprf();
> -    gen_op_set_FT0(FPIMM(ctx->opcode) << (4 * sh));
> +    tcg_gen_movi_i64(cpu_FT[0], FPIMM(ctx->opcode) << (4 * sh));
>      gen_reset_fpstatus();
>      gen_op_store_fpscr(1 << sh);
>      if (unlikely(Rc(ctx->opcode) != 0)) {
> -- 
> 1.5.5.1
>


>


-- 
  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net




reply via email to

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