On Mon, Oct 1, 2012 at 1:19 PM, Peter Gavin <[email protected]> wrote:
> The comment indicates the Carry flag interprets the operands as
> unsigned values.  In this case, -2 and -3 are actually very large, and
> multiply out to a number that's larger than what can be stored in 32
> bits.  So I think or1ksim is correct in this case.

This should clarify what I mean by that:

If we sign extend -2 and -3 all the way out to 64-bits, this is the result:
fffffffffffffffe x fffffffffffffffd = 0000000000000006
This is what a signed multiply does.

If we truncate those values to 32-bits, then multiply, this is the result:
00000000fffffffe x 00000000fffffffd = fffffffb00000006
This what unsigned multiply does.

-Pete
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to