[Info-vax] Microsoft: Alpha architecture responsible for poor Windows file compression
Chris
xxx.syseng.yyy at gfsys.co.uk
Thu Nov 3 11:13:53 EDT 2016
On 11/03/16 06:14, Bob Gezelter wrote:
>
> Actually, setting/clearing a bit is straightforwardly accomplished
using a shift (or table lookup) and the standard logical instructions
(e.g., AND, OR, NOT, XOR).
>
> Spent a fair amount of time deriving what would now probably be
called "templates" for so-called "bit twiddling" on IBM System/360
and DEC PDP-11, neither of which had purposely designed instructions.
>
> For example, on a PDP-11, one could do a bit count for a 16-bit
word with two registers in seven instructions without branches with
a 16-word auxiliary table. On the System/360, one could do a 32-bit
word in a few more instructions.
>
> The non-aligned operations added to Alpha make some things slightly
more efficient, but I would not want to place any bets on how much
faster in the referenced example.
>
> - Bob Gezelter, http://www.rlgsc.com
I guess you could just write macros in asm or C to encapsulate that
for you. At least for embedded work, it's often much faster
to use table lookup methods to do bit translation. For example, a 256
byte table to translate an input bit pattern to required output, with
the input pattern as the address into the table. May have seemed a bit
extravagant in the old days of small memory, but not now and is much
more flexible than trying to implement using algorithmic methods...
Chris
More information about the Info-vax
mailing list