tcg constant pools
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest23 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/23 | tcg: Move USE_DIRECT_JUMP discriminator to tcg/cpu/tcg-target.haccel/ accel/ include/ +14 more | +107 | 0 replies | |
| 2/23 | tcg: Rearrange ldst label trackingtcg/ tcg/ tcg/ +17 more | +61 | 1 reply | |
| 3/23 | tcg: Infrastructure for managing constant poolsaccel/ tcg/ tcg/ +1 more | +119 | 0 replies | |
| 4/23 | tcg/i386: Store out-of-range call targets in constant pooltcg/ tcg/ | +16 | 0 replies | |
| 5/23 | tcg/s390: Introduce TCG_REG_TBtcg/ tcg/ | +61 | 0 replies | |
| 6/23 | tcg/s390: Fix sign of patch_reloc addendtcg/ | +13 | 0 replies | |
| 7/23 | tcg/s390: Use constant pool for moviinclude/ tcg/ tcg/ | +80 | 0 replies | |
| 8/23 | tcg/s390: Use constant pool for anditcg/ | +14 | 0 replies | |
| 9/23 | tcg/s390: Use constant pool for oritcg/ | +34 | 0 replies | |
| 10/23 | tcg/s390: Use constant pool for xoritcg/ | +40 | 0 replies | |
| 11/23 | tcg/s390: Use constant pool for cmpitcg/ | +67 | 0 replies | |
| 12/23 | tcg/aarch64: Use constant pool for movitcg/ tcg/ | +33 | 0 replies | |
| 13/23 | tcg/sparc: Introduce TCG_REG_TBtcg/ | +140 | 0 replies | |
| 14/23 | tcg/sparc: Use constant pool for movitcg/ tcg/ | +58 | 0 replies | |
| 15/23 | tcg/arm: Improve tlb load for armv7tcg/ | +52 | 0 replies | |
| 16/23 | tcg/arm: Tighten tlb indexing offset testtcg/ | +3 | 0 replies | |
| 17/23 | tcg/arm: Code rearrangementtcg/ | +299 | 0 replies | |
| 18/23 | tcg/arm: Extract INSN_NOPtcg/ | +11 | 0 replies | |
| 19/23 | tcg/arm: Use constant pool for movitcg/ tcg/ | +75 | 0 replies | |
| 20/23 | tcg/arm: Use constant pool for calltcg/ | +3 | 0 replies | |
| 21/23 | tcg/ppc: Change TCG_REG_RA to TCG_REG_TBtcg/ | +122 | 0 replies | |
| 22/23 | tcg/ppc: Look for shifted constantstcg/ | +9 | 2 replies | |
| 23/23 | tcg/ppc: Use constant pool for movitcg/ tcg/ | +31 | 0 replies |
Reviews trailers per patch
1 of 23 patches has a Reviewed-by or Acked-by.
| Patch | Paolo Bonzini |
|---|---|
| 1/23 | |
| 2/23 | R-b |
| 3/23 | |
| 4/23 | |
| 5/23 | |
| 6/23 | |
| 7/23 | |
| 8/23 | |
| 9/23 | |
| 10/23 | |
| 11/23 | |
| 12/23 | |
| 13/23 | |
| 14/23 | |
| 15/23 | |
| 16/23 | |
| 17/23 | |
| 18/23 | |
| 19/23 | |
| 20/23 | |
| 21/23 | |
| 22/23 | |
| 23/23 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [PATCH for-2.11 00/23] tcg constant pools
RISC machines often require many instructions in order to construct large constants from the immediate values available to individual instructions. Static compilers like GCC often place these large constants into read-only memory and use one load instruction to fetch the constant instead; a collection of these is known as a "constant pool".
TCG currently generates all constants from immediate values. This can require 4 insns for a full 64-bit value for AArch64, 4 insns for a full 32-bit value for AArch32 v6. s390x z9 needs 4, ppc64 and sparc64 need 5, mips64 needs 6.
Moreover, entries in the constant pool may be used more than once. For instance, if there are 3 consecutive guest stores, then we can enter the host address of helper_le_ldul_mmu into the constant pool once for the 3 call invocations. Depending on the host memory map, the result may be a savings of (4*3*4) - (1*3*4+1*8) = 28 bytes.
This last is even true for the x86_64 host, where
movq $helper_ld_ldul_mmu, %rax; call *%rax
costs 10+6 bytes, but
call *label(%rip); .quad helper_ld_ldul_mmu
costs 6+8 bytes, plus the ability to share the 8 bytes for the entry.
r~
Richard Henderson (23):
tcg: Move USE_DIRECT_JUMP discriminator to tcg/cpu/tcg-target.h
tcg: Rearrange ldst label tracking
tcg: Infrastructure for managing constant pools tcg/i386: Store out-of-range call targets in constant pool tcg/s390: Introduce TCG_REG_TB
tcg/s390: Fix sign of patch_reloc addend
tcg/s390: Use constant pool for movi
tcg/s390: Use constant pool for andi
tcg/s390: Use constant pool for ori
tcg/s390: Use constant pool for xori
tcg/s390: Use constant pool for cmpi
tcg/aarch64: Use constant pool for movi
tcg/sparc: Introduce TCG_REG_TB
tcg/sparc: Use constant pool for movi
tcg/arm: Improve tlb load for armv7
tcg/arm: Tighten tlb indexing offset test
tcg/arm: Code rearrangement
tcg/arm: Extract INSN_NOP
tcg/arm: Use constant pool for movi
tcg/arm: Use constant pool for call
tcg/ppc: Change TCG_REG_RA to TCG_REG_TB
tcg/ppc: Look for shifted constants
tcg/ppc: Use constant pool for movi
include/elf.h | 3 +-
include/exec/exec-all.h | 95 +----
tcg/aarch64/tcg-target.h | 8 +
tcg/arm/tcg-target.h | 9 +
tcg/i386/tcg-target.h | 14 +
tcg/ia64/tcg-target.h | 8 +
tcg/mips/tcg-target.h | 7 +
tcg/ppc/tcg-target.h | 7 +
tcg/s390/tcg-target.h | 15 +
tcg/sparc/tcg-target.h | 5 +
tcg/tcg-be-null.h | 44 --
tcg/tcg.h | 14 +-
tcg/tci/tcg-target.h | 9 +
accel/tcg/cpu-exec.c | 35 ++
accel/tcg/translate-all.c | 36 +-
tcg/aarch64/tcg-target.inc.c | 78 ++--
tcg/arm/tcg-target.inc.c | 780 +++++++++++++++++++---------------
tcg/i386/tcg-target.inc.c | 20 +-
tcg/ia64/tcg-target.inc.c | 19 +-
tcg/mips/tcg-target.inc.c | 7 +-
tcg/ppc/tcg-target.inc.c | 320 +++++++-------
tcg/s390/tcg-target.inc.c | 527 +++++++++++++----------
tcg/sparc/tcg-target.inc.c | 240 ++++++++---
tcg/{tcg-be-ldst.h => tcg-ldst.inc.c} | 27 +-
tcg/tcg-pool.inc.c | 85 ++++
tcg/tcg.c | 26 +-
tcg/tci/tcg-target.inc.c | 2 -
27 files changed, 1422 insertions(+), 1018 deletions(-)
delete mode 100644 tcg/tcg-be-null.h
rename tcg/{tcg-be-ldst.h => tcg-ldst.inc.c} (85%)
create mode 100644 tcg/tcg-pool.inc.cSignature · 1 line
2.13.3