Thanks!
> Can anybody tell me what "zero-overhead loop" mean.
> I read it in a book about DSPs with no further explanation.
http://www.chipcenter.com/eexpert/bhenderson/bhenderson008.html
Looks like a hardware trick that lets you do "for" loops quickly. You
tell it the start and end addresses and a number of times and ZOOM,
the hardware just does that small piece of code really fast.
A zero overhead loop, is a hardware (CPU) instruction that eliminates
loop overhead. This is achieved by a special "loop" instruction
that repeatedly executes a block of code (start address .. end
address)
a fixed number of times (the loop count).
The loop code can either be a constant value specified in the loop
instruction
or a register value depending on the implementation of the loop
instruction.
A good DSP compiler should take advantage of loop instructions
whenever possible. For small loops, zero overhead loop optimizations
can provide
gains of almost 100% faster execution !
Regards,
gopi
---
Gopi Kumar Bulusu
Sankhya Technologies Private Limited
http://www.sankhya.com
Tel: +91 44 2822 7358
Fax: +91 44 2822 7357
Andreas Bellgardt <bell...@netiera.de> wrote in message news:<b7edds$p6b$02$1...@news.t-online.com>...
Caveat: the loop may not be allowed to contain subroutine calls on
some implementations, but then it is supposed to be a small loop.
- RM
><snip>
>Caveat: the loop may not be allowed to contain subroutine calls on
>some implementations, but then it is supposed to be a small loop.
My limited experience with zero-overhead loops is that they are
implemented by dedicating an address comparator to detect early
when the instruction pointer reaches the end of the loop and
forcing it back to the beginning, conditionally on some status
bit(s). It's a compare-equal, though, from what I've seen.
This has it's problems, such as placing a call instruction right
at the end of the loop, but calls within the body often work
just fine. Just add a NOP to the end, if a call is needed
there.
And yes, more often than not, a subroutine call isn't
appropriate where the performance of a zero-overhead loop is
required. But given that they exist, they will be used for a
wide variety of needs. Sometimes, the speed isn't important but
the semantic of a DO..LOOP is; and such loops are usually also
very simple to use, so they get used instead of explicitly
making compares and jumps to form a counted loop.
Jon