Handbook
Glossary
optimize-insn ( insn -- )
Vocabulary
compiler
.
cfg
.
representations
.
peephole
Inputs
insn
an
object
Outputs
None
Definition
IN:
compiler.cfg.representations.peephole
GENERIC:
optimize-insn
( insn -- )
Methods
USING:
compiler.cfg.instructions
compiler.cfg.representations.peephole
compiler.cfg.representations.rewrite
kernel
;
M:
##bit-count
optimize-insn
[
no-use-conversion
]
[
finish
]
[
emit-def-conversion
]
tri
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##compare-integer-branch
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged?
]
}
1&&
]
[
unchanged
]
}
[
M\
##compare-integer-branch
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##compare-integer-imm-branch
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged-arithmetic?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
##compare-integer-imm-branch
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##compare-integer-imm
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged-arithmetic?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
##compare-integer-imm
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##compare-integer
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged?
]
}
1&&
]
[
unchanged
]
}
[
M\
##compare-integer
optimize-insn
(call-next-method)
]
}
cond
;
USING:
accessors
combinators
compiler.cfg.instructions
compiler.cfg.registers
compiler.cfg.representations.peephole
cpu.architecture
generic
kernel
layouts
;
M:
##load-integer
optimize-insn
{
{
[
dup
dst>>
rep-of
tagged-rep?
]
[
[
dst>>
]
[
val>>
tag-fixnum
]
bi
##load-tagged,
here
]
}
[
M\
##load-integer
optimize-insn
(call-next-method)
]
}
cond
;
USING:
accessors
combinators
compiler.cfg.instructions
compiler.cfg.registers
compiler.cfg.representations.peephole
generic
kernel
;
M:
##load-reference
optimize-insn
{
{
[
dup
convert-to-load-float?
]
[
[
dst>>
]
[
obj>>
]
bi
##load-float,
here
]
}
{
[
dup
convert-to-load-double?
]
[
[
dst>>
]
[
obj>>
]
bi
##load-double,
here
]
}
{
[
dup
convert-to-zero-vector?
]
[
dst>>
dup
rep-of
##zero-vector,
here
]
}
{
[
dup
convert-to-fill-vector?
]
[
dst>>
dup
rep-of
##fill-vector,
here
]
}
{
[
dup
convert-to-load-vector?
]
[
[
dst>>
]
[
obj>>
]
[
dst>>
rep-of
]
tri
##load-vector,
here
]
}
[
M\
##load-reference
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##mul-imm
optimize-insn
{
{
[
dup
{
[
dst-tagged?
]
[
src1-tagged?
]
}
1&&
]
[
unchanged
]
}
{
[
dup
{
[
dst-tagged?
]
[
src2-tagged-arithmetic?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
##mul-imm
optimize-insn
(call-next-method)
]
}
cond
;
USING:
accessors
combinators
compiler.cfg.instructions
compiler.cfg.registers
compiler.cfg.representations.peephole
compiler.cfg.representations.rewrite
cpu.architecture
generic
kernel
;
M:
##neg
optimize-insn
{
{
[
dup
inert-tag/untag-unary?
]
[
unchanged
]
}
{
[
dup
dst>>
rep-of
tagged-rep?
]
[
[
emit-use-conversion
]
[
combine-neg-tag
]
[
no-def-conversion
]
tri
]
}
[
M\
##neg
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
compiler.cfg.instructions
compiler.cfg.representations.peephole
compiler.cfg.representations.rewrite
generic
kernel
;
M:
##not
optimize-insn
{
{
[
dup
inert-tag/untag-unary?
]
[
[
no-use-conversion
]
[
emit-tagged-not
]
[
no-def-conversion
]
tri
]
}
[
M\
##not
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
compiler.cfg.representations.rewrite
generic
kernel
;
M:
##sar-imm
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged-shift-count?
]
}
1&&
]
[
[
no-use-conversion
]
[
>tagged-shift
]
[
emit-def-conversion
]
tri
]
}
[
M\
##sar-imm
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
compiler.cfg.representations.rewrite
generic
kernel
;
M:
##shl-imm
optimize-insn
{
{
[
dup
{
[
dst-tagged?
]
[
src1-tagged?
]
}
1&&
]
[
unchanged
]
}
{
[
dup
{
[
dst-tagged?
]
[
src2-tagged-shift-count?
]
}
1&&
]
[
[
emit-use-conversion
]
[
>tagged-shift
]
[
no-def-conversion
]
tri
]
}
{
[
dup
src1-tagged?
]
[
[
no-use-conversion
]
[
combine-shl-imm-input
]
[
emit-def-conversion
]
tri
]
}
[
M\
##shl-imm
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##test-branch
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged?
]
}
1&&
]
[
unchanged
]
}
[
M\
##test-branch
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##test-imm-branch
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged-bitwise?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
##test-imm-branch
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##test-imm
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged-bitwise?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
##test-imm
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.instructions
compiler.cfg.representations.peephole
generic
kernel
;
M:
##test
optimize-insn
{
{
[
dup
{
[
src1-tagged?
]
[
src2-tagged?
]
}
1&&
]
[
unchanged
]
}
[
M\
##test
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.representations.peephole
compiler.cfg.representations.selection
generic
kernel
;
M:
inert-arithmetic-tag-untag-insn
optimize-insn
{
{
[
dup
{
[
dst-tagged?
]
[
src1-tagged?
]
[
src2-tagged-arithmetic?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
inert-arithmetic-tag-untag-insn
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.representations.peephole
compiler.cfg.representations.selection
generic
kernel
;
M:
inert-bitwise-tag-untag-insn
optimize-insn
{
{
[
dup
{
[
dst-tagged?
]
[
src1-tagged?
]
[
src2-tagged-bitwise?
]
}
1&&
]
[
>tagged-imm
]
}
[
M\
inert-bitwise-tag-untag-insn
optimize-insn
(call-next-method)
]
}
cond
;
USING:
combinators
combinators.short-circuit
compiler.cfg.representations.peephole
compiler.cfg.representations.selection
generic
kernel
;
M:
inert-tag-untag-insn
optimize-insn
{
{
[
dup
{
[
dst-tagged?
]
[
src1-tagged?
]
[
src2-tagged?
]
}
1&&
]
[
unchanged
]
}
[
M\
inert-tag-untag-insn
optimize-insn
(call-next-method)
]
}
cond
;
USING:
compiler.cfg.instructions
compiler.cfg.representations.peephole
compiler.cfg.representations.rewrite
kernel
;
M:
vreg-insn
optimize-insn
[
emit-use-conversion
]
[
finish
]
[
emit-def-conversion
]
tri
;