Mill Computing, Inc. Forums The Mill Architecture How do widening arithmetic operators work with static scheduling?

  • Author
    Posts
  • Validark
    Participant
    Post count: 21
    #3860 |

    At the end of one of the Q&A’s it was mentioned that on high-end Mills that support 128-bit adds it can perform said operation in 2 cycles. How does this square with widening adds, which I heard widen on overflow? If an add widens to 128 bit, will subsequent adds on the operand take two cycles? Will the Mill have to stall the rest of the machine for one of those cycles so that static scheduling can still treat those additions as one cycle?

    How does widening arithmetic play with things like bitshifts where the size of the operands have to be known at compile time in order to shift by the right amount?

  • Ivan Godard
    Keymaster
    Post count: 689

    All operand widths of executing code are known at compile time; there are no dynamic-sized operands in the architecture.

    Widening ops widen unconditionally, not just on overflow. The result is a normal operand of the widened width, and subsequent operations take as long as they would for anything of that width. Latency varies by target member; our test targets are specified to do a and 8-byte add in one cycle and a 16 byte add in two.

  • Validark
    Participant
    Post count: 21

    That’s good to hear! The wiki says “When a result value overflows, it is widened.” That’s why I was scared it might be dynamic.

You must be logged in to reply to this topic.