Message ID | 20170524220827.21154-2-rth@twiddle.net |
---|---|
State | New |
Headers | show |
On 2017-05-24 15:08, Richard Henderson wrote: > Use this saved value instead of recomputing from next_pc difference. > > Signed-off-by: Richard Henderson <rth@twiddle.net> > --- > target/s390x/translate.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
On 25.05.2017 00:08, Richard Henderson wrote: > Use this saved value instead of recomputing from next_pc difference. > > Signed-off-by: Richard Henderson <rth@twiddle.net> > --- > target/s390x/translate.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/target/s390x/translate.c b/target/s390x/translate.c > index 4bd16d9..5b8333f 100644 > --- a/target/s390x/translate.c > +++ b/target/s390x/translate.c > @@ -58,6 +58,7 @@ struct DisasContext { > const DisasInsn *insn; > DisasFields *fields; > uint64_t pc, next_pc; > + uint32_t ilen; > enum cc_op cc_op; > bool singlestep_enabled; > }; > @@ -349,7 +350,7 @@ static void gen_program_exception(DisasContext *s, int code) > tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUS390XState, int_pgm_code)); > tcg_temp_free_i32(tmp); > > - tmp = tcg_const_i32(s->next_pc - s->pc); > + tmp = tcg_const_i32(s->ilen); > tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUS390XState, int_pgm_ilen)); > tcg_temp_free_i32(tmp); > > @@ -2207,7 +2208,7 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o) > v1 = regs[r1]; > } > > - ilen = tcg_const_i32(s->next_pc - s->pc); > + ilen = tcg_const_i32(s->ilen); > gen_helper_ex(cpu_env, ilen, v1, o->in2); > tcg_temp_free_i32(ilen); > > @@ -4052,7 +4053,7 @@ static ExitStatus op_svc(DisasContext *s, DisasOps *o) > tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, int_svc_code)); > tcg_temp_free_i32(t); > > - t = tcg_const_i32(s->next_pc - s->pc); > + t = tcg_const_i32(s->ilen); > tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, int_svc_ilen)); > tcg_temp_free_i32(t); > > @@ -5191,6 +5192,7 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s, > op = (insn >> 8) & 0xff; > ilen = get_ilen(op); > s->next_pc = s->pc + ilen; > + s->ilen = ilen; > > switch (ilen) { > case 2: > Reviewed-by: David Hildenbrand <david@redhat.com>
diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 4bd16d9..5b8333f 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -58,6 +58,7 @@ struct DisasContext { const DisasInsn *insn; DisasFields *fields; uint64_t pc, next_pc; + uint32_t ilen; enum cc_op cc_op; bool singlestep_enabled; }; @@ -349,7 +350,7 @@ static void gen_program_exception(DisasContext *s, int code) tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUS390XState, int_pgm_code)); tcg_temp_free_i32(tmp); - tmp = tcg_const_i32(s->next_pc - s->pc); + tmp = tcg_const_i32(s->ilen); tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUS390XState, int_pgm_ilen)); tcg_temp_free_i32(tmp); @@ -2207,7 +2208,7 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o) v1 = regs[r1]; } - ilen = tcg_const_i32(s->next_pc - s->pc); + ilen = tcg_const_i32(s->ilen); gen_helper_ex(cpu_env, ilen, v1, o->in2); tcg_temp_free_i32(ilen); @@ -4052,7 +4053,7 @@ static ExitStatus op_svc(DisasContext *s, DisasOps *o) tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, int_svc_code)); tcg_temp_free_i32(t); - t = tcg_const_i32(s->next_pc - s->pc); + t = tcg_const_i32(s->ilen); tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, int_svc_ilen)); tcg_temp_free_i32(t); @@ -5191,6 +5192,7 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s, op = (insn >> 8) & 0xff; ilen = get_ilen(op); s->next_pc = s->pc + ilen; + s->ilen = ilen; switch (ilen) { case 2:
Use this saved value instead of recomputing from next_pc difference. Signed-off-by: Richard Henderson <rth@twiddle.net> --- target/s390x/translate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)