cache coherence problem

linas at austin.ibm.com linas at austin.ibm.com
Thu Nov 20 09:35:12 EST 2003


On Mon, Nov 17, 2003 at 09:38:32PM -0500, Michael R. Zucca wrote:
>
> have to make sure everything is flushed and the icache is invalidated
> before executing the code. You have to do the same thing when you do
> self-modifying code.
>
> Why would you want to do this, anyway?

I don't know what he's doing, but sometimes one has static if tests
inside of tight inner loops, but you don't know (at compile time)
what the compare op will be until runtime. One way to solve this
is build an optimized loop for each possible compare op.

This optimization strategy fails if you have more than a handful of
if-tests, cause then you have a combinatorial explosion (i.e. dozens
of nearly identical .o files eating up megabytes with nearly identical
code).   So one way around this to have a few basic loops, and patch
them up at run time.

--linas

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list