[Top] [All Lists]

Re: [PATCH 1/8] add lib/gcd.c

To: Alan Cox <>
Subject: Re: [PATCH 1/8] add lib/gcd.c
From: James Cloos <>
Date: Sat, 13 Jun 2009 11:50:15 -0400
Cc:, "Linux-MIPS" <>, Florian Fainelli <>, Andrew Morton <>, Takashi Iwai <>, Ralf Baechle <>
Copyright: Copyright 2009 James Cloos
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=eagle; t=1244908251; bh=SAYlnAqUZVE1ixT0RiZ9eWYNhEDGrKhlSzqxA3mPBhA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=bnHCEuLxWOAh601C57WkuzAky5hoFxpDwGd3ipJHRt7M50J+QkGKKfhpD++8PuS3P co1pvWgGrLD4DDdeWWJnLMYzhUqsSgSYprsRXy00gV9zzLe72U0rDQoWNaEhuJjJp6 8EGiZX78Vf1rn/kaiOrL6Ik6vRCaMxDwSPdk6KbY=
In-reply-to: <> (Alan Cox's message of "Sat, 13 Jun 2009 16:28:02 +0100")
Openpgp: ED7DAEA6; url=
Openpgp-fingerprint: E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
Original-recipient: rfc822;
References: <> <> <>
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (gnu/linux)
>>>>> "Alan" == Alan Cox <> writes:

>> Would the binary gcd algorithm not be a better fit for the kernel?

Alan> Could well be the shift based one is better for some processors only.

Very likely, I suspect.

And the version of the euclid algo in that patch is better than most
references that I've seen.  (q=a/b;r=a%b; is common, probably because
the texts use the same algo for computing the continued fraction.)

In any case, I do not have the hardware to do any statistically
significant testing; the closest I could do would be a speed test
on hera, which I expect would be discouraged.

James Cloos <>         OpenPGP: 1024D/ED7DAEA6

<Prev in Thread] Current Thread [Next in Thread>