Handbook
Glossary
emit-fixnum-shift-general ( block -- block' )
Vocabulary
compiler
.
cfg
.
intrinsics
.
fixnum
Inputs
block
a
basic-block
Outputs
block'
a
basic-block
Word description
Emits intrinsic code for shifting a
fixnum
. For positive shifts,
##shl
is used, for negative shifts it is more complicated.
Definition
USING:
arrays
compiler.cfg.builder.blocks
compiler.cfg.comparisons
compiler.cfg.instructions
compiler.cfg.stacks
kernel
;
IN:
compiler.cfg.intrinsics.fixnum
:
emit-fixnum-shift-general
( block -- block' )
ds-peek
0
cc>
##compare-integer-imm-branch,
dup
[
[
emit-fixnum-left-shift
]
with-branch
]
[
[
emit-fixnum-right-shift
]
with-branch
]
bi
2array
emit-conditional
;