[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 21/35] target/ppc: Use atomic min/max helpers
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 21/35] target/ppc: Use atomic min/max helpers |
Date: |
Tue, 3 Jul 2018 15:57:50 +1000 |
From: Richard Henderson <address@hidden>
These operations were previously unimplemented for ppc.
Signed-off-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/translate.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index c2a28be6d7..79285b6698 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3102,13 +3102,21 @@ static void gen_ld_atomic(DisasContext *ctx, TCGMemOp
memop)
case 3: /* Fetch and 'and' */
tcg_gen_atomic_fetch_and_tl(dst, EA, src, ctx->mem_idx, memop);
break;
- case 8: /* Swap */
- tcg_gen_atomic_xchg_tl(dst, EA, src, ctx->mem_idx, memop);
- break;
case 4: /* Fetch and max unsigned */
+ tcg_gen_atomic_fetch_umax_tl(dst, EA, src, ctx->mem_idx, memop);
+ break;
case 5: /* Fetch and max signed */
+ tcg_gen_atomic_fetch_smax_tl(dst, EA, src, ctx->mem_idx, memop);
+ break;
case 6: /* Fetch and min unsigned */
+ tcg_gen_atomic_fetch_umin_tl(dst, EA, src, ctx->mem_idx, memop);
+ break;
case 7: /* Fetch and min signed */
+ tcg_gen_atomic_fetch_smin_tl(dst, EA, src, ctx->mem_idx, memop);
+ break;
+ case 8: /* Swap */
+ tcg_gen_atomic_xchg_tl(dst, EA, src, ctx->mem_idx, memop);
+ break;
case 16: /* compare and swap not equal */
case 24: /* Fetch and increment bounded */
case 25: /* Fetch and increment equal */
@@ -3159,9 +3167,17 @@ static void gen_st_atomic(DisasContext *ctx, TCGMemOp
memop)
tcg_gen_atomic_and_fetch_tl(discard, EA, src, ctx->mem_idx, memop);
break;
case 4: /* Store max unsigned */
+ tcg_gen_atomic_umax_fetch_tl(discard, EA, src, ctx->mem_idx, memop);
+ break;
case 5: /* Store max signed */
+ tcg_gen_atomic_smax_fetch_tl(discard, EA, src, ctx->mem_idx, memop);
+ break;
case 6: /* Store min unsigned */
+ tcg_gen_atomic_umin_fetch_tl(discard, EA, src, ctx->mem_idx, memop);
+ break;
case 7: /* Store min signed */
+ tcg_gen_atomic_smin_fetch_tl(discard, EA, src, ctx->mem_idx, memop);
+ break;
case 24: /* Store twin */
gen_invalid(ctx);
break;
--
2.17.1
[Qemu-ppc] [PULL 23/35] target/ppc: Implement the rest of gen_st_atomic, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 08/35] ppc/xics: move the vmstate structures under the ics-base class, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 04/35] ppc/xics: introduce ICP DeviceRealize and DeviceReset handlers, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 05/35] ppc/xics: introduce a parent_realize in ICSStateClass, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 32/35] spapr: compute default value of "hpt-max-page-size" later, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 21/35] target/ppc: Use atomic min/max helpers,
David Gibson <=
[Qemu-ppc] [PULL 26/35] ppc4xx_i2c: Rewrite to model hardware more closely, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 14/35] target/ppc: Use atomic cmpxchg for STQCX, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 17/35] target/ppc: Split out gen_load_locked, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 13/35] target/ppc: Use atomic store for STQ, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 25/35] hw/ppc: Give sam46ex its own config option, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 18/35] target/ppc: Split out gen_ld_atomic, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 12/35] target/ppc: Use atomic load for LQ and LQARX, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 31/35] target/ppc/kvm: don't pass cpu to kvm_get_smmu_info(), David Gibson, 2018/07/03
[Qemu-ppc] [PULL 15/35] target/ppc: Remove POWERPC_EXCP_STCX, David Gibson, 2018/07/03
[Qemu-ppc] [PULL 29/35] ppc440_uc: Basic emulation of PPC440 DMA controller, David Gibson, 2018/07/03