[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 11/13] target/ppc: Use atomic min/max helpers
From: |
Richard Henderson |
Subject: |
[Qemu-ppc] [PATCH 11/13] target/ppc: Use atomic min/max helpers |
Date: |
Tue, 26 Jun 2018 09:19:19 -0700 |
These operations were previously unimplemented for ppc.
Signed-off-by: Richard Henderson <address@hidden>
---
target/ppc/translate.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 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 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 4: /* Fetch and max unsigned */
- case 5: /* Fetch and max signed */
- case 6: /* Fetch and min unsigned */
- case 7: /* Fetch and min signed */
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
- Re: [Qemu-ppc] [PATCH 01/13] target/ppc: Add do_unaligned_access hook, (continued)
[Qemu-ppc] [PATCH 05/13] target/ppc: Remove POWERPC_EXCP_STCX, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 06/13] target/ppc: Tidy gen_conditional_store, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 07/13] target/ppc: Split out gen_load_locked, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 09/13] target/ppc: Split out gen_st_atomic, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 08/13] target/ppc: Split out gen_ld_atomic, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 10/13] target/ppc: Use MO_ALIGN for EXIWX and ECOWX, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 12/13] target/ppc: Implement the rest of gen_ld_atomic, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 04/13] target/ppc: Use atomic cmpxchg for STQCX, Richard Henderson, 2018/06/26
[Qemu-ppc] [PATCH 11/13] target/ppc: Use atomic min/max helpers,
Richard Henderson <=
[Qemu-ppc] [PATCH 13/13] target/ppc: Implement the rest of gen_st_atomic, Richard Henderson, 2018/06/26
Re: [Qemu-ppc] [PATCH 00/13] target/ppc improve atomic operations, David Gibson, 2018/06/29