mbox series

[v2,00/28] target/mips: Explode 60% of the 32K-lines translate.c

Message ID 20201123204448.3260804-1-f4bug@amsat.org
Headers show
Series target/mips: Explode 60% of the 32K-lines translate.c | expand

Message

Philippe Mathieu-Daudé Nov. 23, 2020, 8:44 p.m. UTC
Since v1:
- Addressed Richard review comments

Patches missing review: 1,3,4,21,22,25

Hi,

This series, while boring, helps maintainability.

I simply exploded 60% of the huge target/mips/translate.c,
reducing it from 32K lines of code to 13500.

The small overhead in the diffstat is due to entries added in
MAINTAINERS and license boilerplate addition:
20225 insertions(+), 19987 deletions(-)

While being a massive diff, it is a no-brain review using
'git-diff --color-moved=dimmed-zebra' which highlights very few
changes: #include and license lines.

The exploded new layout, which allows more useful filtering
with the get_maintainer.pl script, is:

- MIPS ISA, ASE and modules:

 . isa-micromips_helper.h.inc
 . isa-nanomips_translate.c.inc

 . ase-mips16e_translate.c.inc

 . mod-dsp_helper.c
 . mod-dsp_helper.h.inc
 . mod-dsp_translate.c.inc
 . mod-msa_helper.h.inc
 . mod-msa_translate.c.inc
 . mod-msa_helper.c
 . mod-mt_helper.h.inc

- MIPS Vendor Specific:

 . vendor-loong-simd_helper.c
 . vendor-loong-ext_translate.c.inc
 . vendor-loong-simd_helper.h.inc
 . vendor-loong-simd_translate.c.inc

 . vendor-tx-mmi_translate.c.inc
 . vendor-tx_translate.c.inc

 . vendor-vr54xx_helper.c
 . vendor-vr54xx_helper.h.inc
 . vendor-vr54xx_translate.c.inc

 . vendor-mxu_translate.c.inc

There should be no logical code change (only code movement).

The series is available at:

  https://gitlab.com/philmd/qemu.git tags/mips_translate_explode-v2

Regards,

Phil.

Philippe Mathieu-Daudé (28):
  target/mips: Use FloatRoundMode enum for FCR31 modes conversion
  target/mips: Extract FPU helpers to 'fpu_helper.h'
  target/mips: Rename msa_helper.c as mod-msa_helper.c
  target/mips: Extract MSA helpers from op_helper.c
  target/mips: Extract MSA helper definitions
  target/mips: Extract MSA translation routines
  target/mips: Rename dsp_helper.c as mod-dsp_helper.c
  target/mips: Extract DSP helper definitions
  target/mips: Extract DSP translation routines
  target/mips: Extract Multi-Threading helper definitions
  target/mips: Extract Code Compaction ASE translation routines
  target/mips: Extract the microMIPS ISA helper definitions
  target/mips: Extract the microMIPS ISA translation routines
  target/mips: Extract nanoMIPS ISA translation routines
  target/mips: Extract NEC Vr54xx helpers to vendor-vr54xx_helper.c
  target/mips: Extract NEC Vr54xx helper definitions
  target/mips: Extract NEC Vr54xx translation routines
  target/mips: Rename lmmi_helper.c as loong-simd_helper.c
  target/mips: Extract Loongson SIMD helper definitions
  target/mips: Extract Loongson SIMD translation routines
  target/mips: Extract Loongson EXTensions translation routines
  target/mips: Extract XBurst Media eXtension Unit translation routines
  target/mips: Make pipeline 1 multiply opcodes generic
  target/mips: Extract Toshiba TXx9 translation routines
  target/mips: Extract Toshiba TX79 multimedia translation routines
  MAINTAINERS: Add entry for MIPS Loongson TCG
  MAINTAINERS: Add entry for MIPS Ingenic Xburst TCG
  MAINTAINERS: Add entry for MIPS Toshiba TCG

 target/mips/fpu_helper.h                      |    50 +
 target/mips/helper.h                          |   881 +-
 target/mips/internal.h                        |    42 -
 linux-user/mips/cpu_loop.c                    |     1 +
 target/mips/fpu_helper.c                      |     3 +-
 target/mips/gdbstub.c                         |     1 +
 target/mips/kvm.c                             |     1 +
 target/mips/machine.c                         |     1 +
 .../mips/{dsp_helper.c => mod-dsp_helper.c}   |     2 +
 .../mips/{msa_helper.c => mod-msa_helper.c}   |   393 +
 target/mips/op_helper.c                       |   511 -
 target/mips/translate.c                       | 18696 +---------------
 ...mi_helper.c => vendor-loong-simd_helper.c} |     0
 target/mips/vendor-vr54xx_helper.c            |   131 +
 MAINTAINERS                                   |    20 +
 target/mips/ase-mips16e_translate.c.inc       |  1170 +
 target/mips/isa-micromips_helper.h.inc        |    17 +
 target/mips/isa-micromips_translate.c.inc     |  3316 +++
 target/mips/isa-nanomips_translate.c.inc      |  4839 ++++
 target/mips/meson.build                       |     8 +-
 target/mips/mod-dsp_helper.h.inc              |   344 +
 target/mips/mod-dsp_translate.c.inc           |  2158 ++
 target/mips/mod-msa_helper.h.inc              |   443 +
 target/mips/mod-msa_translate.c.inc           |  2218 ++
 target/mips/mod-mt_helper.h.inc               |    36 +
 target/mips/vendor-loong-ext_translate.c.inc  |   665 +
 target/mips/vendor-loong-simd_helper.h.inc    |    69 +
 target/mips/vendor-loong-simd_translate.c.inc |   492 +
 target/mips/vendor-mxu_translate.c.inc        |  2892 +++
 target/mips/vendor-tx-mmi_translate.c.inc     |   573 +
 target/mips/vendor-tx_translate.c.inc         |   315 +
 target/mips/vendor-vr54xx_helper.h.inc        |    24 +
 target/mips/vendor-vr54xx_translate.c.inc     |    93 +
 33 files changed, 20320 insertions(+), 20085 deletions(-)
 create mode 100644 target/mips/fpu_helper.h
 rename target/mips/{dsp_helper.c => mod-dsp_helper.c} (99%)
 rename target/mips/{msa_helper.c => mod-msa_helper.c} (94%)
 rename target/mips/{lmmi_helper.c => vendor-loong-simd_helper.c} (100%)
 create mode 100644 target/mips/vendor-vr54xx_helper.c
 create mode 100644 target/mips/ase-mips16e_translate.c.inc
 create mode 100644 target/mips/isa-micromips_helper.h.inc
 create mode 100644 target/mips/isa-micromips_translate.c.inc
 create mode 100644 target/mips/isa-nanomips_translate.c.inc
 create mode 100644 target/mips/mod-dsp_helper.h.inc
 create mode 100644 target/mips/mod-dsp_translate.c.inc
 create mode 100644 target/mips/mod-msa_helper.h.inc
 create mode 100644 target/mips/mod-msa_translate.c.inc
 create mode 100644 target/mips/mod-mt_helper.h.inc
 create mode 100644 target/mips/vendor-loong-ext_translate.c.inc
 create mode 100644 target/mips/vendor-loong-simd_helper.h.inc
 create mode 100644 target/mips/vendor-loong-simd_translate.c.inc
 create mode 100644 target/mips/vendor-mxu_translate.c.inc
 create mode 100644 target/mips/vendor-tx-mmi_translate.c.inc
 create mode 100644 target/mips/vendor-tx_translate.c.inc
 create mode 100644 target/mips/vendor-vr54xx_helper.h.inc
 create mode 100644 target/mips/vendor-vr54xx_translate.c.inc

