[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 10/11] target/ppc: implement address swizzle for gen_conditio
From: |
Mark Cave-Ayland |
Subject: |
[RFC PATCH 10/11] target/ppc: implement address swizzle for gen_conditional_store() |
Date: |
Thu, 12 Dec 2024 15:14:11 +0000 |
The gen_conditional_store() function uses tcg_gen_atomic_cmpxchg_tl() within its
implementation. Update gen_conditional_store() so that it implements the address
swizzle if required.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
target/ppc/translate.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index fc44e3293a..e8ae96cd46 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3345,9 +3345,18 @@ static void gen_conditional_store(DisasContext *ctx,
MemOp memop)
tcg_gen_brcond_tl(TCG_COND_NE, EA, cpu_reserve, lfail);
tcg_gen_brcondi_tl(TCG_COND_NE, cpu_reserve_length, memop_size(memop),
lfail);
- tcg_gen_atomic_cmpxchg_tl(t0, cpu_reserve, cpu_reserve_val,
- cpu_gpr[rs], ctx->mem_idx,
- DEF_MEMOP(memop) | MO_ALIGN);
+ if (!need_addrswizzle_le(ctx)) {
+ tcg_gen_atomic_cmpxchg_tl(t0, cpu_reserve, cpu_reserve_val,
+ cpu_gpr[rs], ctx->mem_idx,
+ DEF_MEMOP(memop) | MO_ALIGN);
+ } else {
+ TCGv ta = tcg_temp_new();
+
+ gen_addr_swizzle_le(ta, cpu_reserve, memop);
+ tcg_gen_atomic_cmpxchg_tl(t0, ta, cpu_reserve_val,
+ cpu_gpr[rs], ctx->mem_idx,
+ DEF_MEMOP(memop) | MO_ALIGN);
+ }
tcg_gen_setcond_tl(TCG_COND_EQ, t0, t0, cpu_reserve_val);
tcg_gen_shli_tl(t0, t0, CRF_EQ_BIT);
tcg_gen_or_tl(cr0, cr0, t0);
--
2.39.5
- Re: [RFC PATCH 04/11] target/ppc: replace tcg_gen_qemu_st_tl() with gen_st_tl(), (continued)
- [RFC PATCH 06/11] target/ppc: introduce gen_addr_swizzle_le() function, Mark Cave-Ayland, 2024/12/12
- [RFC PATCH 07/11] target/ppc: implement address swizzle for instruction translation, Mark Cave-Ayland, 2024/12/12
- [RFC PATCH 05/11] target/ppc: introduce need_addrswizzle_le() function, Mark Cave-Ayland, 2024/12/12
- [RFC PATCH 08/11] target/ppc: implement address swizzle for gen_ld_atomic(), Mark Cave-Ayland, 2024/12/12
- [RFC PATCH 11/11] target/ppc: update DisasContext default_tcg_memop_mask value, Mark Cave-Ayland, 2024/12/12
- [RFC PATCH 09/11] target/ppc: implement address swizzle for gen_st_atomic(), Mark Cave-Ayland, 2024/12/12
- [RFC PATCH 10/11] target/ppc: implement address swizzle for gen_conditional_store(),
Mark Cave-Ayland <=
- [RFC PATCH 02/11] target/ppc: replace tcg_gen_qemu_ld_tl() with gen_ld_tl(), Mark Cave-Ayland, 2024/12/12