Handbook
Glossary
optimize-modular-arithmetic* ( node -- nodes )
Vocabulary
compiler
.
tree
.
modular-arithmetic
Inputs
node
an
object
Outputs
nodes
an
object
Definition
IN:
compiler.tree.modular-arithmetic
GENERIC:
optimize-modular-arithmetic*
( node -- nodes )
Methods
USING:
combinators
compiler.tree
compiler.tree.modular-arithmetic
kernel
;
M:
#call
optimize-modular-arithmetic*
{
{
[
dup
like->fixnum?
]
[
optimize->fixnum
]
}
{
[
dup
like->integer?
]
[
optimize->integer
]
}
{
[
dup
modular-word?
]
[
optimize-modular-op
]
}
{
[
dup
low-order-word?
]
[
optimize-low-order-op
]
}
[
]
}
cond
;
USING:
accessors
combinators.short-circuit
compiler.tree
compiler.tree.modular-arithmetic
kernel
math
sequences
;
M:
#push
optimize-modular-arithmetic*
dup
{
[
out-d>>
first
modular-value?
]
[
literal>>
real?
]
}
1&&
[
[
>fixnum
]
change-literal
]
when
;
USING:
compiler.tree
compiler.tree.modular-arithmetic
;
M:
node
optimize-modular-arithmetic*
;