compiler.tree.identities: the identity on mod was useless too, because we already have a rewrite rule which handles this case in compiler.tree.propagation

db4
Slava Pestov 2011-10-10 12:31:47 -07:00
parent b5fc65707d
commit 7bc38641f9
2 changed files with 6 additions and 4 deletions

View File

@ -29,10 +29,6 @@ SYMBOL: X
{ { 0 X } drop }
} define-identities
\ mod {
{ { X 1 } 0 }
} define-identities
\ bitand {
{ { X -1 } drop }
{ { -1 X } nip }

View File

@ -134,6 +134,12 @@ TUPLE: declared-fixnum { x fixnum } ;
] { mod fixnum-mod rem } inlined?
] unit-test
[ [ drop 0 ] ]
[ [ >integer 1 rem ] test-modular-arithmetic ] unit-test
[ [ drop 0 ] ]
[ [ >integer 1 mod ] test-modular-arithmetic ] unit-test
[ [ >fixnum 255 >R R> fixnum-bitand ] ]
[ [ >integer 256 rem ] test-modular-arithmetic ] unit-test