lkml.org 
[lkml]   [2016]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch V3] lib: GCD: add binary GCD algorithm
From
Date
On Thu, 2016-04-28 at 19:43 +0800, zengzhaoxiu@163.com wrote:
> From: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
>
> Because some architectures (alpha, armv6, etc.) don't provide
> hardware division, the mod operation is slow! Binary GCD algorithm
> uses simple arithmetic operations, it replaces division with
> arithmetic shifts, comparisons, and subtractions.
>
> I have compiled successfully with x86_64_defconfig and
> i386_defconfig.

What's the reason for wanting to optimize this and thus have to
maintain (and test) two separate code paths, which is a significant
expense? As far as I can see, gcd() is mosly used in finding optimal
clocks for operations, which is usually done at start of day and not
time critical.

James


\
 
 \ /
  Last update: 2016-04-28 19:41    [W:0.093 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site