I had an IM chat with André Pouliot about the multiplication in the nanocontroller. Here are some of the highlights:
I'm still looking for someone to come up with an early-SPARC-like set of multiplier stepping instructions. Basically, we can add a little to the ALU so that a 32x32->32 takes roughly 32 cycles, encoded as instructions. But there are other ideas. A fully-pipelined 32x32 multiplier is out of the question because it's too much logic. We could have a state machine that did it in like 32 cycles in the background, accessible either through special instructions or as an I/O ports in the scratch memory space. Another idea is to use a smaller multiplier. A pipelined 8x8 multiplier wouldn't be nearly so bad. In fact, André, thinks that it could be computed in one cycle. If that's the case, we could just integrated it into the ALU. If we need to break it into two stages, we can put one half in the ALU and the rest of the logic in the MEMIO stage. Then we'd just have a subroutine to handle splitting up the operands and then summing the partial products. Signed multiplication is more challenging than unsigned. If we're going to break it up into chunks anyhow, we might as well have an unsigned mult subroutine and also a signed one that looks at the signs, negates the operands, does the multiply, and then negates again when necessary. He pointed out that if we break the multiplies into 8x8's, it would take 16 cycles to do a full 32x32 multiply. There's also shift and add overhead to consider. This therefore might not be a win over other approaches. Ultimately, we may decide not to even have a multiply instruction and just code it when necessary. This would be horribly slow, but if it's a rare event, it won't matter so much. All I can think of for this is where we want to multiply a 16-bit unsigned line stride by a 16-bit signed Y coordinate. In other cases, we multiply by a constant, eliminating any branches (or decisions anyhow) entirely. -- Timothy Normand Miller http://www.cse.ohio-state.edu/~millerti Open Graphics Project _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
