[lkml]   [2009]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/8] add lib/gcd.c
> Would the binary gcd algorithm not be a better fit for the kernel?
> It avoids division, using only shifts and subtraction:

Time them both and see. I suspect on a lot of processors the divide based
one now wins. We also have fls() and ffs() which may mean some platforms
can implement the first two loops even better.

Could well be the shift based one is better for some processors only.

 \ /
  Last update: 2009-06-13 17:31    [W:0.064 / U:0.224 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site