All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: <qemu-devel@nongnu.org>, <edgar.iglesias@gmail.com>, <philmd@linaro.org>
Subject: Re: [PATCH v2 06/10] target/microblaze: Use TCGv_i64 for compute_ldst_addr_ea
Date: Sun, 25 May 2025 21:35:26 +0200	[thread overview]
Message-ID: <aDNw_uoL1BDVpM_Z@zapote> (raw)
In-Reply-To: <20250525160220.222154-7-richard.henderson@linaro.org>

On Sun, May 25, 2025 at 05:02:16PM +0100, Richard Henderson wrote:
> Use an explicit 64-bit type for extended addresses.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>


> ---
>  target/microblaze/translate.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
> index b1fc9e5624..dc597b36e6 100644
> --- a/target/microblaze/translate.c
> +++ b/target/microblaze/translate.c
> @@ -660,23 +660,23 @@ static TCGv compute_ldst_addr_typeb(DisasContext *dc, int ra, int imm)
>  }
>  
>  #ifndef CONFIG_USER_ONLY
> -static TCGv compute_ldst_addr_ea(DisasContext *dc, int ra, int rb)
> +static TCGv_i64 compute_ldst_addr_ea(DisasContext *dc, int ra, int rb)
>  {
>      int addr_size = dc->cfg->addr_size;
> -    TCGv ret = tcg_temp_new();
> +    TCGv_i64 ret = tcg_temp_new_i64();
>  
>      if (addr_size == 32 || ra == 0) {
>          if (rb) {
> -            tcg_gen_extu_i32_tl(ret, cpu_R[rb]);
> +            tcg_gen_extu_i32_i64(ret, cpu_R[rb]);
>          } else {
> -            tcg_gen_movi_tl(ret, 0);
> +            return tcg_constant_i64(0);
>          }
>      } else {
>          if (rb) {
>              tcg_gen_concat_i32_i64(ret, cpu_R[rb], cpu_R[ra]);
>          } else {
> -            tcg_gen_extu_i32_tl(ret, cpu_R[ra]);
> -            tcg_gen_shli_tl(ret, ret, 32);
> +            tcg_gen_extu_i32_i64(ret, cpu_R[ra]);
> +            tcg_gen_shli_i64(ret, ret, 32);
>          }
>          if (addr_size < 64) {
>              /* Mask off out of range bits.  */
> @@ -781,7 +781,7 @@ static bool trans_lbuea(DisasContext *dc, arg_typea *arg)
>  #ifdef CONFIG_USER_ONLY
>      g_assert_not_reached();
>  #else
> -    TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
> +    TCGv_i64 addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
>      gen_helper_lbuea(reg_for_write(dc, arg->rd), tcg_env, addr);
>      return true;
>  #endif
> @@ -813,7 +813,7 @@ static bool trans_lhuea(DisasContext *dc, arg_typea *arg)
>  #ifdef CONFIG_USER_ONLY
>      g_assert_not_reached();
>  #else
> -    TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
> +    TCGv_i64 addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
>      gen_alignment_check_ea(dc, addr, arg->rb, arg->rd, MO_16, false);
>      (mo_endian(dc) == MO_BE ? gen_helper_lhuea_be : gen_helper_lhuea_le)
>          (reg_for_write(dc, arg->rd), tcg_env, addr);
> @@ -847,7 +847,7 @@ static bool trans_lwea(DisasContext *dc, arg_typea *arg)
>  #ifdef CONFIG_USER_ONLY
>      g_assert_not_reached();
>  #else
> -    TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
> +    TCGv_i64 addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
>      gen_alignment_check_ea(dc, addr, arg->rb, arg->rd, MO_32, false);
>      (mo_endian(dc) == MO_BE ? gen_helper_lwea_be : gen_helper_lwea_le)
>          (reg_for_write(dc, arg->rd), tcg_env, addr);
> @@ -941,7 +941,7 @@ static bool trans_sbea(DisasContext *dc, arg_typea *arg)
>  #ifdef CONFIG_USER_ONLY
>      g_assert_not_reached();
>  #else
> -    TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
> +    TCGv_i64 addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
>      gen_helper_sbea(tcg_env, reg_for_read(dc, arg->rd), addr);
>      return true;
>  #endif
> @@ -973,7 +973,7 @@ static bool trans_shea(DisasContext *dc, arg_typea *arg)
>  #ifdef CONFIG_USER_ONLY
>      g_assert_not_reached();
>  #else
> -    TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
> +    TCGv_i64 addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
>      gen_alignment_check_ea(dc, addr, arg->rb, arg->rd, MO_16, true);
>      (mo_endian(dc) == MO_BE ? gen_helper_shea_be : gen_helper_shea_le)
>          (tcg_env, reg_for_read(dc, arg->rd), addr);
> @@ -1007,7 +1007,7 @@ static bool trans_swea(DisasContext *dc, arg_typea *arg)
>  #ifdef CONFIG_USER_ONLY
>      g_assert_not_reached();
>  #else
> -    TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
> +    TCGv_i64 addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb);
>      gen_alignment_check_ea(dc, addr, arg->rb, arg->rd, MO_32, true);
>      (mo_endian(dc) == MO_BE ? gen_helper_swea_be : gen_helper_swea_le)
>          (tcg_env, reg_for_read(dc, arg->rd), addr);
> -- 
> 2.43.0
> 


  reply	other threads:[~2025-05-25 19:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-25 16:02 [PATCH v2 00/10] target/microblaze: Always use TARGET_LONG_BITS == 32 Richard Henderson
2025-05-25 16:02 ` [PATCH v2 01/10] target/microblaze: Split out mb_unaligned_access_internal Richard Henderson
2025-05-25 19:26   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 02/10] target/microblaze: Introduce helper_unaligned_access Richard Henderson
2025-05-25 19:27   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 03/10] target/microblaze: Split out mb_transaction_failed_internal Richard Henderson
2025-05-25 19:29   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 04/10] target/microblaze: Implement extended address load/store out of line Richard Henderson
2025-05-25 19:33   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 05/10] target/microblaze: Use uint64_t for CPUMBState.ear Richard Henderson
2025-05-25 19:34   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 06/10] target/microblaze: Use TCGv_i64 for compute_ldst_addr_ea Richard Henderson
2025-05-25 19:35   ` Edgar E. Iglesias [this message]
2025-05-25 16:02 ` [PATCH v2 07/10] target/microblaze: Fix printf format in mmu_translate Richard Henderson
2025-05-25 19:36   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 08/10] target/microblaze: Use TARGET_LONG_BITS == 32 for system mode Richard Henderson
2025-05-25 19:36   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 09/10] target/microblaze: Drop DisasContext.r0 Richard Henderson
2025-05-25 19:38   ` Edgar E. Iglesias
2025-05-25 16:02 ` [PATCH v2 10/10] target/microblaze: Simplify compute_ldst_addr_type{a, b} Richard Henderson
2025-05-25 19:40   ` [PATCH v2 10/10] target/microblaze: Simplify compute_ldst_addr_type{a,b} Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aDNw_uoL1BDVpM_Z@zapote \
    --to=edgar.iglesias@amd.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.