On Fri, 15 Oct 1999, Richard A. Smith wrote:
Also as reply to: Gabriel Bouvigne - France
[...]
> >I think this is true (for a single pointer loop, for multiple/too many
> >pointers I think Takehiro is right, see earlier postings; pointers
> >can no longer be alloc'ed to registers, so memory is needed and this
>
> When did the pointer in a register go away? Are you telling me that
> the register keyword dosen't do anything in modern compilers?
> Forgive me if this is old hat. Most of my work is in the embedded
> world of 8-bit uCs.
What I meant to say is (or are we talking about something different?); if
you have e.g. 16 pointers you have to loop, and only 8 registers
are in your CPU (which the compiler decides to use for pointers) then for
8 of those pointers things can become less efficient;
i.e. load reg with pointer, load value for mem address for pointer,
increase pointer, store pointer back to mem, do something with value, ...
for the other 8 registers it is indeed simple: load value for mem address
for pointer, inc pointer, do something, >>>> no loading, no storing
so **sometimes** it is better to have more loops with less pointers than
one loop with all pointers.
> >Anyway, I got this idea from a recent book discussing all sorts of
optims,
> >and how (good) recent compilers work, I can look up the ref if you want
> >it;
>
I have to say that maybe this book isn't all that great; I only skimmed
through it once and no longer have it :(
http://www.oreilly.com/catalog/hpc2/toc.html
regards,
Patrick.
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )