target-alpha prep work for qom cpu changes
cover target-alpha prep work for qom cpu changes
As discussed in the QOM thread.
r~
Richard Henderson (2):
target-alpha: Copy singlestep_enabled to DisasContext
target-alpha: Copy implver to DisasContext
target-alpha/translate.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 1/2 target-alpha: Copy singlestep_enabled to DisasContext
Prepare for removing env from DisasContext.
--- target-alpha/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
target-alpha/translate.c +6 -3
@@ -46,6 +46,8 @@ struct DisasContext {int tb_rm;/* Current flush-to-zero setting for this TB. */ int tb_ftz; + +bool singlestep_enabled; };/* Return values from translate_one, indicating the state of the TB.
@@ -380,7 +382,7 @@ static int use_goto_tb(DisasContext *ctx, uint64_t dest)/* Check for the dest on the same page as the start of the TB. We also want to suppress goto_tb in the case of single-steping and IO. */ return (((ctx->tb->pc ^ dest) &TARGET_PAGE_MASK ) ==0 - && !ctx->env->singlestep_enabled + && !ctx->singlestep_enabled && !(ctx->tb->cflags &CF_LAST_IO )); }
@@ -3396,6 +3398,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, ctx.env = env; ctx.pc = pc_start; ctx.mem_idx =cpu_mmu_index (env); + ctx.singlestep_enabled = env->singlestep_enabled;/* ??? Every TB begins with unset rounding mode, to be initialized on the first fp insn of the TB. Alternately we could define a proper
@@ -3452,7 +3455,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, || tcg_ctx.gen_opc_ptr >= gen_opc_end || num_insns >= max_insns || singlestep - || env->singlestep_enabled)) { + || ctx.singlestep_enabled)) { ret =EXIT_PC_STALE ; } }while (ret ==NO_EXIT );
@@ -3469,7 +3472,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env,tcg_gen_movi_i64 (cpu_pc, ctx.pc);/* FALLTHRU */ case EXIT_PC_UPDATED : -if (env->singlestep_enabled) { +if (ctx.singlestep_enabled) {gen_excp_1 (EXCP_DEBUG ,0 ); }else {tcg_gen_exit_tb (0 );
Signature · 1 line
1.8.1.4
Re: [Qemu-devel] [PATCH 1/2] target-alpha: Copy singlestep_enabled to DisasContext
Am 01.07.2013 22:19, schrieb Richard Henderson:
Quoted 12 lines
Prepare for removing env from DisasContext.
Signed-off-by Richard Henderson <[email protected]>--- target-alpha/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)target-alpha/translate.c +0
-0
target-alpha/translate.c struct DisasContext { · line 50
Quoted 5 lines
target-alpha/translate.c +2
-0@@ -46,6 +46,8 @@ struct DisasContext {int tb_rm;/* Current flush-to-zero setting for this TB. */ int tb_ftz; + +bool singlestep_enabled;
env->singlestep_enabled is an int containing flags. Below it's only used as a boolean though, so
Thanks,
Andreas
Quoted 38 lines
target-alpha/translate.c +4
-3};/* Return values from translate_one, indicating the state of the TB. @@ -380,7 +382,7 @@ static int use_goto_tb(DisasContext *ctx, uint64_t dest)/* Check for the dest on the same page as the start of the TB. We also want to suppress goto_tb in the case of single-steping and IO. */ return (((ctx->tb->pc ^ dest) &TARGET_PAGE_MASK ) ==0 - && !ctx->env->singlestep_enabled + && !ctx->singlestep_enabled && !(ctx->tb->cflags &CF_LAST_IO )); }@@ -3396,6 +3398,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, ctx.env = env; ctx.pc = pc_start; ctx.mem_idx =cpu_mmu_index (env); + ctx.singlestep_enabled = env->singlestep_enabled;/* ??? Every TB begins with unset rounding mode, to be initialized on the first fp insn of the TB. Alternately we could define a proper @@ -3452,7 +3455,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, || tcg_ctx.gen_opc_ptr >= gen_opc_end || num_insns >= max_insns || singlestep - || env->singlestep_enabled)) { + || ctx.singlestep_enabled)) { ret =EXIT_PC_STALE ; } }while (ret ==NO_EXIT );@@ -3469,7 +3472,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env,tcg_gen_movi_i64 (cpu_pc, ctx.pc);/* FALLTHRU */ case EXIT_PC_UPDATED : -if (env->singlestep_enabled) { +if (ctx.singlestep_enabled) {gen_excp_1 (EXCP_DEBUG ,0 ); }else {tcg_gen_exit_tb (0 );
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
PATCH 2/2 target-alpha: Copy implver to DisasContext
In reply to Richard HendersonWhich allows removing env from DisasContext.
--- target-alpha/translate.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
target-alpha/translate.c +7 -4
@@ -38,7 +38,6 @@typedef struct DisasContext DisasContext ;struct DisasContext {struct TranslationBlock *tb; -CPUAlphaState *env;uint64_t pc;int mem_idx;
@@ -47,6 +46,9 @@ struct DisasContext {/* Current flush-to-zero setting for this TB. */ int tb_ftz; +/* implver value for this CPU. */ +int implver; +bool singlestep_enabled; };
@@ -2246,8 +2248,9 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)break ;case 0x6C :/* IMPLVER */ -if (rc !=31 ) -tcg_gen_movi_i64 (cpu_ir[rc], ctx->env->implver); +if (rc !=31 ) { +tcg_gen_movi_i64 (cpu_ir[rc], ctx->implver); + }break ;default : goto invalid_opc;
@@ -3395,9 +3398,9 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, gen_opc_end = tcg_ctx.gen_opc_buf +OPC_MAX_SIZE ; ctx.tb = tb; - ctx.env = env; ctx.pc = pc_start; ctx.mem_idx =cpu_mmu_index (env); + ctx.implver = env->implver; ctx.singlestep_enabled = env->singlestep_enabled;/* ??? Every TB begins with unset rounding mode, to be initialized on
Signature · 1 line
1.8.1.4
Re: [Qemu-devel] [PATCH 2/2] target-alpha: Copy implver to DisasContext
Am 01.07.2013 22:19, schrieb Richard Henderson:
Quoted 3 lines
Which allows removing env from DisasContext.
Signed-off-by Richard Henderson <[email protected]>
I notice that implver is only ever assigned in CPUs' instance_init, so a candidate for moving to AlphaCPUClass as a follow-up.
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Am 01.07.2013 22:19, schrieb Richard Henderson:
Quoted 1 line
As discussed in the QOM thread.
Thanks, applying to qom-cpu-next to rebase qom-cpu-11:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-next
Andreas
Quoted 7 lines
Richard Henderson (2):
target-alpha: Copysinglestep_enabledto DisasContext
target-alpha: Copy implver to DisasContexttarget-alpha/translate.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg