[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dr. Dobbs Dev. Update 1/5 July 94 & Schneier



>
>An interesting thought hit me when reading this.  The "classic"
>Cray series (Cray-1, X-MP, Y-MP) all have a rather curious instruction
>generally known as population count.  All it does is to take a register
>and count the number of one bits in it, and return that count.
>    ...
>Just a thought.  It's the only plausable use that I have yet thought of
>for this instruction.  Has anyone else got any ideas?

This instruction would be useful in all sorts of applications.  I was just
wishing I had such a thing only last week.  I had to write a little loop to
check the number of bits set in a word.  Each bit represented an action,
and in my particular case it was an error if more than 1 action was
requested.  The loop was really a waste when you consider that it could
have been done in 1 instruction.

tw