Only one call output register needed for 64 bit hosts
cover Only one call output register needed for 64 bit hosts
The number of registers needed for the return value of TCG opcode INDEX_op_call is calculated in function tcg_gen_callN (nb_rets).
It can be 0 or 1, for 32 bit hosts also 2 (return 64 bit value in two 32 bit registers).
Some TCG implementations reserve 2 registers although only 1 is used. The following patches fix this.
[PATCH 1/5] tcg/i386: Only one call output register needed for 64 bit hosts [PATCH 2/5] tcg/ia64: Only one call output register needed for 64 bit hosts [PATCH 3/5] tcg/s390: Only one call output register needed for 64 bit hosts [PATCH 4/5] tcg/sparc: Only one call output register needed for 64 bit hosts [PATCH 5/5] tcg/ppc64: Only one call output register needed for 64 bit hosts
PATCH 1/5 tcg/i386: Only one call output register needed for 64 bit hosts
The second register is only needed for 32 bit hosts.
--- tcg/i386/tcg-target.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
tcg/i386/tcg-target.c +3 -1
@@ -76,9 +76,11 @@ static const int tcg_target_call_iarg_regs[] = {#endif }; -static const int tcg_target_call_oarg_regs[2 ] = { +static const int tcg_target_call_oarg_regs[] = {TCG_REG_EAX , +#if TCG_TARGET_REG_BITS == 32 TCG_REG_EDX +#endif };static uint8_t *tb_ret_addr;
Signature · 1 line
1.7.0.4
PATCH 2/5 tcg/ia64: Only one call output register needed for 64 bit hosts
In reply to Stefan WeilThe second register is never used for ia64 hosts.
--- tcg/ia64/tcg-target.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
tcg/ia64/tcg-target.c +2 -3
@@ -172,9 +172,8 @@ static const int tcg_target_call_iarg_regs[8] = { TCG_REG_R63, }; -static const int tcg_target_call_oarg_regs[2 ] = { -TCG_REG_R8 , -TCG_REG_R9 +static const int tcg_target_call_oarg_regs[] = { +TCG_REG_R8 };/* maximum number of register used for input function arguments */
Signature · 1 line
1.7.0.4
PATCH 3/5 tcg/s390: Only one call output register needed for 64 bit hosts
In reply to Stefan WeilThe second register is only needed for 32 bit hosts.
--- tcg/s390/tcg-target.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
tcg/s390/tcg-target.c +3 -1
@@ -252,7 +252,9 @@ static const int tcg_target_call_iarg_regs[] = {static const int tcg_target_call_oarg_regs[] = {TCG_REG_R2 , -TCG_REG_R3 , +#if TCG_TARGET_REG_BITS == 32 + TCG_REG_R3 +#endif };#define S390_CC_EQ 8
Signature · 1 line
1.7.0.4
Re: [Qemu-devel] [PATCH 3/5] tcg/s390: Only one call output register needed for 64 bit hosts
Quoted 1 line · Stefan Weil
The second register is only needed for 32 bit hosts.
Looks sane to me. Richard, mind to ack?
Alex
Quoted 25 lines
Cc Alexander Graf <[email protected]>Signed-off-by Stefan Weil <[email protected]>---
tcg/s390/tcg-target.c| 4 +++-1 files changed, 3 insertions(+), 1 deletions(-)tcg/s390/tcg-target.c +3
-1@@ -252,7 +252,9 @@ static const int tcg_target_call_iarg_regs[] = {static const int tcg_target_call_oarg_regs[] = {TCG_REG_R2 , -TCG_REG_R3 , +#if TCG_TARGET_REG_BITS == 32 + TCG_REG_R3 +#endif };#define S390_CC_EQ 8Signature · 1 line
1.7.0.4
Richard Henderson
Acked-byRe: [Qemu-devel] [PATCH 3/5] tcg/s390: Only one call output register needed for 64 bit hosts
Quoted 13 lines · Alexander Graf
Quoted 1 line · Stefan Weil
The second register is only needed for 32 bit hosts.
Looks sane to me. Richard, mind to ack?
Alex
Quoted 3 lines
Cc Alexander Graf <[email protected]>Signed-off-by Stefan Weil <[email protected]>
r~
PATCH 4/5 tcg/sparc: Only one call output register needed for 64 bit hosts
In reply to Stefan WeilThe second register is only needed for 32 bit hosts.
--- tcg/sparc/tcg-target.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
tcg/sparc/tcg-target.c +4 -2
@@ -84,9 +84,11 @@ static const int tcg_target_call_iarg_regs[6] = { TCG_REG_O5, }; -static const int tcg_target_call_oarg_regs[2 ] = { +static const int tcg_target_call_oarg_regs[] = {TCG_REG_O0 , -TCG_REG_O1 , +#if TCG_TARGET_REG_BITS == 32 + TCG_REG_O1 +#endif };static inline int check_fit_tl (tcg_target_long val,unsigned int bits)
Signature · 1 line
1.7.0.4
PATCH 5/5 tcg/ppc64: Only one call output register needed for 64 bit hosts
In reply to Stefan WeilThe second register is only needed for 32 bit hosts.
--- tcg/ppc64/tcg-target.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tcg/ppc64/tcg-target.c +1 -1
@@ -130,7 +130,7 @@ static const int tcg_target_call_iarg_regs[] = { TCG_REG_R10 }; -static const int tcg_target_call_oarg_regs[2 ] = { +static const int tcg_target_call_oarg_regs[] = {TCG_REG_R3 };
Signature · 1 line
1.7.0.4
Re: [Qemu-devel] [PATCH 5/5] tcg/ppc64: Only one call output register needed for 64 bit hosts
Quoted 13 lines · Stefan Weil
The second register is only needed for 32 bit hosts.
Cc Vassili Karpov <[email protected]>Signed-off-by Stefan Weil <[email protected]>--- tcg/ppc64/tcg-target.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)tcg/ppc64/tcg-target.c +0
-0
tcg/ppc64/tcg-target.c static const int tcg_target_call_iarg_regs[] = { · line 136
Quoted 8 lines
tcg/ppc64/tcg-target.c +1
-1@@ -130,7 +130,7 @@ static const int tcg_target_call_iarg_regs[] = { TCG_REG_R10 }; -static const int tcg_target_call_oarg_regs[2 ] = { +static const int tcg_target_call_oarg_regs[] = {TCG_REG_R3 };
Fine with me.
Signature · 1 line
mailto:[email protected]
Am 05.09.2011 11:06, schrieb Stefan Weil:
Quoted 6 lines
The number of registers needed for the return value of TCG opcode
INDEX_op_callis calculated in functiontcg_gen_callN(nb_rets).It can be 0 or 1, for 32 bit hosts also 2 (return 64 bit value in two 32 bit registers).
Quoted 8 lines
Some TCG implementations reserve 2 registers although only 1 is used. The following patches fix this.
[PATCH 1/5] tcg/i386: Only one call output register needed for 64 bit hosts [PATCH 2/5] tcg/ia64: Only one call output register needed for 64 bit hosts [PATCH 3/5] tcg/s390: Only one call output register needed for 64 bit hosts [PATCH 4/5] tcg/sparc: Only one call output register needed for 64 bit hosts [PATCH 5/5] tcg/ppc64: Only one call output register needed for 64 bit hosts
Patch 3 was acked by Richard Henderson, so was patch 5 by Malc.
What about the other three patches (i386 / ia64, sparc)? They are all similar, so I think they could also be committed without more reviews.
Thanks,
Stefan Weil
Blue Swirl
AppliedThanks, applied all.
Quoted 32 lines · Stefan Weil
Am 05.09.2011 11:06, schrieb Stefan Weil:
Quoted 10 lines
The number of registers needed for the return value of TCG opcode
INDEX_op_callis calculated in functiontcg_gen_callN(nb_rets).It can be 0 or 1, for 32 bit hosts also 2 (return 64 bit value in two 32 bit registers).
Some TCG implementations reserve 2 registers although only 1 is used. The following patches fix this.
Quoted 10 lines
[PATCH 1/5] tcg/i386: Only one call output register needed for 64 bit hosts
[PATCH 2/5] tcg/ia64: Only one call output register needed for 64 bit hosts
[PATCH 3/5] tcg/s390: Only one call output register needed for 64 bit hosts
[PATCH 4/5] tcg/sparc: Only one call output register needed for 64 bit hosts
[PATCH 5/5] tcg/ppc64: Only one call output register needed for 64 bit hostsPatch 3 was acked by Richard Henderson, so was patch 5 by Malc.
What about the other three patches (i386 / ia64, sparc)? They are all similar,
so I think they could also be committed without more reviews.Thanks,
Stefan Weil