On Thu, 30 Dec 2010, nathan binkert wrote:

I was looking at the implementation of floorLog2() in src/base/intmath.hh. I
think this implementation is not the best that can be done. We should use a
GCC builtin __builtin_clz* to implement these functions. I have not carried
out any test to get the execution times for two different implementations.
But I looked at the assembly code generated for the two implementations for
64-bit version of the function. The ratio of number of instructions is
probably about 1:4 for builtin versus current implementation.

Sounds good, though I think it would be best to use some sort of
#ifdef to pick which one of the two should be used.

What would be the condition for #ifdef? GCC version?

  Nate
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to