[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] gcc signal overhead, redundant code, bug (?), far fro

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] gcc signal overhead, redundant code, bug (?), far from optimal
Date: Thu, 18 Aug 2005 23:32:13 +0200 (MET DST)

"Szikra Istvan" <address@hidden> wrote:

>  First of all, why clear __zero_reg__ ? It is NOT used in the
> interrupt.  Hell why push, clr, pop, isn't supposed zero be in it
> anyway?

Not within an interrupt routine.  The ABI choice of r0/r1 for
__temp_reg__ and __zero_reg__ predates the modern AVR cores, and is a
poor choice from today's point of few: the hardware multiplier and
some other operations that have been added to the CPU core later on
implicitly use r0 and/or r1.  Thus, an ISR cannot rely on __zero_reg__
really being zero.  (It would be interesting to see whether we could
really migrate the compiler to a different register in the long run.)

>  The second, in this case why save SREG? Which instruction uses it?

The compiler simply doesn't analyze that level of detail, it seems,
but rather always emits a standard preamble and trailer snippet.  If
you've got an hour of time (or an entire weekend? :), you could make a
stab at improving the optimizer here I think... ;-)

OTOH, in your case, it might be worth the while to move out the entire
ISR into an assembly source file of its own.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]