simplify storing temporaries in env structure regardless of host/target long size
PATCH 1/1 simplify storing temporaries in env structure regardless of host/target long size
This patch separates decision about storing temporaries in env structure from target long size by introducing a macro QEMU_TEMPORARY_IN_ENV
Makes it a bit easier to work around register allocation problems. By default there is no change to generated code.
Signature · 2 lines
Kind regards, Igor V. Kovalenko
Index: target-i386/cpu.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-i386/cpu.h,v
retrieving revision 1.57
cpu.h +1 -1
@@ -467,7 +467,7 @@ typedef union {#define NB_MMU_MODES 2 typedef struct CPUX86State { -#if TARGET_LONG_BITS > HOST_LONG_BITS +#if defined(QEMU_TEMPORARY_IN_ENV) /* temporaries if we cannot store them in host registers */ target_ulong t0, t1, t2; #endif
Index: target-i386/exec.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-i386/exec.h,v
retrieving revision 1.41
exec.h +4 -0
@@ -33,6 +33,10 @@ register struct CPUX86State *env asm(AREG0);#if TARGET_LONG_BITS >HOST_LONG_BITS +#define QEMU_TEMPORARY_IN_ENV +#endif + +#if defined(QEMU_TEMPORARY_IN_ENV )/* no registers can be used */ #define T0 (env->t0)
Quoted 5 lines · Igor Kovalenko
This patch separates decision about storing temporaries in env structure from target long size by introducing a macro
QEMU_TEMPORARY_IN_ENV
Makes it a bit easier to work around register allocation problems. By default there is no change to generated code.
I'd move env->t0/t1/t2 to CPU_COMMON and the T0/T1/T2 logic to hostregs_helper.h.
Quoted 10 lines · Blue Swirl
Quoted 5 lines · Igor Kovalenko
This patch separates decision about storing temporaries in env structure from target long size by introducing a macro
QEMU_TEMPORARY_IN_ENV
Makes it a bit easier to work around register allocation problems. By default there is no change to generated code.I'd move env->t0/t1/t2 to
CPU_COMMONand the T0/T1/T2 logic tohostregs_helper.h.
I don't think the hostregs_helper.h is supposed to be used for that. It knows nothing about env.
Signature · 2 lines
Kind regards, Igor V. Kovalenko