Instead bit-shifting to 'place' the bits where we want them to be and
adding Lisp provides the DPB function that allows us to deposit bits
where we want them in an integer.
The int decoder does the same work as its corresponding uint decoder
before encoding the integer in Two's complement. We can re-use the
uint decoder instead of writing the same code in the corresponding int
decoder.
Instead of Shifting bits and masking in order to extract a subset of
the bits Lisp provides the function LBD, which allows us to extract a
number of bits from an integer. This approach is more direct,
communicates the intent better and allows the compiler to do less work.
Instead bit-shifting to 'place' the bits where we want them to be and
adding Lisp provides the DPB function that allows us to deposit bits
where we want them in an integer.
The int decoder does the same work as its corresponding uint decoder
before encoding the integer in Two's complement. We can re-use the
uint decoder instead of writing the same code in the corresponding int
decoder.
Instead of Shifting bits and masking in order to extract a subset of
the bits Lisp provides the function LBD, which allows us to extract a
number of bits from an integer. This approach is more direct,
communicates the intent better and allows the compiler to do less work.
encode-int32 and decode-int32 should work for allegro, using a patch from Vincent Akkermans.
darcs-hash:20070226152053-2648a-ebccfc38619ab82bb8572b66e69d95dd12d658a3.gz