Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-05-20 Thread kbuild test robot
Hi, [auto build test ERROR on v4.6-rc5] [cannot apply to next-20160519] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/zengzhaoxiu-163-com/lib-GCD-add-binary-GCD-algorithm/20160428-195527

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-05-20 Thread kbuild test robot
Hi, [auto build test ERROR on v4.6-rc5] [cannot apply to next-20160519] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/zengzhaoxiu-163-com/lib-GCD-add-binary-GCD-algorithm/20160428-195527

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Sam Ravnborg
> __ffs on the available architectures: > Alpha: sometimes (CONFIG_ALPHA_EV6, CONFIG_ALPHA_EV67) > ARC: sometimes (!CONFIG_ISA_ARCOMPACT) > ARM: sometimes (V5+) > ARM64: NO, could be written using RBIT and CLZ > AVR: yes > Blackfin: NO, could be written using

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Sam Ravnborg
> __ffs on the available architectures: > Alpha: sometimes (CONFIG_ALPHA_EV6, CONFIG_ALPHA_EV67) > ARC: sometimes (!CONFIG_ISA_ARCOMPACT) > ARM: sometimes (V5+) > ARM64: NO, could be written using RBIT and CLZ > AVR: yes > Blackfin: NO, could be written using

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread George Spelvin
> How does a CPU lack an efficient ffs/ctz anyway? There are all sorts > of ways to implement it without a native insn, some of which are > almost or just as fast as the native insn on cpus that have the > latter. On anything with a fast multiply, the de Bruijn sequence > approach is near-optimal,

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread George Spelvin
> How does a CPU lack an efficient ffs/ctz anyway? There are all sorts > of ways to implement it without a native insn, some of which are > almost or just as fast as the native insn on cpus that have the > latter. On anything with a fast multiply, the de Bruijn sequence > approach is near-optimal,

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Geert Uytterhoeven
On Thu, Apr 28, 2016 at 7:58 PM, Rich Felker wrote: > On Thu, Apr 28, 2016 at 07:51:06PM +0200, Geert Uytterhoeven wrote: >> On Thu, Apr 28, 2016 at 6:48 PM, George Spelvin wrote: >> > Another few comments: >> > >> > 1. Would ARCH_HAS_FAST_FFS involve fewer

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Geert Uytterhoeven
On Thu, Apr 28, 2016 at 7:58 PM, Rich Felker wrote: > On Thu, Apr 28, 2016 at 07:51:06PM +0200, Geert Uytterhoeven wrote: >> On Thu, Apr 28, 2016 at 6:48 PM, George Spelvin wrote: >> > Another few comments: >> > >> > 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? >>

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Rich Felker
On Thu, Apr 28, 2016 at 07:51:06PM +0200, Geert Uytterhoeven wrote: > On Thu, Apr 28, 2016 at 6:48 PM, George Spelvin wrote: > > Another few comments: > > > > 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? > > No, as you want to _disable_

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Rich Felker
On Thu, Apr 28, 2016 at 07:51:06PM +0200, Geert Uytterhoeven wrote: > On Thu, Apr 28, 2016 at 6:48 PM, George Spelvin wrote: > > Another few comments: > > > > 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? > > No, as you want to _disable_ ARCH_HAS_FAST_FFS / _enable_

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Geert Uytterhoeven
On Thu, Apr 28, 2016 at 6:48 PM, George Spelvin wrote: > Another few comments: > > 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? No, as you want to _disable_ ARCH_HAS_FAST_FFS / _enable_ CPU_NO_EFFICIENT_FFS as soon as you're enabling support for

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Geert Uytterhoeven
On Thu, Apr 28, 2016 at 6:48 PM, George Spelvin wrote: > Another few comments: > > 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? No, as you want to _disable_ ARCH_HAS_FAST_FFS / _enable_ CPU_NO_EFFICIENT_FFS as soon as you're enabling support for a CPU that doesn't

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread James Bottomley
On Thu, 2016-04-28 at 19:43 +0800, zengzhao...@163.com wrote: > From: Zhaoxiu Zeng > > 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

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread James Bottomley
On Thu, 2016-04-28 at 19:43 +0800, zengzhao...@163.com wrote: > From: Zhaoxiu Zeng > > 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

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread George Spelvin
Another few comments: 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? Rather than updating all the Kconfig files, it could be #defined in the arch/*/asm/bitops.h files where the __ffs macro is defined. E.g. diff --git a/arch/alpha/include/asm/bitops.h

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread George Spelvin
Another few comments: 1. Would ARCH_HAS_FAST_FFS involve fewer changes than CPU_NO_EFFICIENT_FFS? Rather than updating all the Kconfig files, it could be #defined in the arch/*/asm/bitops.h files where the __ffs macro is defined. E.g. diff --git a/arch/alpha/include/asm/bitops.h

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Josh Juran
On Apr 28, 2016, at 7:43 AM, zengzhao...@163.com wrote: > + * This implements the binary GCD algorithm. (Often attributed to Stein, > + * but as Knuth has noted, appears a first-century Chinese math text.) Should this be "appears in a"? Josh

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread Josh Juran
On Apr 28, 2016, at 7:43 AM, zengzhao...@163.com wrote: > + * This implements the binary GCD algorithm. (Often attributed to Stein, > + * but as Knuth has noted, appears a first-century Chinese math text.) Should this be "appears in a"? Josh

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread kbuild test robot
Hi, [auto build test ERROR on v4.6-rc5] [cannot apply to next-20160428] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/zengzhaoxiu-163-com/lib-GCD-add-binary-GCD-algorithm/20160428-195527

Re: [patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread kbuild test robot
Hi, [auto build test ERROR on v4.6-rc5] [cannot apply to next-20160428] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/zengzhaoxiu-163-com/lib-GCD-add-binary-GCD-algorithm/20160428-195527

[patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread zengzhaoxiu
From: Zhaoxiu Zeng 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

[patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread zengzhaoxiu
From: Zhaoxiu Zeng 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