compiler.tree.propagation: fix both-fixnums? trick

db4
Slava Pestov 2010-05-02 16:22:08 -04:00
parent 7f6ae34d72
commit 0fbf454b18
2 changed files with 11 additions and 10 deletions

View File

@ -220,16 +220,6 @@ generic-comparison-ops [
2bi and maybe-or-never
] "outputs" set-word-prop
\ both-fixnums? [
node-input-infos first2 [ class>> ] bi@ {
{ [ 2dup [ fixnum classes-intersect? not ] either? ] [ [ 2drop f ] ] }
{ [ 2dup [ fixnum class<= ] both? ] [ [ 2drop t ] ] }
{ [ dup fixnum class<= ] [ [ drop fixnum? ] ] }
{ [ over fixnum class<= ] [ [ nip fixnum? ] ] }
[ f ]
} cond 2nip
] "custom-inlining" set-word-prop
{
{ >fixnum fixnum }
{ bignum>fixnum fixnum }

View File

@ -313,3 +313,14 @@ M\ set intersect [ intersect-quot ] 1 define-partial-eval
[ depends-on-definition ] [ heap-size '[ _ ] ] bi
] [ drop f ] if
] 1 define-partial-eval
! Eliminates a few redundant checks here and there
\ both-fixnums? [
in-d>> first2 [ value-info class>> ] bi@ {
{ [ 2dup [ fixnum classes-intersect? not ] either? ] [ [ 2drop f ] ] }
{ [ 2dup [ fixnum class<= ] both? ] [ [ 2drop t ] ] }
{ [ dup fixnum class<= ] [ [ drop fixnum? ] ] }
{ [ over fixnum class<= ] [ [ nip fixnum? ] ] }
[ f ]
} cond 2nip
] "custom-inlining" set-word-prop