Mill Computing, Inc. Forums The Mill Architecture Wide Data / Multiple Return Values on a Short Belt

  • Author
    Posts
  • Dave
    Participant
    Post count: 10
    #1992 |

    I was reading in the Wide Data section of your docs that the Mill hardware is aware of “composite data types”, and I got to thinking… What happens if my function returns a “composite data type” that won’t fit on the belt? Similarly (I think), since the Mill supports multiple return values, what happens if my function returns 9 values on a Tin Mill (which IIRC only has 8 belt positions)?

    (I’m kinda expecting the answer to be some combination of “NYF” and/or “Wait for the talk on Wide Data”.)

  • serprex
    Participant
    Post count: 1

    Eventually all ABIs have to fallback on storing returned values to memory & returning a pointer. Mill might be able to stretch things with variable width belt slots, but there we’ll have to wait for filings

  • Ivan Godard
    Keymaster
    Post count: 689

    Sorry Dave; somehow I missed your question and didn’t reply; only picked it up when serprex answered for me 🙁

    Serprex has it right: too big or too many arguments, and varargs too, are passed in memory. The tricky part is how to pass them through a RPC (remote procedure call) in which the callee cannot address the caller’s space. That protocol is in hardware, but it needs pictures to explain. The short answer though is that the compiler produces generic calls in the .gen file, and the specializer decides how to pass the arguments based on the signature and the target Mill family member as part of producing the .asm file. Ditto for returned values. In both directions, neither party can browse in the other guy’s stack rubble; they see only the passed/returned data, not even pad bytes in large objects.

You must be logged in to reply to this topic.