When removing a redundant bitand (for example, in ``W*`` which does ``64
on-bits bitand``) make sure that we leave the ``>bignum`` to convert the
input integer to a bignum since the output type propagation assumes that
to be the case and we compiled the following code wrong.
: mult ( a b -- x ) [ 32 bits ] bi@ W* ;
Before:
\ mult optimized.
[
>R
4294967295 >R integer>fixnum R> fixnum-bitand
R>
4294967295 >R integer>fixnum R> fixnum-bitand fixnum*
]
After:
\ mult optimized.
[
>R
4294967295 >R integer>fixnum R> fixnum-bitand
R>
4294967295 >R integer>fixnum R> fixnum-bitand fixnum*
>bignum
]
in-d>> first2 [ value-info ] bi@ {
{
[ 2dup zero-bitand? ]
- [ 2drop [ 2drop 0 ] ]
+ [ nip class>> bignum = [ 2drop 0 >bignum ] [ 2drop 0 ] ? ]
}
{
[ 2dup swap zero-bitand? ]
- [ 2drop [ 2drop 0 ] ]
+ [ drop class>> bignum = [ 2drop 0 >bignum ] [ 2drop 0 ] ? ]
}
{
[ 2dup redundant-bitand? ]
- [ 2drop [ drop ] ]
+ [ nip class>> bignum = [ drop >bignum ] [ drop ] ? ]
}
{
[ 2dup swap redundant-bitand? ]
- [ 2drop [ nip ] ]
+ [ drop class>> bignum = [ nip >bignum ] [ nip ] ? ]
}
{
[ 2dup simplify-bitand? ]