Re: signed unsiged add instruction
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Thu, 29 Mar 2007 10:38:35 +0200
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.
.
- Follow-Ups:
- Re: signed unsiged add instruction
- From: Gianmaria
- Re: signed unsiged add instruction
- References:
- signed unsiged add instruction
- From: Gianmaria
- signed unsiged add instruction
- Prev by Date: signed unsiged add instruction
- Next by Date: Re: ascii to tword - help
- Previous by thread: signed unsiged add instruction
- Next by thread: Re: signed unsiged add instruction
- Index(es):