Re: Integer Overflow
- From: jacob navia <jacob@xxxxxxxxxxxx>
- Date: Thu, 30 Dec 2010 21:00:02 +0100
Le 30/12/10 20:47, Seebs a écrit :
On 2010-12-30, Ben Bacarisse<ben.usenet@xxxxxxxxx> wrote:jacob navia<jacob@xxxxxxxxxxxx> writes:The Cell SPU has no overflow detection at all. You may feel you can
discount this processor as a valid target for a C compiler, but I'd be
wary of doing that.
Since the general registers of the Cell SPU are 128 bit wide,
you can very easily detect overflow using 32 bit data
by testing one bit of the result. Note that the machine
can't handle more than 32 bit integer operations...
That's not how I understand this processor to work. The 128-bit result
is made up from 4 separate 32-bit adds, each with no carry and overflow
information. Nothing carries from one word addition to another.
Then, it is very easy, just SPLIT your number in two
of those 4 slots and add them in parallel, then see if the
high parts overflow.
There was a discussion of precisely that in this thread.
There is NO processor that can't detect overflow.
Of course it's possible. I said it is always possible. The question is
the cost. I don't think the cost is a single bit test on the Cell SPU
but I am no expert on these processors.
I'm not a proper *expert*, but I've written a fair bit about the compiler
technology used for them.
So you can't make statements like: "There is no processor that hasn't an
overflow flag" and not expect people to comment on that.
Exactly.
-s
Exactly Seebs. Contrary to you (that thinks that you are always right)
I changed slighty my proposal from
expression
_overflow()
to _overflow(expression)
and left out any flags since the overflow detection can be done
with the use of other flags.
What is evident is that your interest is here to prove that
I am wrong and not to propose any solution to the detction
of overflow that apparently is for you a non problem.
Who cares?
If all my results are wrong because computation overflowed
it doesn't matter.
What do YOU propose Seebs? How would YOU solve this problem?
Or you think there is NO PROBLEM here ?
.
- Follow-Ups:
- Re: Integer Overflow
- From: Ben Bacarisse
- Re: Integer Overflow
- References:
- Integer Overflow
- From: arnuld
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: BGB
- Re: Integer Overflow
- From: Keith Thompson
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: BGB
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: Keith Thompson
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: Keith Thompson
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: Ike Naar
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: Ben Bacarisse
- Re: Integer Overflow
- From: jacob navia
- Re: Integer Overflow
- From: Ben Bacarisse
- Re: Integer Overflow
- From: Seebs
- Integer Overflow
- Prev by Date: Re: Integer Overflow
- Next by Date: Re: extern declaration
- Previous by thread: Re: Integer Overflow
- Next by thread: Re: Integer Overflow
- Index(es):
Relevant Pages
|