Message ID | 1439151229-27747-12-git-send-email-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
On 08/09/2015 01:13 PM, Laurent Vivier wrote: > Generate the TCG constant and use it twice, instead > of generating the TCG constant twice to use it twice. > > Signed-off-by: Laurent Vivier <laurent@vivier.eu> > --- > target-m68k/translate.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/target-m68k/translate.c b/target-m68k/translate.c > index 359c761..8a3d315 100644 > --- a/target-m68k/translate.c > +++ b/target-m68k/translate.c > @@ -1431,10 +1431,13 @@ DISAS_INSN(lea) > DISAS_INSN(clr) > { > int opsize; > + TCGv zero; > + > + zero = tcg_const_i32(0); Ideally, on one line. And it still needs to be freed. > DISAS_INSN(moveq) > { > - uint32_t val; > + TCGv val; > > + val = tcg_const_i32((int8_t)insn); Likewise. r~
diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 359c761..8a3d315 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -1431,10 +1431,13 @@ DISAS_INSN(lea) DISAS_INSN(clr) { int opsize; + TCGv zero; + + zero = tcg_const_i32(0); opsize = insn_opsize(insn, 6); - DEST_EA(env, insn, opsize, tcg_const_i32(0), NULL); - gen_logic_cc(s, tcg_const_i32(0), opsize); + DEST_EA(env, insn, opsize, zero, NULL); + gen_logic_cc(s, zero, opsize); } static TCGv gen_get_ccr(DisasContext *s) @@ -1776,11 +1779,11 @@ DISAS_INSN(branch) DISAS_INSN(moveq) { - uint32_t val; + TCGv val; - val = (int8_t)insn; - tcg_gen_movi_i32(DREG(insn, 9), val); - gen_logic_cc(s, tcg_const_i32(val), OS_LONG); + val = tcg_const_i32((int8_t)insn); + tcg_gen_mov_i32(DREG(insn, 9), val); + gen_logic_cc(s, val, OS_LONG); } DISAS_INSN(mvzs)
Generate the TCG constant and use it twice, instead of generating the TCG constant twice to use it twice. Signed-off-by: Laurent Vivier <laurent@vivier.eu> --- target-m68k/translate.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)