All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rich Felker <dalias@libc.org>
Cc: George Spelvin <linux@horizon.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	zengzhaoxiu@163.com, "David S. Miller" <davem@davemloft.net>,
	Helge Deller <deller@gmx.de>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	James Hogan <james.hogan@imgtec.com>,
	"James E.J. Bottomley" <jejb@parisc-linux.org>,
	Jonas Bonn <jonas@southpole.se>, Lennox Wu <lennox.wu@gmail.com>,
	Ley Foon Tan <lftan@altera.com>,
	alpha <linux-alpha@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>,
	"open list:METAG ARCHITECTURE" <linux-metag@vger.kernel.org>,
	Linux MIPS Mailing List <linux-mips@linux-mips.org>,
	Parisc List <linux-parisc@vger.kernel.org>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	Russell
Subject: Re: [patch V3] lib: GCD: add binary GCD algorithm
Date: Thu, 28 Apr 2016 20:11:32 +0200	[thread overview]
Message-ID: <CAMuHMdUBWqdyS4w7EKsnvQLXJVgQh624AQsjgQvxT9FRW4s_6g__35908.0639821061$1461867106$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <20160428175843.GZ21636@brightrain.aerifal.cx>

On Thu, Apr 28, 2016 at 7:58 PM, Rich Felker <dalias@libc.org> 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 <linux@horizon.com> 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 support it.
>>
>> Logical OR is easier in both the Kconfig and C preprocessor languages
>> than logical NAND.
>>
>> E.g. in Kconfig, a CPU core not supporting it can just select
>> CPU_NO_EFFICIENT_FFS.
>
> 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, and otherwise one of the binary-search type
> approaches (possibly branchless) can be used. If the compiler doesn't
> generate an appropriate one for __builtin_ctz, that's arguably a
> compiler bug.

m68k-linux-gcc 4.6.3 generates:

        jsr __ctzsi2

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2016-04-28 18:11 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 11:43 [patch V3] lib: GCD: add binary GCD algorithm zengzhaoxiu
2016-04-28 11:43 ` zengzhaoxiu at 163.com
2016-04-28 11:43 ` zengzhaoxiu
2016-04-28 11:43 ` zengzhaoxiu
2016-04-28 11:43 ` zengzhaoxiu
2016-04-28 12:18 ` kbuild test robot
2016-04-28 12:18   ` kbuild test robot
2016-04-28 12:18   ` kbuild test robot
2016-04-28 12:18   ` kbuild test robot
2016-04-28 12:18   ` kbuild test robot
2016-04-28 12:18   ` kbuild test robot
2016-04-28 16:48 ` George Spelvin
2016-04-28 16:48   ` George Spelvin
2016-04-28 16:48   ` George Spelvin
2016-04-28 16:48   ` George Spelvin
2016-04-28 17:51   ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:51     ` Geert Uytterhoeven
2016-04-28 17:58     ` Rich Felker
2016-04-28 17:58     ` Rich Felker
2016-04-28 17:58       ` Rich Felker
2016-04-28 17:58       ` Rich Felker
2016-04-28 17:58       ` Rich Felker
2016-04-28 17:58       ` Rich Felker
2016-04-28 17:58       ` Rich Felker
2016-04-28 17:58       ` Rich Felker
2016-04-28 18:11       ` Geert Uytterhoeven [this message]
2016-04-28 18:11       ` Geert Uytterhoeven
2016-04-28 18:11         ` Geert Uytterhoeven
2016-04-28 18:11         ` Geert Uytterhoeven
2016-04-28 18:11         ` Geert Uytterhoeven
2016-04-28 18:11         ` Geert Uytterhoeven
2016-04-28 18:11         ` Geert Uytterhoeven
2016-04-28 18:11         ` Geert Uytterhoeven
2016-04-28 19:15       ` George Spelvin
2016-04-28 19:15       ` George Spelvin
2016-04-28 19:15         ` George Spelvin
2016-04-28 19:15         ` George Spelvin
2016-04-28 19:15         ` George Spelvin
2016-04-28 19:54   ` Sam Ravnborg
2016-04-28 19:54   ` Sam Ravnborg
2016-04-28 19:54     ` Sam Ravnborg
2016-04-28 19:54     ` Sam Ravnborg
2016-04-28 19:54     ` Sam Ravnborg
2016-04-28 19:54     ` Sam Ravnborg
2016-04-28 16:48 ` George Spelvin
2016-04-28 17:10 ` Josh Juran
2016-04-28 17:10   ` Josh Juran
2016-04-28 17:10   ` Josh Juran
2016-04-28 17:10   ` Josh Juran
2016-04-28 17:10   ` Josh Juran
2016-04-28 17:10   ` Josh Juran
2016-04-28 17:10 ` Josh Juran
2016-04-28 17:22 ` James Bottomley
2016-04-28 17:22 ` James Bottomley
2016-04-28 17:22   ` James Bottomley
2016-04-28 17:22   ` James Bottomley
2016-04-28 17:22   ` James Bottomley
2016-04-28 17:22   ` James Bottomley
2016-04-28 21:21 ` George Spelvin
2016-04-28 21:46 ` David Miller
2016-04-28 23:15 ` George Spelvin
2016-05-20 10:27 ` kbuild test robot
2016-05-20 10:27   ` kbuild test robot
2016-05-20 10:27   ` kbuild test robot
2016-05-20 10:27   ` kbuild test robot
2016-05-20 10:27   ` kbuild test robot
2016-05-20 10:27   ` kbuild test robot
2016-05-20 10:27 ` kbuild test robot
2016-04-28 11:43 zengzhaoxiu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMuHMdUBWqdyS4w7EKsnvQLXJVgQh624AQsjgQvxT9FRW4s_6g__35908.0639821061$1461867106$gmane$org@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=akpm@linux-foundation.org \
    --cc=dalias@libc.org \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=james.hogan@imgtec.com \
    --cc=jejb@parisc-linux.org \
    --cc=jonas@southpole.se \
    --cc=lennox.wu@gmail.com \
    --cc=lftan@altera.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-metag@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=peterz@infradead.org \
    --cc=zengzhaoxiu@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.