[comp.arch] Population count instruction

jaw@eos.UUCP (James A. Woods) (11/03/88)

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 ...

baum@Apple.COM (Allen J. Baum) (11/04/88)

[]
>In article <1854@eos.UUCP> jaw@eos.UUCP (James A. Woods) writes:
>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 ...

Do you have any references to the AVL? This is the first I've heard of it.
This sounds very similar to the HARVEST co-processor for the IBM-STRETCH,
again, developed with NSA funds. For those of you that want to know what the
ultimate in CISC is, you should take a look at this machine!
--
		  baum@apple.com		(408)974-3385
{decwrl,hplabs}!amdahl!apple!baum

kers@otter.hple.hp.com (Christopher Dollin) (11/04/88)

Re the ARM -

The gentleman at Praxis (just "down the road") said the ARM has delayed
jumps - it doesn't.

Regards,    | "You're better off   not dreaming of   the things to come 
Kers.       | Dreams   are always ending   far too soon."

pmk@hall.cray.com (Peter Klausler) (11/04/88)

In article <1854@eos.UUCP>, jaw@eos.UUCP (James A. Woods) writes:
> 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 ...

I hate to spoil a good conspiracy story, but:

	1) "Second vector logical" is the ability to use the FP multiply
unit as a spare logical unit; it works on all but the earliest X-MPs and Y-MPs,
except maybe the SE machines. The feature is enabled by having the OS set a bit
in your exchange package.

	2) Vector popcount and popcount-parity execute only in the Vector
Pop/Parity unit; they can't use the "second vector logical" feature.
Neither can vector mask instructions, so the feature is really useful
only for basic vector ANDs, ORs, and such.

-Peter Klausler / Cray Research compiler development / Mendota Heights, MN