Re: signed unsiged add instruction



Gianmaria wrote:

In MIPS architecture there is instructions to add signed integer - ADD
for instance - and instructions to add signed integer - ADDU for
instance. Other architecture (like x86 for example) does not have
these different instructions.

What are the advantages to have signed/unsigned add instructions?
What's the trend for modern architecture in that respect?

There is no difference in signed/unsigned addition if you
use 2's complement representation for signed numbers.

The difference of ADD and ADDU in the MIPS architecture is only,
that the ADD instructions generates an overflow exception if
there is an overflow when the numbers are interpreted as
2's complement numbers whereas the ADDU instruction never
causes an overflow exception.

Speaking with x86 language:

ADDU -> add

ADD -> add
into

with the difference, ADD doesn't modify the destination register
when an overflow occurs whereas the x86 sequence add/into does.
.