qemu-e2k/target/hppa
Helge Deller f8c0fd9804 target/hppa: Move iaoq registers and thus reduce generated code size
On hppa the Instruction Address Offset Queue (IAOQ) registers specifies
the next to-be-executed instructions addresses. Each generated TB writes those
registers at least once, so those registers are used heavily in generated
code.

Looking at the generated assembly, for a x86-64 host this code
to write the address $0x7ffe826f into iaoq_f is generated:
0x7f73e8000184:  c7 85 d4 01 00 00 6f 82  movl     $0x7ffe826f, 0x1d4(%rbp)
0x7f73e800018c:  fe 7f
0x7f73e800018e:  c7 85 d8 01 00 00 73 82  movl     $0x7ffe8273, 0x1d8(%rbp)
0x7f73e8000196:  fe 7f

With the trivial change, by moving the variables iaoq_f and iaoq_b to
the top of struct CPUArchState, the offset to %rbp is reduced (from
0x1d4 to 0), which allows the x86-64 tcg to generate 3 bytes less of
generated code per move instruction:
0x7fc1e800018c:  c7 45 00 6f 82 fe 7f     movl     $0x7ffe826f, (%rbp)
0x7fc1e8000193:  c7 45 04 73 82 fe 7f     movl     $0x7ffe8273, 4(%rbp)

Overall this is a reduction of generated code (not a reduction of
number of instructions).
A test run with checks the generated code size by running "/bin/ls"
with qemu-user shows that the code size shrinks from 1616767 to 1569273
bytes, which is ~97% of the former size.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: qemu-stable@nongnu.org
2023-08-04 00:02:56 +02:00
..
cpu-param.h target/hppa: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
cpu-qom.h
cpu.c target/hppa: Replace tb_pc() with tb->pc 2023-03-01 07:33:21 -10:00
cpu.h target/hppa: Move iaoq registers and thus reduce generated code size 2023-08-04 00:02:56 +02:00
fpu_helper.c
gdbstub.c gdbstub: move register helpers into standalone include 2023-03-07 20:44:08 +00:00
helper.c
helper.h
insns.decode
int_helper.c other architectures: spelling fixes 2023-07-25 17:14:07 +03:00
Kconfig
machine.c
mem_helper.c
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
op_helper.c accel/tcg: Return bool from page_check_range 2023-07-15 08:02:32 +01:00
sys_helper.c
trace-events
trace.h
translate.c other architectures: spelling fixes 2023-07-25 17:14:07 +03:00