[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 06/11] target/riscv: Move gen_amo before implement Zabha
From: |
LIU Zhiwei |
Subject: |
[PATCH v4 06/11] target/riscv: Move gen_amo before implement Zabha |
Date: |
Tue, 9 Jul 2024 19:36:47 +0800 |
Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/insn_trans/trans_rva.c.inc | 21 ---------------------
target/riscv/translate.c | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/target/riscv/insn_trans/trans_rva.c.inc
b/target/riscv/insn_trans/trans_rva.c.inc
index eb080baddd..39bbf60f3c 100644
--- a/target/riscv/insn_trans/trans_rva.c.inc
+++ b/target/riscv/insn_trans/trans_rva.c.inc
@@ -96,27 +96,6 @@ static bool gen_sc(DisasContext *ctx, arg_atomic *a, MemOp
mop)
return true;
}
-static bool gen_amo(DisasContext *ctx, arg_atomic *a,
- void(*func)(TCGv, TCGv, TCGv, TCGArg, MemOp),
- MemOp mop)
-{
- TCGv dest = dest_gpr(ctx, a->rd);
- TCGv src1, src2 = get_gpr(ctx, a->rs2, EXT_NONE);
-
- if (ctx->cfg_ptr->ext_zama16b) {
- mop |= MO_ATOM_WITHIN16;
- } else {
- mop |= MO_ALIGN;
- }
-
- decode_save_opc(ctx);
- src1 = get_address(ctx, a->rs1, 0);
- func(dest, src1, src2, ctx->mem_idx, mop);
-
- gen_set_gpr(ctx, a->rd, dest);
- return true;
-}
-
static bool trans_lr_w(DisasContext *ctx, arg_lr_w *a)
{
REQUIRE_A_OR_ZALRSC(ctx);
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index 8a546f4ece..133550d6e2 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -1077,6 +1077,27 @@ static bool gen_unary_per_ol(DisasContext *ctx, arg_r2
*a, DisasExtend ext,
return gen_unary(ctx, a, ext, f_tl);
}
+static bool gen_amo(DisasContext *ctx, arg_atomic *a,
+ void(*func)(TCGv, TCGv, TCGv, TCGArg, MemOp),
+ MemOp mop)
+{
+ TCGv dest = dest_gpr(ctx, a->rd);
+ TCGv src1, src2 = get_gpr(ctx, a->rs2, EXT_NONE);
+
+ if (ctx->cfg_ptr->ext_zama16b) {
+ mop |= MO_ATOM_WITHIN16;
+ } else {
+ mop |= MO_ALIGN;
+ }
+
+ decode_save_opc(ctx);
+ src1 = get_address(ctx, a->rs1, 0);
+ func(dest, src1, src2, ctx->mem_idx, mop);
+
+ gen_set_gpr(ctx, a->rd, dest);
+ return true;
+}
+
static uint32_t opcode_at(DisasContextBase *dcbase, target_ulong pc)
{
DisasContext *ctx = container_of(dcbase, DisasContext, base);
--
2.25.1
- [PATCH v4 00/11] target/riscv: Support zimop/zcmop/zama16b/zabha, LIU Zhiwei, 2024/07/09
- [PATCH v4 01/11] target/riscv: Add zimop extension, LIU Zhiwei, 2024/07/09
- [PATCH v4 02/11] disas/riscv: Support zimop disassemble, LIU Zhiwei, 2024/07/09
- [PATCH v4 03/11] target/riscv: Add zcmop extension, LIU Zhiwei, 2024/07/09
- [PATCH v4 04/11] disas/riscv: Support zcmop disassemble, LIU Zhiwei, 2024/07/09
- [PATCH v4 05/11] target/riscv: Support Zama16b extension, LIU Zhiwei, 2024/07/09
- [PATCH v4 06/11] target/riscv: Move gen_amo before implement Zabha,
LIU Zhiwei <=
- [PATCH v4 07/11] target/riscv: Add AMO instructions for Zabha, LIU Zhiwei, 2024/07/09
- [PATCH v4 08/11] target/riscv: Move gen_cmpxchg before adding amocas.[b|h], LIU Zhiwei, 2024/07/09
- [PATCH v4 09/11] target/riscv: Add amocas.[b|h] for Zabha, LIU Zhiwei, 2024/07/09
- [PATCH v4 10/11] target/riscv: Expose zabha extension as a cpu property, LIU Zhiwei, 2024/07/09
- [PATCH v4 11/11] disas/riscv: Support zabha disassemble, LIU Zhiwei, 2024/07/09
- Re: [PATCH v4 00/11] target/riscv: Support zimop/zcmop/zama16b/zabha, Alistair Francis, 2024/07/09