Re: 8259A initialization with AMD SC520 chip (586)

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Tue May 23 2000 - 12:04:54 EST


Linus Torvalds wrote:
> >256 clocks. Assuming parallel execution of both instructions 128 clocks. 128
> >clocks at 1GHz, is 8uS. So for likely future cpus we can assume it gets you
> >2uS - ok. Providing of course transmeta doesnt code morph it out !
>
> We'd love to, but we don't touch code like that. We could have made the
> old bogomips give infinite values if we _really_ wanted to, but code
> like that has one purpose, and one purpose only: delaying. So we never
> remove those kinds of loops.
>
> (And in any case it would have been extra logic - empty loop removal is
> very much a special case, so whatever we did would have been an extra
> wart rather than anything that came really naturally to the way morphing
> works..)

That's what the GCC manual used to say. But then one day, they noticed
that modern code sometimes has non-empty loops that can be optimised
into empty loops.

Those loops are not meant to be delays. They're things like "inline
void generic_function(void(*fn)()) { while(blahblah) if (fn) fn(); }".
(Use your imagination, preferably in C++). So GCC had a policy change
(after many years!) and now it removes empty loops.

I don't know if it removes _explicit_ empty loops though.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:24 EST