More identity folding for LOGAND and LOGIOR with constants
authorPaul Khuong <pvk@pvk.ca>
Fri, 7 Jun 2013 23:36:13 +0000 (19:36 -0400)
committerPaul Khuong <pvk@pvk.ca>
Sat, 8 Jun 2013 06:30:27 +0000 (02:30 -0400)
commit69018386b391f17fb722a4ded00474be182db355
treedc5fe24c70d3cfc166867856f0b33ce6eb43a4a3
parente4f3dfe7fefc2ab3980360ce597dc378c6b02393
More identity folding for LOGAND and LOGIOR with constants

 * Handle more complex cases than only powers of two:
   compare the variant argument with a power-of-two-sized
   prefix of the constant bit pattern.

 * Add parallel logic for LOGIOR: if all the ones we're ORing in
   are already set because the variant argument is a small enough
   negative integer, we've got an identity.

 * This is a bit hairy, so exhaustively check the logic with small
   values.
NEWS
src/compiler/srctran.lisp
tests/arith.pure.lisp