Handbook
Glossary
##mul-imm
Basic block instructions
Prev:
##mul
Next:
##neg
Vocabulary
compiler
.
cfg
.
instructions
Definition
IN:
compiler.cfg.instructions
TUPLE:
##mul-imm
<
foldable-insn
dst src1 src2 insn#
;
Methods
USING:
accessors
compiler.cfg.gvn.avail
compiler.cfg.instructions
kernel
;
M:
##mul-imm
>avail-insn-defs
[
]
change-dst
drop
;
USING:
accessors
compiler.cfg.gvn.avail
compiler.cfg.instructions
kernel
;
M:
##mul-imm
>avail-insn-uses
[
dup
>avail-vreg
or*
]
change-src1
drop
;
USING:
accessors
arrays
compiler.cfg.gvn.expressions
compiler.cfg.gvn.graph
compiler.cfg.instructions
kernel
sequences.private
;
M:
##mul-imm
>expr
\
##mul-imm
swap
[
src1>>
vreg>vn
]
keep
[
src2>>
]
keep
drop
3
f
<array>
2
swap
[
set-array-nth
]
keep
1
swap
[
set-array-nth
]
keep
0
swap
[
set-array-nth
]
keep
;
USING:
accessors
arrays
compiler.cfg.instructions
compiler.cfg.value-numbering.expressions
compiler.cfg.value-numbering.graph
kernel
sequences.private
;
M:
##mul-imm
>expr
\
##mul-imm
swap
[
src1>>
vreg>vn
]
keep
[
src2>>
]
keep
drop
3
f
<array>
2
swap
[
set-array-nth
]
keep
1
swap
[
set-array-nth
]
keep
0
swap
[
set-array-nth
]
keep
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.linear-scan.assignment
kernel
;
M:
##mul-imm
assign-insn-defs
[
vreg>reg
]
change-dst
drop
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.linear-scan.assignment
kernel
;
M:
##mul-imm
assign-insn-uses
[
vreg>reg
]
change-src1
drop
;
USING:
compiler.cfg.instructions
compiler.cfg.value-numbering.folding
kernel
math
;
M:
##mul-imm
binary-constant-fold*
drop
*
;
USING:
compiler.cfg.gvn.folding
compiler.cfg.instructions
kernel
math
;
M:
##mul-imm
binary-constant-fold*
drop
*
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.representations.rewrite
kernel
;
M:
##mul-imm
convert-insn-defs
[
converted-value
]
change-dst
drop
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.representations.rewrite
kernel
;
M:
##mul-imm
convert-insn-uses
[
converted-value
]
change-src1
drop
;
USING:
compiler.cfg.instructions
compiler.cfg.representations.preferred
cpu.architecture
kernel
;
M:
##mul-imm
defs-vreg-reps
drop
{
int-rep
}
;
USING:
accessors
arrays
compiler.cfg.def-use
compiler.cfg.instructions
;
M:
##mul-imm
defs-vregs
dst>>
1array
;
USING:
accessors
compiler.cfg.instructions
compiler.codegen
cpu.architecture
kernel
;
M:
##mul-imm
generate-insn
[
dst>>
]
keep
[
src1>>
]
keep
[
src2>>
]
keep
drop
%mul-imm
;
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
compiler.cfg.instructions
compiler.cfg.renaming
kernel
;
M:
##mul-imm
rename-insn-defs
[
rename-value
]
change-dst
drop
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.renaming
kernel
;
M:
##mul-imm
rename-insn-uses
[
rename-value
]
change-src1
drop
;
USING:
accessors
combinators
compiler.cfg.gvn.avail
compiler.cfg.gvn.folding
compiler.cfg.gvn.graph
compiler.cfg.gvn.math
compiler.cfg.gvn.rewrite
compiler.cfg.instructions
kernel
;
M:
##mul-imm
rewrite
{
{
[
dup
binary-constant-fold?
]
[
binary-constant-fold
]
}
{
[
dup
mul-to-neg?
]
[
mul-to-neg
]
}
{
[
dup
mul-to-shl?
]
[
mul-to-shl
]
}
{
[
dup
src1>>
vreg>insn
[
##mul-imm?
]
with-available-uses?
]
[
##mul-imm
reassociate-arithmetic
]
}
{
[
dup
distribute-over-add?
]
[
\
##add-imm,
\
##mul-imm,
distribute
]
}
{
[
dup
distribute-over-sub?
]
[
\
##sub-imm,
\
##mul-imm,
distribute
]
}
[
drop
f
]
}
cond
;
USING:
accessors
combinators
compiler.cfg.instructions
compiler.cfg.value-numbering.folding
compiler.cfg.value-numbering.graph
compiler.cfg.value-numbering.math
compiler.cfg.value-numbering.rewrite
kernel
;
M:
##mul-imm
rewrite
{
{
[
dup
binary-constant-fold?
]
[
binary-constant-fold
]
}
{
[
dup
mul-to-neg?
]
[
mul-to-neg
]
}
{
[
dup
mul-to-shl?
]
[
mul-to-shl
]
}
{
[
dup
src1>>
vreg>insn
##mul-imm?
]
[
##mul-imm
reassociate-arithmetic
]
}
{
[
dup
distribute-over-add?
]
[
\
##add-imm,
\
##mul-imm,
distribute
]
}
{
[
dup
distribute-over-sub?
]
[
\
##sub-imm,
\
##mul-imm,
distribute
]
}
[
drop
f
]
}
cond
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.ssa.construction.private
kernel
;
M:
##mul-imm
ssa-rename-insn-defs
[
gen-name
]
change-dst
drop
;
USING:
accessors
compiler.cfg.instructions
compiler.cfg.ssa.construction.private
kernel
;
M:
##mul-imm
ssa-rename-insn-uses
[
top-name
]
change-src1
drop
;
USING:
compiler.cfg.instructions
compiler.cfg.representations.preferred
cpu.architecture
kernel
;
M:
##mul-imm
uses-vreg-reps
drop
{
int-rep
}
;
USING:
accessors
arrays
compiler.cfg.def-use
compiler.cfg.instructions
;
M:
##mul-imm
uses-vregs
src1>>
1array
;