[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 06/12] target/hexagon: expose next PC in DisasContext
From: |
Alessandro Di Federico |
Subject: |
[PATCH v6 06/12] target/hexagon: expose next PC in DisasContext |
Date: |
Tue, 20 Jul 2021 14:30:25 +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.h | 1 +
target/hexagon/translate.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h
index 703fd1345f..d5a7fece31 100644
--- a/target/hexagon/translate.h
+++ b/target/hexagon/translate.h
@@ -37,6 +37,7 @@ typedef struct DisasContext {
DECLARE_BITMAP(pregs_written, NUM_PREGS);
uint8_t store_width[STORES_MAX];
bool s1_store_processed;
+ uint32_t npc;
} DisasContext;
static inline void ctx_log_reg_write(DisasContext *ctx, int rnum)
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index b23d36adf5..63cdf9b90d 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -509,11 +509,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(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);
}
--
2.32.0
- [PATCH v6 00/12] target/hexagon: introduce idef-parser, Alessandro Di Federico, 2021/07/20
- [PATCH v6 01/12] target/hexagon: update MAINTAINERS for idef-parser, Alessandro Di Federico, 2021/07/20
- [PATCH v6 06/12] target/hexagon: expose next PC in DisasContext,
Alessandro Di Federico <=
- [PATCH v6 05/12] target/hexagon: introduce new helper functions, Alessandro Di Federico, 2021/07/20
- [PATCH v6 04/12] target/hexagon: make helper functions non-static, Alessandro Di Federico, 2021/07/20
- [PATCH v6 03/12] target/hexagon: make slot number an unsigned, Alessandro Di Federico, 2021/07/20
- [PATCH v6 07/12] target/hexagon: prepare input for the idef-parser, Alessandro Di Federico, 2021/07/20
- [PATCH v6 02/12] target/hexagon: import README for idef-parser, Alessandro Di Federico, 2021/07/20
- [PATCH v6 08/12] target/hexagon: import lexer for idef-parser, Alessandro Di Federico, 2021/07/20
- [PATCH v6 09/12] target/hexagon: import parser for idef-parser, Alessandro Di Federico, 2021/07/20
- [PATCH v6 12/12] gitlab-ci: do not use qemu-project Docker registry, Alessandro Di Federico, 2021/07/20
- [PATCH v6 11/12] target/hexagon: import additional tests, Alessandro Di Federico, 2021/07/20
- [PATCH v6 10/12] target/hexagon: call idef-parser functions, Alessandro Di Federico, 2021/07/20