[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090613162802.6c212505@lxorguk.ukuu.org.uk>
Date: Sat, 13 Jun 2009 16:28:02 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: James Cloos <cloos@...loos.com>
Cc: linux-kernel@...r.kernel.org,
"Linux-MIPS" <linux-mips@...ux-mips.org>,
Florian Fainelli <florian@...nwrt.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Takashi Iwai <tiwai@...e.de>,
Ralf Baechle <ralf@...ux-mips.org>
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists