[PATCH v2 00/23] Introduce MMU_INDEX()

Helge Deller posted 23 patches 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230806121732.91853-1-deller@gmx.de
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Brian Cain <bcain@quicinc.com>, Song Gao <gaosong@loongson.cn>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Laurent Vivier <laurent@vivier.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>, Stafford Horne <shorne@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Nicholas Piggin <npiggin@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Max Filippov <jcmvbkbc@gmail.com>
include/exec/cpu-defs.h   | 10 ++++++++++
target/alpha/cpu.h        |  6 +++---
target/arm/cpu.h          |  4 ++--
target/avr/cpu.h          |  4 ++--
target/cris/cpu.h         |  4 ++--
target/hexagon/cpu.h      |  2 +-
target/hppa/cpu.h         |  6 +++---
target/i386/cpu.h         | 10 +++++-----
target/loongarch/cpu.h    |  8 ++++----
target/m68k/cpu.h         |  6 +++---
target/microblaze/cpu.h   |  6 +++---
target/mips/cpu.h         |  6 +++---
target/nios2/cpu.h        |  4 ++--
target/openrisc/cpu.h     |  6 +++---
target/ppc/cpu.h          |  5 +++--
target/riscv/cpu.h        |  4 ++--
target/riscv/cpu_helper.c |  2 +-
target/rx/cpu.h           |  2 +-
target/s390x/cpu.h        | 10 +++++-----
target/sh4/cpu.h          |  7 ++++---
target/sparc/cpu.h        | 20 ++++++++++----------
target/tricore/cpu.h      |  4 ++--
target/xtensa/cpu.h       |  4 ++--
23 files changed, 76 insertions(+), 64 deletions(-)
[PATCH v2 00/23] Introduce MMU_INDEX()
Posted by Helge Deller 9 months ago
This is v2 of the patchset.
It is *identical* to v1, but v1 missed patches #20-24 since I hit
a mail batch limit with my email provider.

This patchset introduces the new helper macro MMU_INDEX().
whill will (after applying the last patch) allow to generate
 smaller code by the tcg.

Patch #1 adds the MMU_INDEX() helper macro, which simply wraps
the given value.

Patches #2-#23 are trivial patches which convert each target to use the MMU_INDEX()
macro.

Patch #24 switches MMU_INDEX() to return a new MMU idx which
is counts down from (NB_MMU_MODES-1). That change reduces the needed
negative offset to access the TLB entry which in turn let the tcg compiler
generates smaller instructions.

Please review.

Helge

Helge Deller (23):
  cpu-defs.h; Add MMU_INDEX() helper
  target/i386: Use MMU_INDEX() helper
  target/hppa: Use MMU_INDEX() helper
  target/alpha: Use MMU_INDEX() helper
  target/avr: Use MMU_INDEX() helper
  target/hexagon: Use MMU_INDEX() helper
  target/loongarch: Use MMU_INDEX() helper
  target/mips: Use MMU_INDEX() helper
  target/openrisc: Use MMU_INDEX() helper
  target/riscv: Use MMU_INDEX() helper
  target/s390x: Use MMU_INDEX() helper
  target/sparc: Use MMU_INDEX() helper
  target/xtensa: Use MMU_INDEX() helper
  target/arm: Use MMU_INDEX() helper
  target/cris: Use MMU_INDEX() helper
  target/m68k: Use MMU_INDEX() helper
  target/microblaze: Use MMU_INDEX() helper
  target/m68k: Use MMU_INDEX() helper
  target/ppc: Use MMU_INDEX() helper
  target/rx: Use MMU_INDEX() helper
  target/sh4: Use MMU_INDEX() helper
  target/tricore: Use MMU_INDEX() helper
  cpu-defs.h: Reduce generated code size by inverting MMU_INDEX()

 include/exec/cpu-defs.h   | 10 ++++++++++
 target/alpha/cpu.h        |  6 +++---
 target/arm/cpu.h          |  4 ++--
 target/avr/cpu.h          |  4 ++--
 target/cris/cpu.h         |  4 ++--
 target/hexagon/cpu.h      |  2 +-
 target/hppa/cpu.h         |  6 +++---
 target/i386/cpu.h         | 10 +++++-----
 target/loongarch/cpu.h    |  8 ++++----
 target/m68k/cpu.h         |  6 +++---
 target/microblaze/cpu.h   |  6 +++---
 target/mips/cpu.h         |  6 +++---
 target/nios2/cpu.h        |  4 ++--
 target/openrisc/cpu.h     |  6 +++---
 target/ppc/cpu.h          |  5 +++--
 target/riscv/cpu.h        |  4 ++--
 target/riscv/cpu_helper.c |  2 +-
 target/rx/cpu.h           |  2 +-
 target/s390x/cpu.h        | 10 +++++-----
 target/sh4/cpu.h          |  7 ++++---
 target/sparc/cpu.h        | 20 ++++++++++----------
 target/tricore/cpu.h      |  4 ++--
 target/xtensa/cpu.h       |  4 ++--
 23 files changed, 76 insertions(+), 64 deletions(-)

--
2.41.0