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~