On Fri, 2012-02-24 at 15:41 -0600, William J. Schmidt wrote: > On Fri, 2012-02-10 at 15:46 -0500, Michael Meissner wrote: > > I was looking at the routelookup EEMBC benchmark and it has code of the > > form: > > > > while ( this_node->cmpbit > next_node->cmpbit ) > > { > > this_node = next_node; > > > > if ( proute->dst_addr & (0x1 << this_node->cmpbit) ) > > next_node = this_node->rlink; > > else > > next_node = this_node->llink; > > } > > > > Andrew and Richard both suggested this would be better handled as a tree > optimization. Here is a proposed patch to do that.
I think this is slightly different from what was suggested by me. Since my suggestion has to deal with the load from this_node->cmpbit taken into account and not just because this_node->rlink and this_node->llink might be in the same page. Thanks, Andrew Pinski