[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] c++ & mem
On Mon, 11 Dec 2000, Alex Hudson wrote:
> > By "efficient code" I meant things like unrolling loops by hand
> > (Duff's device -- a compiler can _never_ get that right because
> > compilers don't read hardware data sheets),
>
> I really don't see why a compiler can't unroll a loop? That's not exactly
> hard. I'm not really sure what the hardware data sheet has to do with
> things, either.
Determining when and by how much do so is hard, as inappropriate loop unrolling
may decrease performance by increasing cache misses. It is therefore nessercary
to know something about cache beahvour to make an appropriate decision. This
not not to say that a complier can't do better than a programmer writing in a
high level language, who may not know which processor is going to be used to
execute the code.
--
Timothy Baldwin
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.