Mill Computing, Inc. Forums The Mill Architecture Introduction to the Mill CPU Programming Model Reply To: Introduction to the Mill CPU Programming Model

Veedrac
Participant
Post count: 25

I imagine you would do something like

add b0, b1
pick cond, b0, None
add b0, 1

“None” effectively absorbs all computation without error. So you would have:

[12, 11, cond=1, ...]
[23, 12, 11, cond=1, ...] (add b0, b1)
[23, 23, 12, 11, cond=1, ...] (pick cond, b0, None)
[24, 23, 23, 12, 11, cond=1, ...] (add b0, 1)

or

[12, 11, cond=0, ...]
[23, 12, 11, cond=0, ...] (add b0, b1)
[None, 23, 12, 11, cond=0, ...] (pick cond, b0, None)
[None, None, 23, 12, 11, cond=0, ...] (add b0, 1)

It’s not obvious how to turn None into its value, though. You could do

add b0, b1
# store
pick cond, b0, None
add b0, 1
# store (may do nothing)
# load

but that seems like a lot of overhead to do very little.

Obviously, though, in this case the best option is just

add b0, b1
add b0, cond

🙂

  • This reply was modified 7 years, 6 months ago by  Veedrac.
  • This reply was modified 7 years, 6 months ago by  Veedrac.
  • This reply was modified 7 years, 6 months ago by  Veedrac.