[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v11 06/15] target/hexagon: expose next PC in DisasContext
From: |
Anton Johansson |
Subject: |
[PATCH v11 06/15] target/hexagon: expose next PC in DisasContext |
Date: |
Thu, 4 Aug 2022 13:55:39 +0200 |
From: Paolo Montesel <babush@rev.ng>
Signed-off-by: Alessandro Di Federico <ale@rev.ng>
Signed-off-by: Paolo Montesel <babush@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
---
target/hexagon/translate.c | 3 ++-
target/hexagon/translate.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index d4fc92f7e9..e3e250fd4f 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -741,11 +741,12 @@ static void decode_and_translate_packet(CPUHexagonState
*env, DisasContext *ctx)
if (decode_packet(nwords, words, &pkt, false) > 0) {
HEX_DEBUG_PRINT_PKT(&pkt);
gen_start_packet(ctx, &pkt);
+ ctx->npc = ctx->base.pc_next + pkt.encod_pkt_size_in_bytes;
for (i = 0; i < pkt.num_insns; i++) {
gen_insn(env, ctx, &pkt.insn[i], &pkt);
}
gen_commit_packet(env, ctx, &pkt);
- ctx->base.pc_next += pkt.encod_pkt_size_in_bytes;
+ ctx->base.pc_next = ctx->npc;
} else {
gen_exception_end_tb(ctx, HEX_EXCP_INVALID_PACKET);
}
diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h
index a245172827..494471548e 100644
--- a/target/hexagon/translate.h
+++ b/target/hexagon/translate.h
@@ -53,6 +53,7 @@ typedef struct DisasContext {
bool qreg_is_predicated[NUM_QREGS];
int qreg_log_idx;
bool pre_commit;
+ uint32_t npc;
} DisasContext;
static inline void ctx_log_reg_write(DisasContext *ctx, int rnum)
--
2.37.0
- [PATCH v11 00/15] target/hexagon: introduce idef-parser, Anton Johansson, 2022/08/04
- [PATCH v11 08/15] target/hexagon: add flex/bison/glib2 to qemu.yml, Anton Johansson, 2022/08/04
- [PATCH v11 04/15] target/hexagon: make helper functions non-static, Anton Johansson, 2022/08/04
- [PATCH v11 01/15] target/hexagon: update MAINTAINERS for idef-parser, Anton Johansson, 2022/08/04
- [PATCH v11 02/15] target/hexagon: import README for idef-parser, Anton Johansson, 2022/08/04
- [PATCH v11 05/15] target/hexagon: introduce new helper functions, Anton Johansson, 2022/08/04
- [PATCH v11 03/15] target/hexagon: make slot number an unsigned, Anton Johansson, 2022/08/04
- [PATCH v11 11/15] target/hexagon: import lexer for idef-parser, Anton Johansson, 2022/08/04
- [PATCH v11 09/15] target/hexagon: regenerate docker/cirrus files, Anton Johansson, 2022/08/04
- [PATCH v11 06/15] target/hexagon: expose next PC in DisasContext,
Anton Johansson <=
- [PATCH v11 07/15] target/hexagon: prepare input for the idef-parser, Anton Johansson, 2022/08/04
- [PATCH v11 10/15] target/hexagon: manually add flex/bison/glib2 to remaining containers, Anton Johansson, 2022/08/04
- [PATCH v11 12/15] target/hexagon: prepare frontend for parser, Anton Johansson, 2022/08/04
- [PATCH v11 14/15] target/hexagon: call idef-parser functions, Anton Johansson, 2022/08/04
- [PATCH v11 15/15] target/hexagon: import additional tests, Anton Johansson, 2022/08/04
- [PATCH v11 13/15] target/hexagon: import parser for idef-parser, Anton Johansson, 2022/08/04