Comments

Philippe Mathieu-Daudé Dec. 7, 2020, 11:08 p.m. UTC | #1
On 11/23/20 9:44 PM, Philippe Mathieu-Daudé wrote:
> Since v1:
> - Addressed Richard review comments
> 
> Patches missing review: 1,3,4,21,22,25
> 
> Hi,
> 
> This series, while boring, helps maintainability.
> 
> I simply exploded 60% of the huge target/mips/translate.c,
> reducing it from 32K lines of code to 13500.
> 
> The small overhead in the diffstat is due to entries added in
> MAINTAINERS and license boilerplate addition:
> 20225 insertions(+), 19987 deletions(-)
> 
> While being a massive diff, it is a no-brain review using
> 'git-diff --color-moved=dimmed-zebra' which highlights very few
> changes: #include and license lines.
> 
> The exploded new layout, which allows more useful filtering
> with the get_maintainer.pl script, is:
> 
> - MIPS ISA, ASE and modules:
> 
>  . isa-micromips_helper.h.inc
>  . isa-nanomips_translate.c.inc
> 
>  . ase-mips16e_translate.c.inc
> 
>  . mod-dsp_helper.c
>  . mod-dsp_helper.h.inc
>  . mod-dsp_translate.c.inc
>  . mod-msa_helper.h.inc
>  . mod-msa_translate.c.inc
>  . mod-msa_helper.c
>  . mod-mt_helper.h.inc
> 
> - MIPS Vendor Specific:
> 
>  . vendor-loong-simd_helper.c
>  . vendor-loong-ext_translate.c.inc
>  . vendor-loong-simd_helper.h.inc
>  . vendor-loong-simd_translate.c.inc
> 
>  . vendor-tx-mmi_translate.c.inc
>  . vendor-tx_translate.c.inc
> 
>  . vendor-vr54xx_helper.c
>  . vendor-vr54xx_helper.h.inc
>  . vendor-vr54xx_translate.c.inc
> 
>  . vendor-mxu_translate.c.inc
> 
> There should be no logical code change (only code movement).
> 
> The series is available at:
> 
>   https://gitlab.com/philmd/qemu.git tags/mips_translate_explode-v2
> 
> Regards,
> 
> Phil.
> 
> Philippe Mathieu-Daudé (28):
>   target/mips: Use FloatRoundMode enum for FCR31 modes conversion
>   target/mips: Extract FPU helpers to 'fpu_helper.h'

Patches 1 and 2 queued to mips-next.