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.

Thanks
Nilay
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to