Mill Computing, Inc. › Forums › The Mill › Architecture › The Belt › Reply To: The Belt
It was indicated in the compiler talk (which was really interesting to me), the belt is primarily defined by the number of available spill registers. As indicated in your previous talks, most data are used exactly once.
That leads me to think that conceptually, it would make sense to, like a stack-machine, remove the operands used in an instruction from the belt.
For the example of the compiler talk, (a – (b + c)) & ((b + c) * d)), the operations look like (from the video, 52:35)
(belt) a b c d
add b2 b1
(belt) a b c d +
mul b0 b1
nop
sup b4 b0
(belt) a b c d + – *
and b1 b0
(belt) a b c d + – * &
retn b0
In case of operations that consume its operands, it seems you would wind up with:
(belt) a b c d
add b2 b1
(belt) a d +
and b0 b0 mult b0 b1
(belt) a +
nop
sub b0 b1
(retire mul)
(belt) – *
and b0 b1
(belt) &
retn b0
Conceptually, this seems like a low cost for a large gain, avoiding most spill/fill pairs, possibly saving quite a bit of scratch space. I could imagine this would complicate the spiller though, as “pushing the belt forwards” seems simpler than keeping track of which positions have to be dropped and adjusting belt positions for that.
Has such a scenario ever been considered?