login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
19
Re: [PATCH 1/2] bitreversal program
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Harvey Harrison <harvey.harrison@...>
To: Soumyadip Das Mahapatra <kernelhacker@...>
Cc: <linux-kernel@...>, <akinobu.mita@...>
Subject:
Re: [PATCH 1/2] bitreversal program
Date: Monday, May 19, 2008 - 4:42 pm
On Mon, 2008-05-19 at 19:04 +0200, Soumyadip Das Mahapatra wrote:
quoted text
> --- a/include/linux/bitrev.h 2008-04-17 08:19:44.000000000 +0530 > +++ b/include/linux/bitrev.h 2008-05-19 21:49:46.000000000 +0530 > @@ -3,11 +3,32 @@ > > #include <linux/types.h> > > -extern u8 const byte_rev_table[256]; > +/** > + * Here is a generalised bit reversal program > + * @x: word to get bits reversed > + * @k: key, explained below > + * for k = 31, it reverses the bits of word(32 bit) > + * for k = 24, it reverses the bytes in word > + * for k = 7, it reverses the bits in every byte without > + * changing the positions of bytes in a word > + * and for k = 16 it swaps the left and right halves of a > + * word > + */ > > -static inline u8 bitrev8(u8 byte)
What about anybody who currently uses bitrev8?
quoted text
> +static inline u32 gen_bit_rev(u32 x, u32 k) > { > - return byte_rev_table[byte]; > + if(k & 1) > + x = (x & 0x55555555) << 1 | (x & 0xaaaaaaaa) >> 1; > + if(k & 2) > + x = (x & 0x33333333) << 2 | (x & 0xcccccccc) >> 2; > + if(k & 4) > + x = (x & 0x0f0f0f0f) << 4 | (x & 0xf0f0f0f0) >> 4; > + if(k & 8) > + x = (x & 0x00ff00ff) << 8 | (x & 0xff00ff00) >> 8; > + if(k & 16) > + x = (x & 0x0000ffff) << 16 | (x & 0xffff0000) >> 16; > + > + return x; > }
Why is this better than a single 256 byte table? Harvey --
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 1/2] bitreversal program
, Soumyadip Das Mahapatra
, (Mon May 19, 1:04 pm)
Re: [PATCH 1/2] bitreversal program
, Harvey Harrison
, (Mon May 19, 4:42 pm)
Re: [PATCH 1/2] bitreversal program
, Soumyadip Das Mahapatra
, (Tue May 20, 7:01 am)
Re: [PATCH 1/2] bitreversal program
, Akinobu Mita
, (Tue May 20, 8:13 am)
Re: [PATCH 1/2] bitreversal program
, Soumyadip Das Mahapatra
, (Tue May 20, 11:25 am)
Re: [PATCH 1/2] bitreversal program
, Tilman Schmidt
, (Wed May 21, 12:52 pm)
Re: [PATCH 1/2] bitreversal program
, Benoit Boissinot
, (Tue May 20, 11:47 am)
Re: [PATCH 1/2] bitreversal program
, Soumyadip Das Mahapatra
, (Tue May 20, 11:57 am)
Re: [PATCH 1/2] bitreversal program
, Benoit Boissinot
, (Tue May 20, 12:39 pm)
Re: [PATCH 1/2] bitreversal program
, Soumyadip Das Mahapatra
, (Wed May 21, 4:54 am)
Re: [PATCH 1/2] bitreversal program
, Rene Herman
, (Wed May 21, 7:11 am)
Re: [PATCH 1/2] bitreversal program
, Benoit Boissinot
, (Wed May 21, 5:11 am)
Re: [PATCH 1/2] bitreversal program
, John Hubbard
, (Tue May 20, 2:53 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Tony Lindgren
[PATCH 26/90] ARM: OMAP: abstract debug card setup (smc, leds)
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Vladislav Bolkhovitin
Re: Integration of SCST in the mainstream Linux kernel
Jesper Juhl
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
git
:
linux-netdev
:
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
Frans Pop
svc: failed to register lockdv1 RPC service (errno 97).
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
3 users
and
853 guests
online.
Online users
zeekec
Jeremy
timsmithfields
Syndicate