qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 13/35] tcg-s390: Tidy regset initialization; use


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 13/35] tcg-s390: Tidy regset initialization; use R14 as temporary.
Date: Thu, 10 Jun 2010 12:26:19 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Jun 04, 2010 at 12:14:21PM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  tcg/s390/tcg-target.c |   26 ++++++++++++--------------
>  1 files changed, 12 insertions(+), 14 deletions(-)

This patch looks fine.

> diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
> index 2b80c02..95ea3c8 100644
> --- a/tcg/s390/tcg-target.c
> +++ b/tcg/s390/tcg-target.c
> @@ -41,7 +41,7 @@
>  #define TCG_REG_NONE    0
>  
>  /* A scratch register that may be be used throughout the backend.  */
> -#define TCG_TMP0        TCG_REG_R13
> +#define TCG_TMP0        TCG_REG_R14
>  
>  
>  /* All of the following instructions are prefixed with their instruction
> @@ -1185,24 +1185,22 @@ void tcg_target_init(TCGContext *s)
>  
>      tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff);
>      tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I64], 0, 0xffff);
> -    tcg_regset_set32(tcg_target_call_clobber_regs, 0,
> -                     (1 << TCG_REG_R0) |
> -                     (1 << TCG_REG_R1) |
> -                     (1 << TCG_REG_R2) |
> -                     (1 << TCG_REG_R3) |
> -                     (1 << TCG_REG_R4) |
> -                     (1 << TCG_REG_R5) |
> -                     (1 << TCG_REG_R14)); /* link register */
> +
> +    tcg_regset_clear(tcg_target_call_clobber_regs);
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R0);
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R1);
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R2);
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R3);
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R4);
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R5);
> +    /* The return register can be considered call-clobbered.  */
> +    tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R14);
>  
>      tcg_regset_clear(s->reserved_regs);
> -    /* frequently used as a temporary */
>      tcg_regset_set_reg(s->reserved_regs, TCG_TMP0);
> -    /* another temporary */
> -    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R12);
>      /* XXX many insns can't be used with R0, so we better avoid it for now */
>      tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);
> -    /* The stack pointer.  */
> -    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R15);
> +    tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
>  
>      tcg_add_target_add_op_defs(s390_op_defs);
>  }
> -- 
> 1.7.0.1
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]