Handbook
Glossary
preference-test-affinities ( seed -- affinities )
Vocabulary
compiler
.
cfg
.
register-allocation
.
validation
.
color-preferences
Inputs
seed
an
object
Outputs
affinities
an
object
Definition
USING:
assocs
kernel
math
sequences
;
IN:
compiler.cfg.register-allocation.validation.color-preferences
::
preference-test-affinities
( seed -- affinities )
4
<iota>
[
H{
}
clone
]
H{
}
map>assoc
:>
affinities
preference-edges
[|
pair index |
seed 1 index
shift
bitand
0
>
[
{
1/8 1 8
}
index 3
mod
swap
nth
:>
weight pair
first2
:>
( a b ) weight a b
affinities
at
set-at
weight b a affinities
at
set-at
]
when
]
each-index
affinities
;