On Thu, 2006-11-30 at 09:51 -0800, Aleksandar Donev wrote:
> Hello,
> Does anyone know of faster ways to interweave bits from 2 or 3 integers (the
> total number of result bits being less than 32, say)? The obvious way of
> looping over the bits and shifting them one by one is easy to do, but there
> may be a faster trick. Also the reverse operation, breaking up a bit string
> into "even" and "odd" bits?
Derek Zave developed a clever way to do this in the University of
Maryland assembler for the Univac 1108. It relied on the "masked load
upper" instruction. I doubt that's what Aleks has in mind, but there
may be something about Zave's method that is independent of this
specific instruction. Unfortunately, Derek is gone, and I don't know
where to get source code for MASM.
--
Van Snyder | What fraction of Americans believe
[log in to unmask] | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.
|