On Mon, Dec 20, 2010 at 9:25 AM, Fabien Chouteau <chout...@adacore.com> wrote: > On 12/17/2010 08:14 PM, Blue Swirl wrote: >> >> On Wed, Dec 15, 2010 at 5:47 PM, Fabien Chouteau<chout...@adacore.com> >> wrote: >>> >>> On 12/13/2010 07:18 PM, Blue Swirl wrote: >>>> >>>> On Mon, Dec 13, 2010 at 3:51 PM, Fabien Chouteau<chout...@adacore.com> >>>> wrote: >>>>> >>>>> On 12/11/2010 10:56 AM, Blue Swirl wrote: >>>>>> >>>>>> On Tue, Dec 7, 2010 at 11:40 AM, Fabien Chouteau<chout...@adacore.com> >>>>>> wrote: >>>>>>> >>>>>>> On 12/06/2010 06:53 PM, Blue Swirl wrote: >>>>>>>> >>>>>>>> On Mon, Dec 6, 2010 at 9:26 AM, Fabien >>>>>>>> Chouteau<chout...@adacore.com> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> +#if !defined(CONFIG_USER_ONLY) >>>>>>>>> + /* Leon3 shutdown */ >>>>>>>>> + if (intno == 0x80&& env->version == 0xf3000000) { >>>>>>>>> + leon3_shutdown(); >>>>>>>>> + } >>>>>>>> >>>>>>>> This looks like a hack. Should a trap instruction initiate a >>>>>>>> shutdown? >>>>>>> >>>>>>> Yes, on Leon3 "ta 0x0" initiates a shutdown. >>>>>> >>>>>> Then this should be handled during translation. A Leon3 specific CPU >>>>>> feature should be added and used much like CHECK_IU_FEATURE (in >>>>>> translate.c). Then execution speed would not be affected for non-Leon3 >>>>>> CPUs. >>>>>> >>>>> >>>>> OK, but I don't see how to request a shutdown during translation. >>>> >>>> Just create a helper which calls shutdown, translator should insert a >>>> call to that. >>> >>> I think I understand what you mean, but I don't see why this would be >>> faster >>> than my solution. >> >> Shutdown is not performance critical, but interrupt handling is. >> > > I understand that, but why is it faster to do it during translation? > > I don't see how one "if" statement in "do_interrupt" will even slightly > impact > the performances, and why it will be slower than the same "if' statement in > the translation.
Because the whole point of translation is that the translated block will be executed many times but the translation only once. Therefore computing should be performed during translation instead of TB execution time, if possible.