login
Header Space

 
 

Re: [PATCH] x86: merge the simple bitops and move them to bitops.h

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Kleen <andi@...>
Cc: Jeremy Fitzhardinge <jeremy@...>, Alexander van Heukelum <heukelum@...>, Ingo Molnar <mingo@...>, Andi Kleen <andi@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, LKML <linux-kernel@...>
Date: Friday, March 14, 2008 - 5:33 pm

On Fri, 14 Mar 2008 20:55:20 +0100, "Andi Kleen" <andi@firstfloor.org>
said:

Hi Andi,

I guess you are right. But there is quite a big number of different
types of P4. Let's see what the current situation is... defconfigs
(of current x86#testing+this patch/current linus) with
CONFIG_GENERIC_CPU=n:

Athlon: 4764 / 4667 occurences of cmovxx
Pentium-IV: 4079 / 3982 occurences of cmovxx
Pentium-M: 3939 / 3841 occurences of cmovxx
Core-2: 4335 / 4330 occurences of cmovxx

So it adds a few percent extra cmovxx's. The last one is fishy...
But I'm too hungry and sleepy to go hunt that one down.


Generic is maybe not the right term: asm-generic/bitops/fls64.h has:

static inline int fls64(__u64 x)
{
        __u32 h = x >> 32;
        if (h)
                return fls(h) + 32;
        return fls(x);
}

I just wanted to move the 64-bit version to that header, with some
ifdefs to select the right one.


In fact I just found out that it only had an effect for 64 bit
machines. Still, setting it unconditionally feels wrong.


It could. But it is a trivial (slow?) implementation. Probably fine
for the uses in pci-calgary_64.c and pci-gart_64.c (small ranges?),
but I would worry about people using it, thinking it was a near-
optimal implementation.

Greetings,
    Alexander
-- 
  Alexander van Heukelum
  heukelum@fastmail.fm

-- 
http://www.fastmail.fm - IMAP accessible web-mail

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: merge the simple bitops and move them to bitops.h, Alexander van Heukelum, (Wed Mar 12, 4:01 pm)
Re: [PATCH] x86: merge the simple bitops and move them to bi..., Jeremy Fitzhardinge, (Fri Mar 14, 2:07 pm)
Re: [PATCH] x86: merge the simple bitops and move them to bi..., Alexander van Heukelum, (Fri Mar 14, 3:43 pm)
Re: [PATCH] x86: merge the simple bitops and move them to bi..., Jeremy Fitzhardinge, (Fri Mar 14, 5:15 pm)
[PATCH v2] x86: merge the simple bitops and move them to bit..., Alexander van Heukelum, (Fri Mar 14, 4:35 pm)
[PATCH v3] x86: merge the simple bitops and move them to bit..., Alexander van Heukelum, (Sat Mar 15, 8:04 am)
Re: [PATCH] x86: merge the simple bitops and move them to bi..., Alexander van Heukelum, (Fri Mar 14, 5:33 pm)
K8, EFFICEON and CORE2 support the cmovxx instructions., Alexander van Heukelum, (Sat Mar 15, 3:19 pm)
Re: K8, EFFICEON and CORE2 support the cmovxx instructions., Alexander van Heukelum, (Sat Mar 15, 5:06 pm)
[PATCH] x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 suppor..., Alexander van Heukelum, (Sun Mar 16, 9:16 am)
Re: [PATCH] x86: merge the simple bitops and move them to bi..., Alexander van Heukelum, (Fri Mar 14, 6:01 pm)
Re: [PATCH] x86: merge the simple bitops and move them to bi..., Alexander van Heukelum, (Sat Mar 15, 1:54 pm)
speck-geostationary