On Fri, Jul 1, 2011 at 5:03 PM, Artyom Tarasenko <atar4q...@gmail.com> wrote: [...] >> I find it odd that udivx is using cpu_cc_src and cpu_cc_src2. Using >> dedicated local temps seems to fix the issue. > > Do we need to copy cpu_src* to further temps at all? IMHO > > - tcg_gen_mov_tl(cpu_cc_src, cpu_src1); > - tcg_gen_mov_tl(cpu_cc_src2, cpu_src2); > - gen_trap_ifdivzero_tl(cpu_cc_src2); > - tcg_gen_divu_i64(cpu_dst, cpu_cc_src, cpu_cc_src2); > + gen_trap_ifdivzero_tl(cpu_src2); > + tcg_gen_divu_i64(cpu_dst, cpu_src1, cpu_src2); > > should do it. Or cpu_src is what you mean by dedicated?
You have to use two local temps here to store cpu_src1 and cpu_src2 because gen_trap_ifdivzero_tl uses tcg_gen_brcondi_tl (cf tcg/README comment about local usage and jumps). Note you'll have to do something similar in gen_op_sdivx. Laurent