From: Finn Thain <fthain@telegraphics.com.au>
To: gerg@snapgear.com
Cc: linux-m68k@vger.kernel.org, uclinux-dev@uclinux.org,
Greg Ungerer <gerg@uclinux.org>
Subject: Re: [PATCH] m68k: merge mmu and non-mmu bitops.h
Date: Fri, 3 Jun 2011 21:02:51 +1000 (EST) [thread overview]
Message-ID: <alpine.OSX.2.00.1106032050380.193@ibook.intranet> (raw)
In-Reply-To: <1307083883-10786-1-git-send-email-gerg@snapgear.com>
>
> +#if defined(CONFIG_M68000) || defined(CONFIG_MCPU32) || defined(CONFIG_COLDFIRE)
> +
> +/*
> + * The newer ColdFire family members support a "bitrev" instruction
> + * and we can use that to implement a fast ffs. Older Coldfire parts,
> + * and normal 68000 parts don't have anything special, so we use the
> + * generic functions for those.
> + */
> +#if (defined(__mcfisaaplus__) || defined(__mcfisac__)) && \
> + !defined(CONFIG_M68000) && !defined(CONFIG_MCPU32)
Aren't the !defined(CONFIG_M68000) && !defined(CONFIG_MCPU32) terms
redundant?
Finn
> +static inline int __ffs(int x)
> +{
> + __asm__ __volatile__ ("bitrev %0; ff1 %0"
> + : "=d" (x)
> + : "0" (x));
> + return x;
> +}
> +
> +static inline int ffs(int x)
> +{
> + if (!x)
> + return 0;
> + return __ffs(x) + 1;
> +}
> +
> +#else
> +#include <asm-generic/bitops/ffs.h>
> +#include <asm-generic/bitops/__ffs.h>
> +#endif
> +
> +#include <asm-generic/bitops/fls.h>
> +#include <asm-generic/bitops/__fls.h>
> +
> #else
>
next prev parent reply other threads:[~2011-06-03 11:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 6:51 [PATCH] m68k: merge mmu and non-mmu bitops.h gerg
2011-06-03 11:02 ` Finn Thain [this message]
2011-06-03 11:10 ` Greg Ungerer
-- strict thread matches above, loose matches on Subject: below --
2011-06-24 5:45 gerg
2011-06-26 12:21 ` Geert Uytterhoeven
2011-06-27 2:10 ` Greg Ungerer
2011-06-23 1:28 gerg
2011-06-23 17:30 ` Geert Uytterhoeven
2011-06-24 5:12 ` Greg Ungerer
2011-05-18 5:32 gerg
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=alpine.OSX.2.00.1106032050380.193@ibook.intranet \
--to=fthain@telegraphics.com.au \
--cc=gerg@snapgear.com \
--cc=gerg@uclinux.org \
--cc=linux-m68k@vger.kernel.org \
--cc=uclinux-dev@uclinux.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox