On Wed, May 09, 2018 at 02:21:42PM -0700, Richard Henderson wrote:
> On 05/08/2018 10:31 AM, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> >
> > Cleanup eval_cond_jmp to use tcg_gen_movcond_i64().
> > No functional change.
> >
> > Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> > ---
> > target/microblaze/translate.c | 9 +++------
> > 1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
> > index 256acce876..a4f6b307d3 100644
> > --- a/target/microblaze/translate.c
> > +++ b/target/microblaze/translate.c
> > @@ -1167,12 +1167,9 @@ static inline void eval_cc(DisasContext *dc, unsigned int cc,
> >
> > static void eval_cond_jmp(DisasContext *dc, TCGv_i64 pc_true, TCGv_i64 pc_false)
> > {
> > - TCGLabel *l1 = gen_new_label();
> > - /* Conditional jmp. */
> > - tcg_gen_mov_i64(cpu_SR[SR_PC], pc_false);
> > - tcg_gen_brcondi_i64(TCG_COND_EQ, env_btaken, 0, l1);
> > - tcg_gen_mov_i64(cpu_SR[SR_PC], pc_true);
> > - gen_set_label(l1);
> > + tcg_gen_movcond_i64(TCG_COND_NE, cpu_SR[SR_PC],
> > + env_btaken, tcg_const_i64(0),
> > + pc_true, pc_false);
>
> Ah. I would probably just extend env_btaken here instead of the previous patch.
>
I've changed it according to your suggestion. I'll post v3 in a moment.
Thanks,
Edgar