qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 17/26] tcg-aarch64: Use ADR to pass the return a


From: Claudio Fontana
Subject: Re: [Qemu-devel] [PATCH 17/26] tcg-aarch64: Use ADR to pass the return address to the ld/st helpers
Date: Wed, 26 Mar 2014 10:38:11 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1

On 15.03.2014 03:48, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  tcg/aarch64/tcg-target.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tcg/aarch64/tcg-target.c b/tcg/aarch64/tcg-target.c
> index 3b8aa7d..26dc1ab 100644
> --- a/tcg/aarch64/tcg-target.c
> +++ b/tcg/aarch64/tcg-target.c
> @@ -1061,6 +1061,13 @@ static const void * const qemu_st_helpers[4] = {
>      helper_ret_stq_mmu,
>  };
>  
> +static inline void tcg_out_adr(TCGContext *s, TCGReg rd, uintptr_t addr)
> +{
> +    addr -= (uintptr_t)s->code_ptr;
> +    assert(addr == sextract64(addr, 0, 21));
> +    tcg_out_insn(s, 3406, ADR, rd, addr);
> +}
> +
>  static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *lb)
>  {
>      TCGMemOp opc = lb->opc;
> @@ -1071,7 +1078,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, 
> TCGLabelQemuLdst *lb)
>      tcg_out_movr(s, TCG_TYPE_I64, TCG_REG_X0, TCG_AREG0);
>      tcg_out_movr(s, TARGET_LONG_BITS == 64, TCG_REG_X1, lb->addrlo_reg);
>      tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_X2, lb->mem_index);
> -    tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_X3, (intptr_t)lb->raddr);
> +    tcg_out_adr(s, TCG_REG_X3, (intptr_t)lb->raddr);
>      tcg_out_call(s, (intptr_t)qemu_ld_helpers[size]);
>      if (opc & MO_SIGN) {
>          tcg_out_sxt(s, TCG_TYPE_I64, size, lb->datalo_reg, TCG_REG_X0);
> @@ -1092,7 +1099,7 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s, 
> TCGLabelQemuLdst *lb)
>      tcg_out_movr(s, TARGET_LONG_BITS == 64, TCG_REG_X1, lb->addrlo_reg);
>      tcg_out_movr(s, size == MO_64, TCG_REG_X2, lb->datalo_reg);
>      tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_X3, lb->mem_index);
> -    tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_X4, (intptr_t)lb->raddr);
> +    tcg_out_adr(s, TCG_REG_X4, (intptr_t)lb->raddr);
>      tcg_out_call(s, (intptr_t)qemu_st_helpers[size]);
>      tcg_out_goto(s, (intptr_t)lb->raddr);
>  }
> 
Reviewed-by: Claudio Fontana <address@hidden>




reply via email to

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