Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Message-ID | <4E666B47.9020009@bitblocks.com> (permalink) |
|---|---|
| Date | 2011-09-06 11:49 -0700 |
| From | Bakul Shah <usenet@bitblocks.com> |
| Newsgroups | comp.arch |
| Subject | Re: Bit Interleaving, Instruction Set Support for |
| References | <4E655A0D.40509@SPAM.comp-arch.net> <j452o8$6sn$1@news.task.gda.pl> |
| Organization | Sonic.Net |
On 9/6/11 5:12 AM, Piotr Wyderski wrote: > Andy "Krazy" Glew wrote: > > Thanks for starting the thread, as bit operations are of vital importance in my low-level > algorithms. Apart the operations > mentioned previously, I would like to have the following instruction: > > bit_chunk_check(x, n): > > where x is an unsigned integer and n is a positive integer. > The instruction checks whether x contains a chunk of n consecutive > set bits and returns an index of the first/last/some such a chunk. > It is a generalization of bsf/bsr. Kind of a run-length-encoding. Would be neat if you could deal with a bunch of bits. The result would be a count of alternating zeroes and ones. So for example: value result (four 8-bit values in decimal) 0 32,0,0,0 ; 32 zeroes, 0 ones -1 0,32,0,0 ; 0 zeroes, 32 ones 257 23,1,7,1 ; 13 27,1,1,1 ; actual encoding: 27,1,1,1,1,1 but only the first 4 can be returned Also need a clz (clear leading zeroes) to pick up for example the last two runs of 13 in the next round. Very useful in array programming. A == B will yield a bitmap where A[i] == B[i]. To then pick up those values from A or B (or another related array) you need indices of places where A & B match. Probably not doable in one cycle. But even knocking off one run of zeroes and one of ones can be handy.
Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-05 16:23 -0700
Re: Bit Interleaving, Instruction Set Support for Mark Thorson <nospam@sonic.net> - 2011-09-05 20:07 -0800
Re: Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-05 21:25 -0700
Re: Bit Interleaving, Instruction Set Support for Andrew Reilly <areilly---@bigpond.net.au> - 2011-09-06 05:09 +0000
Re: Bit Interleaving, Instruction Set Support for torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-09-06 10:20 +0200
Re: Bit Interleaving, Instruction Set Support for Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-09-06 13:28 +0200
Re: Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-06 11:29 -0700
Re: Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-06 11:21 -0700
Re: Bit Interleaving, Instruction Set Support for timcaffrey@aol.com (Tim McCaffrey) - 2011-09-09 19:10 +0000
Re: Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-10 12:50 -0700
Re: Bit Interleaving, Instruction Set Support for torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-09-13 10:34 +0200
Re: Bit Interleaving, Instruction Set Support for Mark Thorson <nospam@sonic.net> - 2011-09-07 12:43 -0800
Re: Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-10 12:27 -0700
Re: Bit Interleaving, Instruction Set Support for "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-09-11 21:05 -0700
Re: Bit Interleaving, Instruction Set Support for EricP <ThatWouldBeTelling@thevillage.com> - 2011-09-10 16:57 -0400
Re: Bit Interleaving, Instruction Set Support for George Neuner <gneuner2@comcast.net> - 2011-09-10 23:14 -0400
Re: Bit Interleaving, Instruction Set Support for nmm1@cam.ac.uk - 2011-09-11 10:16 +0100
Re: Bit Interleaving, Instruction Set Support for EricP <ThatWouldBeTelling@thevillage.com> - 2011-09-11 12:30 -0400
Re: Bit Interleaving, Instruction Set Support for Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-09-06 13:25 +0200
Re: Bit Interleaving, Instruction Set Support for Quadibloc <jsavard@ecn.ab.ca> - 2011-09-05 21:02 -0700
Re: Bit Interleaving, Instruction Set Support for Piotr Wyderski <peter.pan@neverland.mil> - 2011-09-06 14:12 +0200
Re: Bit Interleaving, Instruction Set Support for Bakul Shah <usenet@bitblocks.com> - 2011-09-06 11:49 -0700
Re: Bit Interleaving, Instruction Set Support for Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-09-07 11:18 +0200
Re: Bit Interleaving, Instruction Set Support for Thomas Womack <twomack@chiark.greenend.org.uk> - 2011-09-07 10:54 +0100
Re: Bit Interleaving, Instruction Set Support for Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-09-07 20:27 +0200
Re: Bit Interleaving, Instruction Set Support for MitchAlsup <MitchAlsup@aol.com> - 2011-09-07 12:23 -0700
csiph-web