Message ID | BANLkTimFrQ12ZhpfdCyS3HvCd9kYHm7bRA@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Sat, Apr 30, 2011 at 7:42 PM, Blue Swirl <blauwirbel@gmail.com> wrote: > Use TCG local to work around TCG register flush due to a branch. > > Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno. > > Signed-off-by: Blue Swirl <blauwirbel@gmail.com> > --- > I analyzed the call tree in target-sparc/translate.c for brcond* usage. > In the following lines, first level function uses brcond* directly, > second level calls the first level etc. > I want to be able to do exhaustive searches as well :) Have you used recently posted gcc save-temps method?
Just curious, is this for host or guest? On Sat, Apr 30, 2011 at 3:32 PM, Igor Kovalenko <igor.v.kovalenko@gmail.com>wrote: > On Sat, Apr 30, 2011 at 7:42 PM, Blue Swirl <blauwirbel@gmail.com> wrote: > > Use TCG local to work around TCG register flush due to a branch. > > > > Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno. > > > > Signed-off-by: Blue Swirl <blauwirbel@gmail.com> > > --- > > I analyzed the call tree in target-sparc/translate.c for brcond* usage. > > In the following lines, first level function uses brcond* directly, > > second level calls the first level etc. > > > > I want to be able to do exhaustive searches as well :) > Have you used recently posted gcc save-temps method? > > -- > Kind regards, > Igor V. Kovalenko > >
On Sat, Apr 30, 2011 at 9:48 PM, Super Bisquit <superbisquit@gmail.com> wrote: > > Just curious, is this for host or guest? Guest (aka target) > On Sat, Apr 30, 2011 at 3:32 PM, Igor Kovalenko <igor.v.kovalenko@gmail.com> > wrote: >> >> On Sat, Apr 30, 2011 at 7:42 PM, Blue Swirl <blauwirbel@gmail.com> wrote: >> > Use TCG local to work around TCG register flush due to a branch. >> > >> > Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno. >> > >> > Signed-off-by: Blue Swirl <blauwirbel@gmail.com> >> > --- >> > I analyzed the call tree in target-sparc/translate.c for brcond* usage. >> > In the following lines, first level function uses brcond* directly, >> > second level calls the first level etc. >> > >> >> I want to be able to do exhaustive searches as well :) >> Have you used recently posted gcc save-temps method? >> >> -- >> Kind regards, >> Igor V. Kovalenko >> > >
On Sat, Apr 30, 2011 at 10:32 PM, Igor Kovalenko <igor.v.kovalenko@gmail.com> wrote: > On Sat, Apr 30, 2011 at 7:42 PM, Blue Swirl <blauwirbel@gmail.com> wrote: >> Use TCG local to work around TCG register flush due to a branch. >> >> Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno. >> >> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> >> --- >> I analyzed the call tree in target-sparc/translate.c for brcond* usage. >> In the following lines, first level function uses brcond* directly, >> second level calls the first level etc. >> > > I want to be able to do exhaustive searches as well :) > Have you used recently posted gcc save-temps method? No, I just used the search facilities of the editor. First, search for brcond, examine the function for correctness and copy the function names to scratch buffer. Next, search for the function names just found, examine callers and copy their function names with prefix to scratch etc. About one hour's work.
diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 3c958b2..9222cde 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -3505,16 +3505,28 @@ static void disas_sparc_insn(DisasContext * dc) tcg_gen_mov_tl(cpu_tbr, cpu_tmp0); break; case 6: // pstate - save_state(dc, cpu_cond); - gen_helper_wrpstate(cpu_tmp0); - dc->npc = DYNAMIC_PC; + { + TCGv r_tmp = tcg_temp_local_new(); + + tcg_gen_mov_tl(r_tmp, cpu_tmp0); + save_state(dc, cpu_cond); + gen_helper_wrpstate(r_tmp); + tcg_temp_free(r_tmp); + dc->npc = DYNAMIC_PC; + } break; case 7: // tl - save_state(dc, cpu_cond); - tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_tmp0); - tcg_gen_st_i32(cpu_tmp32, cpu_env, - offsetof(CPUSPARCState, tl)); - dc->npc = DYNAMIC_PC; + { + TCGv r_tmp = tcg_temp_local_new(); + + tcg_gen_mov_tl(r_tmp, cpu_tmp0); + save_state(dc, cpu_cond); + tcg_gen_trunc_tl_i32(cpu_tmp32, r_tmp); + tcg_temp_free(r_tmp); + tcg_gen_st_i32(cpu_tmp32, cpu_env, + offsetof(CPUSPARCState, tl)); + dc->npc = DYNAMIC_PC; + } break; case 8: // pil