[Top] [All Lists]

Re: [PATCH] MIPS: PowerTV: Use fls() carefully where static optimization

To: Shinya Kuribayashi <>
Subject: Re: [PATCH] MIPS: PowerTV: Use fls() carefully where static optimization is required
From: Ralf Baechle <>
Date: Tue, 6 Jul 2010 02:22:48 +0100
Cc: David VomLehn <>,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <>
User-agent: Mutt/1.5.20 (2009-08-17)
On Sat, Jul 03, 2010 at 11:31:44PM +0900, Shinya Kuribayashi wrote:

> On 07/03/2010 06:32 AM, David VomLehn wrote:
> > Usually it's better to control things on a feature-by-feature basis rather
> > than rely on things like CPU model. This allows you to easily handle case
> > where, for example, you have a different CPU that normally doesn't have
> > a feature but a particular variant does have it. IIRC, the MIPS family has
> > examples of this. So, I think it's better to go with the:
> >     __builtin_constant_p(cpu_has_clo_clz) && cpu_has_clo_clz
> > used in fls().
> Ok, now I've come to the same conclusion.  Revised patch will be like
> this.  Malta is a development platform supporting various types of
> MIPS32/MIPS64 cores, hence use cpu_has_clo_clz directly.  The same goes
> to MIPSSim.  
> Another concern is that, I'm not really sure whether cpu_has_clo_clz is
> acceptable or not for Malta (and MIPSSim).  Hopefully Ralf will help us
> make things in the right direction.

My grief with this patch at this moment is:

 o The suggestion of using __builtin_ffs or similar is nice but these
   functions appear to have introduced in GCC 3.4 but we unfortunately
   support GCC >= 3.2.
 o no Signed-off-by: line.  So can you sen me one?  Thanks


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