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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexander van Heukelum
Date: Friday, March 14, 2008 - 12:43 pm

On Fri, 14 Mar 2008 11:07:55 -0700, "Jeremy Fitzhardinge"
<jeremy@goop.org> said:

Thanks for taking a look!

bitops_{32,64}.h are getting pretty empty ;)

Both contain find_first_bit/find_first_zero_bit, i386 has them inlined,
x86_64 has an ugly define to select between small bitmaps (inlined) and
an out-of-line version. I think they should be unified much like how
find_next_bit and find_next_zero_bit work now (in x86#testing).

Both define fls64(), but i386 uses a generic one and x86_64 defines
one all by itself. The generic one is currently not suitable for
use by 64-bit archs... that can change.

x86_64 defines ARCH_HAS_FAST_MULTIPLIER, i386 not. This affects a
choice of generated code in the (generic) hweight function. It would
be nice if that could move to some other file.

x86_64 has a mysterious inline function set_bit_string, which is
only used by pci-calgary_64.c and pci-gart_64.c. Not sure what to
do with it.


--- %< ---


Seems, indeed. You missed the "return r + 1;" ;-)


The comment rightly mentions that ffs differs in spirit from the rest
of the functions here. The type to be used here it always a 4-byte one
(int); most other functions operate on longs. I have not checked if the
explicit size is absolutely necessary, but I feel much safer with the
explicit size there.


I'll see if I can come up with something better.

Greetings,
    Alexander

-- 
  Alexander van Heukelum
  heukelum@fastmail.fm

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

--
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, 1:01 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Jeremy Fitzhardinge, (Fri Mar 14, 11:07 am)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Fri Mar 14, 12:43 pm)
[PATCH v2] x86: merge the simple bitops and move them to b ..., Alexander van Heukelum, (Fri Mar 14, 1:35 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Jeremy Fitzhardinge, (Fri Mar 14, 2:15 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Fri Mar 14, 2:33 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Fri Mar 14, 3:01 pm)
[PATCH v3] x86: merge the simple bitops and move them to b ..., Alexander van Heukelum, (Sat Mar 15, 5:04 am)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Sat Mar 15, 10:54 am)
K8, EFFICEON and CORE2 support the cmovxx instructions., Alexander van Heukelum, (Sat Mar 15, 12:19 pm)
Re: K8, EFFICEON and CORE2 support the cmovxx instructions., Alexander van Heukelum, (Sat Mar 15, 2:06 pm)
[PATCH] x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 supp ..., Alexander van Heukelum, (Sun Mar 16, 6:16 am)