mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
Hexagon (target/hexagon) Move new_value to DisasContext
The new_value array in the CPUHexagonState is only used for bookkeeping within the translation of a packet. With recent changes that eliminate the need to free TCGv variables, these make more sense to be transient and kept in DisasContext. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230427230012.3800327-18-tsimpson@quicinc.com>
This commit is contained in:
parent
6aa4f1d15c
commit
4ff5676474
4 changed files with 9 additions and 14 deletions
|
@ -89,7 +89,6 @@ typedef struct CPUArchState {
|
||||||
target_ulong stack_start;
|
target_ulong stack_start;
|
||||||
|
|
||||||
uint8_t slot_cancelled;
|
uint8_t slot_cancelled;
|
||||||
target_ulong new_value[TOTAL_PER_THREAD_REGS];
|
|
||||||
target_ulong new_value_usr;
|
target_ulong new_value_usr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -74,7 +74,11 @@ TCGv get_result_gpr(DisasContext *ctx, int rnum)
|
||||||
if (rnum == HEX_REG_USR) {
|
if (rnum == HEX_REG_USR) {
|
||||||
return hex_new_value_usr;
|
return hex_new_value_usr;
|
||||||
} else {
|
} else {
|
||||||
return hex_new_value[rnum];
|
if (ctx->new_value[rnum] == NULL) {
|
||||||
|
ctx->new_value[rnum] = tcg_temp_new();
|
||||||
|
tcg_gen_movi_tl(ctx->new_value[rnum], 0);
|
||||||
|
}
|
||||||
|
return ctx->new_value[rnum];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return hex_gpr[rnum];
|
return hex_gpr[rnum];
|
||||||
|
|
|
@ -44,7 +44,6 @@ TCGv hex_pred[NUM_PREGS];
|
||||||
TCGv hex_this_PC;
|
TCGv hex_this_PC;
|
||||||
TCGv hex_slot_cancelled;
|
TCGv hex_slot_cancelled;
|
||||||
TCGv hex_branch_taken;
|
TCGv hex_branch_taken;
|
||||||
TCGv hex_new_value[TOTAL_PER_THREAD_REGS];
|
|
||||||
TCGv hex_new_value_usr;
|
TCGv hex_new_value_usr;
|
||||||
TCGv hex_reg_written[TOTAL_PER_THREAD_REGS];
|
TCGv hex_reg_written[TOTAL_PER_THREAD_REGS];
|
||||||
TCGv hex_new_pred_value[NUM_PREGS];
|
TCGv hex_new_pred_value[NUM_PREGS];
|
||||||
|
@ -513,6 +512,9 @@ static void gen_start_packet(DisasContext *ctx)
|
||||||
}
|
}
|
||||||
ctx->s1_store_processed = false;
|
ctx->s1_store_processed = false;
|
||||||
ctx->pre_commit = true;
|
ctx->pre_commit = true;
|
||||||
|
for (i = 0; i < TOTAL_PER_THREAD_REGS; i++) {
|
||||||
|
ctx->new_value[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
analyze_packet(ctx);
|
analyze_packet(ctx);
|
||||||
|
|
||||||
|
@ -1159,7 +1161,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int *max_insns,
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NAME_LEN 64
|
#define NAME_LEN 64
|
||||||
static char new_value_names[TOTAL_PER_THREAD_REGS][NAME_LEN];
|
|
||||||
static char reg_written_names[TOTAL_PER_THREAD_REGS][NAME_LEN];
|
static char reg_written_names[TOTAL_PER_THREAD_REGS][NAME_LEN];
|
||||||
static char new_pred_value_names[NUM_PREGS][NAME_LEN];
|
static char new_pred_value_names[NUM_PREGS][NAME_LEN];
|
||||||
static char store_addr_names[STORES_MAX][NAME_LEN];
|
static char store_addr_names[STORES_MAX][NAME_LEN];
|
||||||
|
@ -1181,15 +1182,6 @@ void hexagon_translate_init(void)
|
||||||
offsetof(CPUHexagonState, gpr[i]),
|
offsetof(CPUHexagonState, gpr[i]),
|
||||||
hexagon_regnames[i]);
|
hexagon_regnames[i]);
|
||||||
|
|
||||||
if (i == HEX_REG_USR) {
|
|
||||||
hex_new_value[i] = NULL;
|
|
||||||
} else {
|
|
||||||
snprintf(new_value_names[i], NAME_LEN, "new_%s", hexagon_regnames[i]);
|
|
||||||
hex_new_value[i] = tcg_global_mem_new(cpu_env,
|
|
||||||
offsetof(CPUHexagonState, new_value[i]),
|
|
||||||
new_value_names[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HEX_DEBUG) {
|
if (HEX_DEBUG) {
|
||||||
snprintf(reg_written_names[i], NAME_LEN, "reg_written_%s",
|
snprintf(reg_written_names[i], NAME_LEN, "reg_written_%s",
|
||||||
hexagon_regnames[i]);
|
hexagon_regnames[i]);
|
||||||
|
|
|
@ -69,6 +69,7 @@ typedef struct DisasContext {
|
||||||
bool need_pkt_has_store_s1;
|
bool need_pkt_has_store_s1;
|
||||||
bool short_circuit;
|
bool short_circuit;
|
||||||
bool has_hvx_helper;
|
bool has_hvx_helper;
|
||||||
|
TCGv new_value[TOTAL_PER_THREAD_REGS];
|
||||||
} DisasContext;
|
} DisasContext;
|
||||||
|
|
||||||
static inline void ctx_log_pred_write(DisasContext *ctx, int pnum)
|
static inline void ctx_log_pred_write(DisasContext *ctx, int pnum)
|
||||||
|
@ -190,7 +191,6 @@ extern TCGv hex_pred[NUM_PREGS];
|
||||||
extern TCGv hex_this_PC;
|
extern TCGv hex_this_PC;
|
||||||
extern TCGv hex_slot_cancelled;
|
extern TCGv hex_slot_cancelled;
|
||||||
extern TCGv hex_branch_taken;
|
extern TCGv hex_branch_taken;
|
||||||
extern TCGv hex_new_value[TOTAL_PER_THREAD_REGS];
|
|
||||||
extern TCGv hex_new_value_usr;
|
extern TCGv hex_new_value_usr;
|
||||||
extern TCGv hex_reg_written[TOTAL_PER_THREAD_REGS];
|
extern TCGv hex_reg_written[TOTAL_PER_THREAD_REGS];
|
||||||
extern TCGv hex_new_pred_value[NUM_PREGS];
|
extern TCGv hex_new_pred_value[NUM_PREGS];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue