Here's where I think we should go with the cleanup that Peter started. I've only converted a couple of the backends as examples. It's not 100% mechanical, since one has to be aware of the change in the semantics of pointer arithmetic (e.g. s->code_ptr - s->code_buf).
Taking Sparc as an example, the before code size of tcg.o is 0xad60, and the after code size is 0xa200. A savings of a bit less than 3k. Thoughts? r~ Peter Maydell (3): exec-all.h: Use stl_p to avoid undefined behaviour patching x86 jumps tcg: Avoid stores to unaligned addresses tcg: Avoid undefined behaviour patching code at unaligned addresses Richard Henderson (5): tcg: Define tcg_itype for code pointers tcg-ppc64: Define TCG_TARGET_ITYPE_SIZE tcg-ppc: Define TCG_TARGET_ITYPE_SIZE tcg-aarch64: Define TCG_TARGET_ITYPE_SIZE tcg-sparc: Define TCG_TARGET_ITYPE_SIZE include/exec/exec-all.h | 4 +-- tcg/aarch64/tcg-target.c | 38 +++++++++------------ tcg/aarch64/tcg-target.h | 1 + tcg/i386/tcg-target.c | 12 +++---- tcg/i386/tcg-target.h | 1 + tcg/ppc/tcg-target.c | 55 +++++++++++++++--------------- tcg/ppc/tcg-target.h | 1 + tcg/ppc64/tcg-target.c | 46 +++++++++++++------------ tcg/ppc64/tcg-target.h | 1 + tcg/sparc/tcg-target.c | 57 +++++++++++++++---------------- tcg/sparc/tcg-target.h | 2 +- tcg/tcg-be-ldst.h | 4 +-- tcg/tcg.c | 87 ++++++++++++++++++++++++++++++++++++++---------- tcg/tcg.h | 37 +++++++++++++++----- translate-all.c | 6 ++-- 15 files changed, 209 insertions(+), 143 deletions(-) -- 1.9.0