Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!eos!jaw From: jaw@eos.UUCP (James A. Woods) Newsgroups: comp.arch Subject: Population count instruction (was Re: RISC v. CISC ...) Message-ID: <1854@eos.UUCP> Date: 2 Nov 88 21:04:29 GMT References: <1622@scolex> Organization: NASA Ames Research Center, California Lines: 21 From article <1622@scolex>, by seanf@sco.COM (Sean Fagan): > > Count the set bits in a word (register or memory, it doesn't > matter). Very useful for some trivial applications (such as playing > Othello), but I haven't seen much else done with it. It was put in, it > looks like, because the hardware was already there (in the form of parity > checking), but I could be wrong. > The old CDC 6000 series/Cyber/Cray "count ones" instruction story gets replayed here every so often, but bears repeating. Seymour Cray was asked about the motivation for this op code, and said, without further elaboration -- "The NSA made me do it." When one realizes that an XOR of two words followed by population count yields Hamming distance, allegedly very important in crypto work, this makes sense. Even more eyebrow raising is the related AVL (additional vector logical) unit available for certain Cray serial numbers, which amplifies tricks like the above by sixty-four. This second logical vector unit, again an NSA-only custom add-on device, might also help such a machine play a mean game of chess, but that's a different conspiracy theory ...