[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/10] target/hexagon: expose next PC in DisasContext
From: |
Alessandro Di Federico |
Subject: |
[PATCH v2 05/10] target/hexagon: expose next PC in DisasContext |
Date: |
Thu, 25 Feb 2021 16:18:51 +0100 |
From: Paolo Montesel <babush@rev.ng>
Signed-off-by: Alessandro Di Federico <ale@rev.ng>
Signed-off-by: Paolo Montesel <babush@rev.ng>
---
target/hexagon/translate.c | 4 +++-
target/hexagon/translate.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index eeaad5f8ba..a59db485a3 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -503,11 +503,13 @@ 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;
+ ctx->npc = 0;
} else {
gen_exception(HEX_EXCP_INVALID_PACKET);
ctx->base.is_jmp = DISAS_NORETURN;
diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h
index 938f7fbb9f..2195e20f4b 100644
--- a/target/hexagon/translate.h
+++ b/target/hexagon/translate.h
@@ -36,6 +36,7 @@ typedef struct DisasContext {
int preg_log_idx;
uint8_t store_width[STORES_MAX];
uint8_t s1_store_processed;
+ uint32_t npc;
} DisasContext;
static inline void ctx_log_reg_write(DisasContext *ctx, int rnum)
--
2.30.1
- [PATCH v2 00/10] target/hexagon: introduce idef-parser, Alessandro Di Federico, 2021/02/25
- [PATCH v2 03/10] target/hexagon: make helper functions non-static, Alessandro Di Federico, 2021/02/25
- [PATCH v2 05/10] target/hexagon: expose next PC in DisasContext,
Alessandro Di Federico <=
- [PATCH v2 01/10] target/hexagon: update MAINTAINERS for idef-parser, Alessandro Di Federico, 2021/02/25
- [PATCH v2 06/10] target/hexagon: prepare input for the idef-parser, Alessandro Di Federico, 2021/02/25
- [PATCH v2 02/10] target/hexagon: import README for idef-parser, Alessandro Di Federico, 2021/02/25
- [PATCH v2 04/10] target/hexagon: introduce new helper functions, Alessandro Di Federico, 2021/02/25
- [PATCH v2 07/10] target/hexagon: import lexer for idef-parser, Alessandro Di Federico, 2021/02/25