From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 115614,e489d6e4973d889f X-Google-Attributes: gid115614,public X-Google-Thread: 102b75,e489d6e4973d889f X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,e489d6e4973d889f X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2001-08-29 10:40:51 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!148.122.208.68!news2.oke.nextra.no!nextra.com!hydro.com!not-for-mail From: Terje Mathisen Newsgroups: comp.arch,comp.sys.dec,comp.unix.aix Subject: Re: Can POWER4, 5 etc continue where Alpha was stopped? Date: Wed, 29 Aug 2001 19:30:32 +0200 Organization: Hydro Message-ID: <3B8D26B8.5467626B@hda.hydro.com> References: <88525dde.0108260914.7c63d8c3@posting.google.com> <9mgps0$12ee$1@ausnews.austin.ibm.com> <9mhbh0$pbq$1@ausnews.austin.ibm.com> <3B8C8AC4.59ED22CB@hda.hydro.com> NNTP-Posting-Host: iabrahmspc.nho.hydro.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: archiver1.google.com comp.arch:15926 comp.sys.dec:6784 comp.unix.aix:22749 George Coulouris wrote: > > Terje Mathisen wrote: > [snip] > > >popcount() is also useful, mostly when working with bitmaps. > > > >A possible use would be for SQL runtime optimization, when joining > >bitmaps to determine the best evaluation order. > > > >I suspect that NSA could use it as a quick way to detect patterns that > >significantly differ from purely random bitstreams? > > > >Terje > > Wouldn't popcount(a xor b) give the Hamming distance between two code words? Right, this is a specific example of what I mentioned. Terje PS. My SQL example isn't really that good, because when working with _big_ bitmaps, not just one or a few registers worth of bits, there are algorithms which perform very well even without a bitcount() opcode. I believe it was Robert Harley who first showed me how you could use bitslice operations to combine 15 64-bit words into just 4, and then do the popcount() on each of those in paralell. The resulting code runs at about 1-2 cycles/word, depending upon how many operations the cpu can handle per cycle. So, for the popcount opcode to be a win, it must allow superscalar execution and at least one result per cycle. Terje -- - Using self-discipline, see http://www.eiffel.com/discipline "almost all programming can be viewed as an exercise in caching"