Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-08 Thread Zhaoxiu Zeng
在 2016/5/7 16:41, George Spelvin 写道: > Nothing critical, but a bit of kibitzing. > (That is slang in the Yiddish language for a person > who offers annoying and unwanted advice.) > >> The binary GCD algorithm is based on the following facts: >> 1. If a and b are all evens, then gcd(a,b) = 2 *

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-08 Thread Zhaoxiu Zeng
在 2016/5/7 16:41, George Spelvin 写道: > Nothing critical, but a bit of kibitzing. > (That is slang in the Yiddish language for a person > who offers annoying and unwanted advice.) > >> The binary GCD algorithm is based on the following facts: >> 1. If a and b are all evens, then gcd(a,b) = 2 *

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
Sam Ravnborg wrote: > sparc64 have an efficient ffs implementation. > We use run-time patching to use the proper version > depending on the actual sparc cpu. > > As this is determinded at config time, then let the > sparc cpu that has the efficient ffs benefit from this. > > In other words -

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
Sam Ravnborg wrote: > sparc64 have an efficient ffs implementation. > We use run-time patching to use the proper version > depending on the actual sparc cpu. > > As this is determinded at config time, then let the > sparc cpu that has the efficient ffs benefit from this. > > In other words -

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
> Take a look at the Cc: list. Yes, I realized how long it was about half a second after hitting "send". Although I didn't really think it through at the time, even now that I do it's not entirely clear who should have been trimmed, either. In general lkml tradition is to not drop people from

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
> Take a look at the Cc: list. Yes, I realized how long it was about half a second after hitting "send". Although I didn't really think it through at the time, even now that I do it's not entirely clear who should have been trimmed, either. In general lkml tradition is to not drop people from

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread Sam Ravnborg
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > index 57ffaf2..ca675ed 100644 > --- a/arch/sparc/Kconfig > +++ b/arch/sparc/Kconfig > @@ -42,6 +42,7 @@ config SPARC > select ODD_RT_SIGACTION > select OLD_SIGSUSPEND > select ARCH_HAS_SG_CHAIN > + select

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread Sam Ravnborg
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > index 57ffaf2..ca675ed 100644 > --- a/arch/sparc/Kconfig > +++ b/arch/sparc/Kconfig > @@ -42,6 +42,7 @@ config SPARC > select ODD_RT_SIGACTION > select OLD_SIGSUSPEND > select ARCH_HAS_SG_CHAIN > + select

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread Andreas Schwab
"George Spelvin" writes: > Your benchmark code doesn't have to have a separate code path if > __x86_64__; rdtsc works on 32-bit code just as well. Take a look at the CC: list. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread Andreas Schwab
"George Spelvin" writes: > Your benchmark code doesn't have to have a separate code path if > __x86_64__; rdtsc works on 32-bit code just as well. Take a look at the CC: list. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
Nothing critical, but a bit of kibitzing. (That is slang in the Yiddish language for a person who offers annoying and unwanted advice.) > The binary GCD algorithm is based on the following facts: > 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) > 2. If a is even and b

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-07 Thread George Spelvin
Nothing critical, but a bit of kibitzing. (That is slang in the Yiddish language for a person who offers annoying and unwanted advice.) > The binary GCD algorithm is based on the following facts: > 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) > 2. If a is even and b

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-06 Thread Andrew Morton
On Fri, 6 May 2016 17:42:42 +0800 zengzhao...@163.com wrote: > From: Zhaoxiu Zeng > > The binary GCD algorithm is based on the following facts: > 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) > 2. If a is even and b is odd, then gcd(a,b) =

Re: [patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-06 Thread Andrew Morton
On Fri, 6 May 2016 17:42:42 +0800 zengzhao...@163.com wrote: > From: Zhaoxiu Zeng > > The binary GCD algorithm is based on the following facts: > 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) > 2. If a is even and b is odd, then gcd(a,b) = gcd(a/2, b) > 3. If

[patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng The binary GCD algorithm is based on the following facts: 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) 2. If a is even and b is odd, then gcd(a,b) = gcd(a/2, b) 3. If a and b are all odds, then gcd(a,b) =

[patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng The binary GCD algorithm is based on the following facts: 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) 2. If a is even and b is odd, then gcd(a,b) = gcd(a/2, b) 3. If a and b are all odds, then gcd(a,b) = gcd((a-b)/2, b) =