login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
14
Re: [PATCH] x86: merge the simple bitops and move them to bitops.h
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jeremy Fitzhardinge
Subject:
Re: [PATCH] x86: merge the simple bitops and move them to bitops.h
Date: Friday, March 14, 2008 - 2:15 pm
Alexander van Heukelum wrote:
quoted text
> On Fri, 14 Mar 2008 11:07:55 -0700, "Jeremy Fitzhardinge" > <jeremy@goop.org> said: > >> Alexander van Heukelum wrote: >> >>> x86: merge the simple bitops and move them to bitops.h >>> >>> Some of those can be written in such a way that the same >>> inline assembly can be used to generate both 32 bit and >>> 64 bit code. >>> >>> For ffs and fls, x86_64 unconditionally used the cmov >>> instruction and i386 unconditionally used a conditional >>> branch over a mov instruction. In the current patch I >>> chose to select the version based on the availability >>> of the cmov instruction instead. A small detail here is >>> that x86_64 did not previously set CONFIG_X86_CMOV=y. >>> >>> >> Looks good in general. What's left in bitops_{32,64}.h now? >> > > 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. > > >> (Some comments below.) >> > > --- %< --- > > >>> +#ifdef __KERNEL__ >>> +/** >>> + * ffs - find first bit set >>> + * @x: the word to search >>> + * >>> + * This is defined the same way as >>> + * the libc and compiler builtin ffs routines, therefore >>> + * differs in spirit from the above ffz() (man ffs). >>> >> This comment seems wrong. My "man ffs" says that it returns 1-32 for >> non-zero inputs, and 0 for a zero input. This function returns 0-31, or >> -1 for a zero input. >> > > Seems, indeed. You missed the "return r + 1;" ;-) >
Indeed I did. J --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
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)
Re: [PATCH] x86: merge the simple bitops and move them to ...
, Andi Kleen
, (Fri Mar 14, 12:55 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 ...
, Andi Kleen
, (Fri Mar 14, 2:42 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ...
, Alexander van Heukelum
, (Fri Mar 14, 3:01 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ...
, Andi Kleen
, (Fri Mar 14, 3:18 pm)
Re: [PATCH v2] x86: merge the simple bitops and move them ...
, Randy Dunlap
, (Fri Mar 14, 4:30 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.
, H. Peter Anvin
, (Sat Mar 15, 1:18 pm)
Re: K8, EFFICEON and CORE2 support the cmovxx instructions.
, Alexander van Heukelum
, (Sat Mar 15, 2:06 pm)
Re: K8, EFFICEON and CORE2 support the cmovxx instructions.
, Willy Tarreau
, (Sat Mar 15, 2:11 pm)
[PATCH] x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 supp ...
, Alexander van Heukelum
, (Sun Mar 16, 6:16 am)
Re: [PATCH v3] x86: merge the simple bitops and move them ...
, Ingo Molnar
, (Fri Mar 21, 5:35 am)
Re: [PATCH] x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 ...
, Ingo Molnar
, (Fri Mar 21, 5:38 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mel Gorman
Re: [PATCH 1/4] vmstat: remove zone->lock from walk_zones_in_node
Guenter Roeck
Re: [lm-sensors] Location for thermal drivers
David Woodhouse
Re: RFC: Moving firmware blobs out of the kernel.
Siddha, Suresh B
Re: [PATCH 2.6.21 review I] [11/25] x86: default to physical mode on hotplug CPU k...
Peter Zijlstra
Re: [patch 4/6] mm: merge populate and nopage into fault (fixes nonlinear)
git-commits-head
:
Linux Kernel Mailing List
[MIPS] Fix potential latency problem due to non-atomic cpu_wait.
Linux Kernel Mailing List
USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS
Linux Kernel Mailing List
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Linux Kernel Mailing List
[Bluetooth] Initiate authentication during connection establishment
Linux Kernel Mailing List
[POWERPC] 4xx: Add ppc40x_defconfig
linux-netdev
:
MERCEDES
Your mail id has won 950,000.00 in the MERCEDES Benz Online Promo.for claims send:
David Miller
Re: [PATCH] xen/netfront: do not mark packets of length < MSS as GSO
David Miller
Re: skb_segment() questions
Shan Wei
[RFC PATCH net-next 2/5]IPv6:netfilter: Send an ICMPv6 "Fragment Reassembly Timeou...
Stanislaw Gruszka
[PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations
git
:
Nicolas Sebrecht
git-svn died of signal 11 (was "3 failures on test t9100 (svn)")
Junio C Hamano
Re: [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
Martin Langhoff
Re: [PATCH] GIT commit statistics.
Alexandre Julliard
[PATCH] gitweb: Put back shortlog instead of graphiclog in the project list.
Josh Triplett
[PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
openbsd-misc
:
Taisto Qvist XX
Re: AMD GEODE LX-800 just works with kernel from install42.iso and kernelpanics wi...
Nico Meijer
Re: gOS Develop Kit with VIA pc-1 Processor Platform VIA C7-D
Andreas Bihlmaier
Re: jetway board sensors (Fintek F71805F)
admin
Drive a 2009 car from R799p/m
Antti Harri
Re: how to create a sha256 hash
Colocation donated by:
Syndicate