[RFC PATCH 01/11] target/ppc: introduce gen_ld_tl() function

Mark Cave-Ayland posted 11 patches 5 months ago
Maintainers: Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>
[RFC PATCH 01/11] target/ppc: introduce gen_ld_tl() function
Posted by Mark Cave-Ayland 5 months ago
This function is intended to be used for all memory load operations. Convert the
GEN_QEMU_LOAD_TL() macro to use it as a starting point.

Signed-off-by: Mark Cave-Aykand <mark.cave-ayland@ilande.co.uk>
---
 target/ppc/translate.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 47ca50a064..5ddaf69599 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -2575,12 +2575,18 @@ static TCGv do_ea_calc_ra(DisasContext *ctx, int ra)
 #define DEF_MEMOP(op) ((op) | ctx->default_tcg_memop_mask)
 #define BSWAP_MEMOP(op) ((op) | (ctx->default_tcg_memop_mask ^ MO_BSWAP))
 
+static void gen_ld_tl(DisasContext *ctx, TCGv val, TCGv addr, TCGArg idx,
+                      MemOp memop)
+{
+    tcg_gen_qemu_ld_tl(val, addr, idx, memop);
+}
+
 #define GEN_QEMU_LOAD_TL(ldop, op)                                      \
 static void glue(gen_qemu_, ldop)(DisasContext *ctx,                    \
                                   TCGv val,                             \
                                   TCGv addr)                            \
 {                                                                       \
-    tcg_gen_qemu_ld_tl(val, addr, ctx->mem_idx, op);                    \
+    gen_ld_tl(ctx, val, addr, ctx->mem_idx, op);                        \
 }
 
 GEN_QEMU_LOAD_TL(ld8u,  DEF_MEMOP(MO_UB))
-- 
2.39.5
Re: [RFC PATCH 01/11] target/ppc: introduce gen_ld_tl() function
Posted by Richard Henderson 5 months ago
On 12/12/24 09:14, Mark Cave-Ayland wrote:
> This function is intended to be used for all memory load operations. Convert the
> GEN_QEMU_LOAD_TL() macro to use it as a starting point.
> 
> Signed-off-by: Mark Cave-Aykand<mark.cave-ayland@ilande.co.uk>
> ---
>   target/ppc/translate.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~