qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 04/13] target/mips: Introduce decodetree helpers for Release6


From: Richard Henderson
Subject: Re: [PATCH 04/13] target/mips: Introduce decodetree helpers for Release6 LSA/DLSA opcodes
Date: Wed, 9 Dec 2020 08:21:45 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 12/8/20 2:36 PM, Philippe Mathieu-Daudé wrote:
> +++ b/target/mips/isa-mips_rel6_translate.c
> @@ -0,0 +1,33 @@
> +/*
> + *  MIPS emulation for QEMU - # Release 6 translation routines
> + *
> + *  Copyright (c) 2004-2005 Jocelyn Mayer
> + *  Copyright (c) 2006 Marius Groeger (FPU operations)
> + *  Copyright (c) 2006 Thiemo Seufer (MIPS32R2 support)
> + *  Copyright (c) 2020 Philippe Mathieu-Daudé
> + *
> + * This code is licensed under the GNU GPLv2 and later.
> + */
> +
> +#include "qemu/osdep.h"
> +#include "tcg/tcg-op.h"
> +#include "exec/helper-gen.h"
> +#include "translate.h"
> +
> +/* Include the auto-generated decoder.  */
> +#include "decode-isa-mips32r6.c.inc"
> +#if defined(TARGET_MIPS64)
> +#include "decode-isa-mips64r6.c.inc"
> +#endif /* TARGET_MIPS64 */
> +
> +static bool trans_LSA(DisasContext *ctx, arg_LSA *a)
> +{
> +    return gen_LSA(ctx, a->rd, a->rt, a->rs, a->sa);
> +}
> +
> +#if defined(TARGET_MIPS64)
> +static bool trans_DLSA(DisasContext *ctx, arg_LSA *a)
> +{
> +    return gen_DLSA(ctx, a->rd, a->rt, a->rs, a->sa);
> +}

You should be able to share these trans_* functions, and then with or after the
next patch, fold the gen_* functions into their single caller, the trans_*
functions.

Note that decodetree --translate=trans will drop the static, without otherwise
adjusting the function naming.


r~



reply via email to

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