qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 07/40] Add GEN_VXRFORM{, 1} macros for subsequen


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 07/40] Add GEN_VXRFORM{, 1} macros for subsequent instructions.
Date: Sat, 3 Jan 2009 14:58:03 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Dec 30, 2008 at 07:09:49PM -0800, Nathan Froyd wrote:
> 
> Signed-off-by: Nathan Froyd <address@hidden>
> ---
>  target-ppc/translate.c |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index 56d5c51..967d9da 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -6206,6 +6206,33 @@ GEN_VXFORM(vavgsb, 1, 20);
>  GEN_VXFORM(vavgsh, 1, 21);
>  GEN_VXFORM(vavgsw, 1, 22);
>  
> +#define GEN_VXRFORM1(opname, name, str, opc2, opc3)                     \
> +    GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC)   \
> +    {                                                                   \
> +        TCGv_ptr ra, rb, rd;                                            \
> +        TCGv_i32 result;                                                \
> +        if (unlikely(!ctx->altivec_enabled)) {                          \
> +            gen_exception(ctx, POWERPC_EXCP_VPU);                       \
> +            return;                                                     \
> +        }                                                               \
> +        ra = gen_avr_ptr(rA(ctx->opcode));                              \
> +        rb = gen_avr_ptr(rB(ctx->opcode));                              \
> +        rd = gen_avr_ptr(rD(ctx->opcode));                              \
> +        result = tcg_temp_new_i32();                                    \
> +        gen_helper_##opname (result, rd, ra, rb);                       \
> +        if (opc3 & 0x1) {                                               \

This should be opc3 & (0x1 << 4).

> +            tcg_gen_mov_i32(cpu_crf[6], result);                        \
> +        }                                                               \

By the way, given those functions are using helpers, it may be better to
have one helper for normal functions and one helper for '.' functions
which directly write env->crf[6]. It would probably be a bit faster.

Note that the other PowerPC instructions are maybe not the best
templates for that, given they have been translated from dyngen. I am
planning to fold part of the TCG code directly into the helper for some
of them.

> +        tcg_temp_free_ptr(ra);                                          \
> +        tcg_temp_free_ptr(rb);                                          \
> +        tcg_temp_free_ptr(rd);                                          \
> +        tcg_temp_free_i32(result);                                      \
> +    }
> +
> +#define GEN_VXRFORM(name, opc2, opc3)                                \
> +    GEN_VXRFORM1(name, name, #name, opc2, opc3)                      \
> +    GEN_VXRFORM1(name, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
> +
>  /***                           SPE extension                               
> ***/
>  /* Register moves */
>  
> -- 
> 1.6.0.5
> 
> 
> 
> 

-- 
  .''`.  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]