| To: | James Cloos <cloos@jhcloos.com> |
|---|---|
| Subject: | Re: [PATCH 1/8] add lib/gcd.c |
| From: | Alan Cox <alan@lxorguk.ukuu.org.uk> |
| Date: | Sat, 13 Jun 2009 16:28:02 +0100 |
| Cc: | linux-kernel@vger.kernel.org, "Linux-MIPS" <linux-mips@linux-mips.org>, Florian Fainelli <florian@openwrt.org>, Andrew Morton <akpm@linux-foundation.org>, Takashi Iwai <tiwai@suse.de>, Ralf Baechle <ralf@linux-mips.org> |
| In-reply-to: | <m38wjwz5ur.fsf@lugabout.jhcloos.org> |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| References: | <200906041615.10467.florian@openwrt.org> <m38wjwz5ur.fsf@lugabout.jhcloos.org> |
| Sender: | linux-mips-bounce@linux-mips.org |
> 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. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 1/8] add lib/gcd.c, James Cloos |
|---|---|
| Next by Date: | Re: [PATCH 1/8] add lib/gcd.c, James Cloos |
| Previous by Thread: | Re: [PATCH 1/8] add lib/gcd.c, James Cloos |
| Next by Thread: | Re: [PATCH 1/8] add lib/gcd.c, James Cloos |
| Indexes: | [Date] [Thread] [Top] [All Lists] |