[Beowulf] Re: A start in Parallel Programming?

Mark Hahn hahn at mcmaster.ca
Tue Mar 13 21:59:36 PDT 2007

> will recognize that the cases are 1,2,3,...N and optimize
> with a look up table accordingly.  I checked only once, about 15

compiler writers do try hard to stay abreast of actual hardware 
behavior.  this is a good example: the look-up-table approach is 
clearly not the fastest for some (many?) cases.

> years ago, and the resultant code was doing the equivalent of this:
>  if(i==1){}
>  else if(i==2){}
>  etc.

did you compile with feedback-directed optimization?  bear in mind that 
predicted branches are cheap, probably cheaper than a LUT in L2, perhaps 
even one in L1.  _anything_ is cheaper than a LUT that's all the way out
in memory...

More information about the Beowulf mailing list