From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 24/75] target/microblaze: Have compute_ldst_addr_type[ab] return TCGv_i32
Date: Thu, 16 Oct 2025 14:14:40 +0200 [thread overview]
Message-ID: <20251016121532.14042-25-philmd@linaro.org> (raw)
In-Reply-To: <20251016121532.14042-1-philmd@linaro.org>
Both compute_ldst_addr_typea() and compute_ldst_addr_typeb()
bodies use a TCGv_i32, so return the same type.
Suggested-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20251015180115.97493-6-philmd@linaro.org>
---
target/microblaze/translate.c | 48 +++++++++++++++++------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 994e1d5cef0..1554b9e67b0 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -604,7 +604,7 @@ static bool trans_wdic(DisasContext *dc, arg_wdic *a)
DO_TYPEA(xor, false, tcg_gen_xor_i32)
DO_TYPEBI(xori, false, tcg_gen_xori_i32)
-static TCGv compute_ldst_addr_typea(DisasContext *dc, int ra, int rb)
+static TCGv_i32 compute_ldst_addr_typea(DisasContext *dc, int ra, int rb)
{
TCGv_i32 ret;
@@ -626,7 +626,7 @@ static TCGv compute_ldst_addr_typea(DisasContext *dc, int ra, int rb)
return ret;
}
-static TCGv compute_ldst_addr_typeb(DisasContext *dc, int ra, int imm)
+static TCGv_i32 compute_ldst_addr_typeb(DisasContext *dc, int ra, int imm)
{
TCGv_i32 ret;
@@ -750,13 +750,13 @@ static bool do_load(DisasContext *dc, int rd, TCGv addr, MemOp mop,
static bool trans_lbu(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_load(dc, arg->rd, addr, MO_UB, dc->mem_index, false);
}
static bool trans_lbur(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_load(dc, arg->rd, addr, MO_UB, dc->mem_index, true);
}
@@ -776,19 +776,19 @@ static bool trans_lbuea(DisasContext *dc, arg_typea *arg)
static bool trans_lbui(DisasContext *dc, arg_typeb *arg)
{
- TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
+ TCGv_i32 addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
return do_load(dc, arg->rd, addr, MO_UB, dc->mem_index, false);
}
static bool trans_lhu(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_load(dc, arg->rd, addr, MO_UW, dc->mem_index, false);
}
static bool trans_lhur(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_load(dc, arg->rd, addr, MO_UW, dc->mem_index, true);
}
@@ -810,19 +810,19 @@ static bool trans_lhuea(DisasContext *dc, arg_typea *arg)
static bool trans_lhui(DisasContext *dc, arg_typeb *arg)
{
- TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
+ TCGv_i32 addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
return do_load(dc, arg->rd, addr, MO_UW, dc->mem_index, false);
}
static bool trans_lw(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_load(dc, arg->rd, addr, MO_UL, dc->mem_index, false);
}
static bool trans_lwr(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_load(dc, arg->rd, addr, MO_UL, dc->mem_index, true);
}
@@ -844,16 +844,16 @@ static bool trans_lwea(DisasContext *dc, arg_typea *arg)
static bool trans_lwi(DisasContext *dc, arg_typeb *arg)
{
- TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
+ TCGv_i32 addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
return do_load(dc, arg->rd, addr, MO_UL, dc->mem_index, false);
}
static bool trans_lwx(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
/* lwx does not throw unaligned access errors, so force alignment */
- tcg_gen_andi_tl(addr, addr, ~3);
+ tcg_gen_andi_i32(addr, addr, ~3);
tcg_gen_qemu_ld_i32(cpu_res_val, addr, dc->mem_index,
mo_endian(dc) | MO_UL);
@@ -910,13 +910,13 @@ static bool do_store(DisasContext *dc, int rd, TCGv addr, MemOp mop,
static bool trans_sb(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_store(dc, arg->rd, addr, MO_UB, dc->mem_index, false);
}
static bool trans_sbr(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_store(dc, arg->rd, addr, MO_UB, dc->mem_index, true);
}
@@ -936,19 +936,19 @@ static bool trans_sbea(DisasContext *dc, arg_typea *arg)
static bool trans_sbi(DisasContext *dc, arg_typeb *arg)
{
- TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
+ TCGv_i32 addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
return do_store(dc, arg->rd, addr, MO_UB, dc->mem_index, false);
}
static bool trans_sh(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_store(dc, arg->rd, addr, MO_UW, dc->mem_index, false);
}
static bool trans_shr(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_store(dc, arg->rd, addr, MO_UW, dc->mem_index, true);
}
@@ -970,19 +970,19 @@ static bool trans_shea(DisasContext *dc, arg_typea *arg)
static bool trans_shi(DisasContext *dc, arg_typeb *arg)
{
- TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
+ TCGv_i32 addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
return do_store(dc, arg->rd, addr, MO_UW, dc->mem_index, false);
}
static bool trans_sw(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_store(dc, arg->rd, addr, MO_UL, dc->mem_index, false);
}
static bool trans_swr(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
return do_store(dc, arg->rd, addr, MO_UL, dc->mem_index, true);
}
@@ -1004,19 +1004,19 @@ static bool trans_swea(DisasContext *dc, arg_typea *arg)
static bool trans_swi(DisasContext *dc, arg_typeb *arg)
{
- TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
+ TCGv_i32 addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm);
return do_store(dc, arg->rd, addr, MO_UL, dc->mem_index, false);
}
static bool trans_swx(DisasContext *dc, arg_typea *arg)
{
- TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
+ TCGv_i32 addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb);
TCGLabel *swx_done = gen_new_label();
TCGLabel *swx_fail = gen_new_label();
TCGv_i32 tval;
/* swx does not throw unaligned access errors, so force alignment */
- tcg_gen_andi_tl(addr, addr, ~3);
+ tcg_gen_andi_i32(addr, addr, ~3);
/*
* Compare the address vs the one we used during lwx.
--
2.51.0
next prev parent reply other threads:[~2025-10-16 12:21 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 12:14 [PULL 00/75] Misc single binary patches for 2025-10-16 Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 01/75] accel/tcg: Name gen_goto_tb()'s TB slot index as @tb_slot_idx Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 02/75] target/alpha: Access CPUState::cpu_index via helper Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 03/75] target/alpha: Replace VMSTATE_UINTTL() -> VMSTATE_UINT64() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 04/75] target/hppa: Use hwaddr type for HPPATLBEntry::pa Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 05/75] target/hppa: Have hppa_form_gva*() return vaddr type Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 06/75] target/hppa: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 07/75] target/hppa: Conceal MO_TE within do_load() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 08/75] target/hppa: Conceal MO_TE within do_load_32/64() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 09/75] target/hppa: Conceal MO_TE within do_store() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 10/75] target/hppa: Conceal MO_TE within do_store_32/64() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 11/75] target/hppa: Introduce mo_endian() helper Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 12/75] target/hppa: Replace MO_TE -> MO_BE Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 13/75] target/hppa: correct size bit parity for fmpyadd Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 14/75] target/loongarch: Replace VMSTATE_UINTTL() -> VMSTATE_UINT64() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 15/75] target/loongarch: Remove target_ulong use in gen_goto_tb() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 16/75] target/loongarch: Remove target_ulong use in gdb_write_register handler Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 17/75] target/loongarch: Do not use target_ulong type for LDDIR level Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 18/75] target/m68k: Remove unused @cpu_exception_index TCGv Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 19/75] target/m68k: Remove pointless @cpu_halted TCGv Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 20/75] target/microblaze: Remove target_ulong use in cpu_handle_mmu_fault() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 21/75] target/microblaze: Remove target_ulong uses in get_phys_page_attrs_debug Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 22/75] target/microblaze: Remove target_ulong use in gen_goto_tb() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 23/75] target/microblaze: Remove target_ulong use in helper_stackprot() Philippe Mathieu-Daudé
2025-10-16 12:14 ` Philippe Mathieu-Daudé [this message]
2025-10-16 12:14 ` [PULL 25/75] target/microblaze: Have do_load/store() take a TCGv_i32 address argument Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 26/75] target/microblaze: Convert CPUMBState::res_addr field to uint32_t type Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 27/75] target/openrisc: Replace VMSTATE_UINTTL() -> VMSTATE_UINT32() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 28/75] target/openrisc: Do not use target_ulong for @mr in MTSPR helper Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 29/75] target/openrisc: Remove unused cpu_openrisc_map_address_*() handlers Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 30/75] target/openrisc: Remove target_ulong use in raise_mmu_exception() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 31/75] target/openrisc: Use vaddr type for $pc jumps Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 32/75] target/openrisc: Remove 'TARGET_LONG_BITS != 32' dead code Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 33/75] target/openrisc: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 34/75] target/openrisc: Conceal MO_TE within do_load() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 35/75] target/openrisc: Conceal MO_TE within do_store() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 36/75] target/openrisc: Introduce mo_endian() helper Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 37/75] target/openrisc: Replace MO_TE -> MO_BE Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 38/75] target/openrisc: Inline tcg_gen_trunc_i64_tl() Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 39/75] target/openrisc: Replace target_ulong -> uint32_t Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 40/75] target/riscv: Use 32 bits for misa extensions Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 41/75] target/riscv: Replace HOST_BIG_ENDIAN #ifdef with if() check Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 42/75] target/rx: Replace target_ulong -> vaddr for translator API uses Philippe Mathieu-Daudé
2025-10-16 12:14 ` [PULL 43/75] target/rx: Use MemOp type in gen_ld[u]() and gen_st() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 44/75] target/rx: Propagate DisasContext to generated helpers Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 45/75] target/rx: Propagate DisasContext to push() / pop() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 46/75] target/rx: Propagate DisasContext to gen_ld[u]() and gen_st() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 47/75] target/rx: Factor mo_endian() helper out Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 48/75] target/rx: Replace MO_TE -> MO_LE Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 49/75] target/rx: Expand TCG register definitions for 32-bit target Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 50/75] target/rx: Un-inline various helpers Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 51/75] target/s390x: Replace HOST_BIG_ENDIAN #ifdef with if() check Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 52/75] target/sh4: Convert CPUSH4State::sr register to uint32_t type Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 53/75] target/sh4: Remove target_ulong use in cpu_sh4_is_cached() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 54/75] target/sh4: Use hwaddr type for hardware addresses Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 55/75] target/sh4: Remove target_ulong uses in superh_cpu_get_phys_page_debug Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 56/75] target/sh4: Use vaddr type for TLB virtual addresses Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 57/75] target/sh4: Remove target_ulong use in gen_goto_tb() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 58/75] target/sparc: Reduce inclusions of 'exec/cpu-common.h' Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 59/75] target/tricore: Remove target_ulong use in gen_goto_tb() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 60/75] target/tricore: Replace target_ulong -> vaddr with tlb_fill() callees Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 61/75] target/tricore: Remove target_ulong use in translate_insn() handler Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 62/75] target/tricore: Remove target_ulong use in gen_addi_d() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 63/75] target/tricore: Remove unnecessary cast to target_ulong Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 64/75] target/tricore: Replace target_ulong -> uint32_t in op_helper.c Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 65/75] target/tricore: Declare registers as TCGv_i32 Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 66/75] target/tricore: Inline tcg_gen_ld32u_tl() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 67/75] target/tricore: Expand TCG helpers for 32-bit target Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 68/75] target/tricore: Pass DisasContext as first argument Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 69/75] target/tricore: Un-inline various helpers Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 70/75] target/tricore: Expand TCGv type for 32-bit target Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 71/75] target/xtensa: Replace legacy cpu_physical_memory_[un]map() calls Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 72/75] target/xtensa: Remove target_ulong use in xtensa_tr_translate_insn() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 73/75] target/xtensa: Remove target_ulong use in xtensa_get_tb_cpu_state() Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 74/75] linux-user/microblaze: Fix little-endianness binary Philippe Mathieu-Daudé
2025-10-16 12:15 ` [PULL 75/75] mailmap: Unify Clément Mathieu--Drif emails Philippe Mathieu-Daudé
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=20251016121532.14042-25-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).