Skip to content

Further tcg ldst improvements

Richard Henderson qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7exec: Reorganize the GETRA/GETPC macrosinclude/exec/exec-all.h include/exec/softmmu_template.h+58 -530 replies
2/7tcg-i386: Don't perform GETPC adjustment in TCG codetcg/i386/tcg-target.c+14 -200 replies
3/7exec: Rename USUFFIX to LSUFFIXinclude/exec/softmmu_template.h+6 -60 replies
4/7target: Include softmmu_exec.h where forgottentarget-lm32/op_helper.c target-moxie/helper.c target-ppc/mmu_helper.c +2 more+8 -00 replies
5/7exec: Split softmmu_defs.hinclude/exec/exec-all.h include/exec/softmmu_defs.h include/exec/softmmu_exec.h +11 more+49 -760 replies
6/7tcg: Introduce zero and sign-extended versions of load helpersinclude/exec/softmmu_template.h tcg/i386/tcg-target.c tcg/tcg.h+64 -210 replies
7/7tcg-i386: Perform tail call to qemu_ret_ld*_mmutcg/i386/tcg-target.c+39 -686 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/7] Further tcg ldst improvements

This is the follow-on that Aurelien and I discussed in thread for the PULL of the previous patch set.

The bulk of the patch set is rearranging things so that we can elide the move+extend instruction following the call to the load helper function. With the value properly extended for the register, and the register constrained to be the function return value, we can tail call to the helper.

The ARM patches I posted previously contain a variant of this idea, locallized to the ARM backend. But with Aurelian suggesting that the tail call idea be used on x86 as well, ignoring the effect on the cpu's call-return prediction stack, it's worthwhile to make the generic helpers do the job.

Tested on x86_64 and i686. There is a universal decrease in TB code size. In scanning a few dumps, I did not see a TB that was complicated enough that the fast path was penalized by constraining the qemu_ld output register.

If this is the way we want to go with this, I'll revise my patch sets for the other tcg backends based on this.

r~

Richard Henderson (7):
exec: Reorganize the GETRA/GETPC macros
tcg-i386: Don't perform GETPC adjustment in TCG code
exec: Rename USUFFIX to LSUFFIX
target: Include softmmu_exec.h where forgotten
exec: Split softmmu_defs.h
tcg: Introduce zero and sign-extended versions of load helpers
tcg-i386: Perform tail call to qemu_ret_ld*_mmu

 include/exec/exec-all.h         |  92 +++++++++++++------------
 include/exec/softmmu_defs.h     |  49 --------------
 include/exec/softmmu_exec.h     |   3 +-
 include/exec/softmmu_template.h |  88 ++++++++++++++++++------
 target-lm32/op_helper.c         |   2 +
 target-moxie/helper.c           |   1 +
 target-ppc/mmu_helper.c         |   2 +
 target-unicore32/op_helper.c    |   2 +
 target-xtensa/op_helper.c       |   1 +
 tcg/aarch64/tcg-target.c        |   2 -
 tcg/arm/tcg-target.c            |   2 -
 tcg/hppa/tcg-target.c           |   2 -
 tcg/i386/tcg-target.c           | 146 +++++++++++++++-------------------------
 tcg/ia64/tcg-target.c           |   3 -
 tcg/mips/tcg-target.c           |   3 -
 tcg/ppc/tcg-target.c            |   2 -
 tcg/ppc64/tcg-target.c          |   3 -
 tcg/s390/tcg-target.c           |   3 -
 tcg/sparc/tcg-target.c          |   2 -
 tcg/tcg.h                       |  52 ++++++++++++++
 20 files changed, 227 insertions(+), 233 deletions(-)
 delete mode 100644 include/exec/softmmu_defs.h
Signature · 1 line
1.8.1.4