All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc64-dev@ozlabs.org, pantelis.antoniou@gmail.com,
	linuxppc-embedded@ozlabs.org, linuxppc-dev@ozlabs.org
Subject: Re: cpu features testing 32 vs 64 bit
Date: Fri, 9 Sep 2005 10:08:57 +1000	[thread overview]
Message-ID: <20050909000857.GC31045@localhost.localdomain> (raw)
In-Reply-To: <200509090036.39992.arnd@arndb.de>

On Fri, Sep 09, 2005 at 12:36:39AM +0200, Arnd Bergmann wrote:
> On Freedag 09 September 2005 00:02, Kumar Gala wrote:
> > 
> > On Sep 8, 2005, at 4:48 PM, Dan Malek wrote:
> > >
> > > If we #define CPU_FTR_xxx as a 0 or all 1's for processors that have
> > > or don't have these features, will the compiler be smart enough to
> > > recognize an always true or false condition and remove the
> > > test (or code as appropriate)?
> > 
> > The compiler is smart enough in this case since cpu_has_feature() is  
> > an inline function.
> 
> I actually wrote a patch that solves the problem in a very generic way,
> see http://patchwork.ozlabs.org/linuxppc/patch?id=1048 .
> I don't remember exactly if there were serious objections against
> the patch at that time, but it looks like a much cleaner solution to me
> than defining CPU_FTR_xxx to different values depending on the
> configuration.

And we already use a mechanism essentially identical to Arnd's for
fw_has_feature().

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/people/dgibson

  reply	other threads:[~2005-09-09  0:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-08 21:02 cpu features testing 32 vs 64 bit Becky Bruce
2005-09-08 21:08 ` Pantelis Antoniou
2005-09-08 21:20   ` Kumar Gala
2005-09-08 21:48     ` Dan Malek
2005-09-08 22:02       ` Kumar Gala
2005-09-08 22:20         ` Dan Malek
2005-09-08 22:36         ` Arnd Bergmann
2005-09-09  0:08           ` David Gibson [this message]
2005-09-09  4:23           ` [PATCH] powerpc: merge include/asm/cputable.h Arnd Bergmann
2005-09-14 19:11             ` Kumar Gala
2005-09-14 23:58               ` Arnd Bergmann
2005-09-15 17:44                 ` Kumar Gala
2005-09-15 22:56                   ` Arnd Bergmann
2005-09-16  2:22                     ` Kumar Gala
2005-09-16  3:11                       ` Arnd Bergmann
2005-09-16 21:40                         ` Kumar Gala
2005-09-17  0:36                           ` Arnd Bergmann
2005-09-09 22:19     ` cpu features testing 32 vs 64 bit Benjamin Herrenschmidt

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=20050909000857.GC31045@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=pantelis.antoniou@gmail.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.