Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/mips: Tidy helpers for translation
Move most includes from *translate*.c to translate.h, ensuring
that we get the ordering correct.  Ensure cpu.h is first.
Use disas/disas.h instead of exec/log.h.
Drop otherwise unused includes.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jun 5, 2023
1 parent 5d05e5a commit 8cab415
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 27 deletions.
3 changes: 0 additions & 3 deletions target/mips/tcg/msa_translate.c
Expand Up @@ -11,11 +11,8 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "exec/helper-gen.h"
#include "translate.h"
#include "fpu_helper.h"
#include "internal.h"

static int elm_n(DisasContext *ctx, int x);
static int elm_df(DisasContext *ctx, int x);
Expand Down
2 changes: 0 additions & 2 deletions target/mips/tcg/mxu_translate.c
Expand Up @@ -16,8 +16,6 @@
*/

#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "exec/helper-gen.h"
#include "translate.h"

/*
Expand Down
4 changes: 1 addition & 3 deletions target/mips/tcg/octeon_translate.c
Expand Up @@ -7,10 +7,8 @@
*/

#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "tcg/tcg-op-gvec.h"
#include "exec/helper-gen.h"
#include "translate.h"
#include "tcg/tcg-op-gvec.h"

/* Include the auto-generated decoder. */
#include "decode-octeon.c.inc"
Expand Down
2 changes: 0 additions & 2 deletions target/mips/tcg/rel6_translate.c
Expand Up @@ -9,8 +9,6 @@
*/

#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "exec/helper-gen.h"
#include "translate.h"

/* Include the auto-generated decoders. */
Expand Down
10 changes: 2 additions & 8 deletions target/mips/tcg/translate.c
Expand Up @@ -23,19 +23,13 @@
*/

#include "qemu/osdep.h"
#include "cpu.h"
#include "translate.h"
#include "internal.h"
#include "tcg/tcg-op.h"
#include "exec/translator.h"
#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
#include "semihosting/semihost.h"

#include "trace.h"
#include "exec/log.h"
#include "qemu/qemu-print.h"
#include "disas/disas.h"
#include "fpu_helper.h"
#include "translate.h"

#define HELPER_H "helper.h"
#include "exec/helper-info.c.inc"
Expand Down
6 changes: 4 additions & 2 deletions target/mips/tcg/translate.h
Expand Up @@ -8,9 +8,11 @@
#ifndef TARGET_MIPS_TRANSLATE_H
#define TARGET_MIPS_TRANSLATE_H

#include "qemu/log.h"
#include "exec/translator.h"
#include "cpu.h"
#include "tcg/tcg-op.h"
#include "exec/translator.h"
#include "exec/helper-gen.h"
#include "qemu/log.h"

#define MIPS_DEBUG_DISAS 0

Expand Down
1 change: 0 additions & 1 deletion target/mips/tcg/translate_addr_const.c
Expand Up @@ -11,7 +11,6 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "translate.h"

bool gen_lsa(DisasContext *ctx, int rd, int rt, int rs, int sa)
Expand Down
4 changes: 1 addition & 3 deletions target/mips/tcg/tx79_translate.c
Expand Up @@ -8,10 +8,8 @@
*/

#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "tcg/tcg-op-gvec.h"
#include "exec/helper-gen.h"
#include "translate.h"
#include "tcg/tcg-op-gvec.h"

/* Include the auto-generated decoder. */
#include "decode-tx79.c.inc"
Expand Down
3 changes: 0 additions & 3 deletions target/mips/tcg/vr54xx_translate.c
Expand Up @@ -10,10 +10,7 @@
*/

#include "qemu/osdep.h"
#include "tcg/tcg-op.h"
#include "exec/helper-gen.h"
#include "translate.h"
#include "internal.h"

/* Include the auto-generated decoder. */
#include "decode-vr54xx.c.inc"
Expand Down

0 comments on commit 8cab415

Please sign in to comment.