Re: Integer Overflow
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Fri, 31 Dec 2010 10:38:11 +1300
On 12/31/10 10:26 AM, tm wrote:
On 30 Dez., 20:21, Ben Bacarisse<ben.use...@xxxxxxxxx> wrote:jacob navia<ja...@xxxxxxxxxxxx> writes:You just do not test ALL operations but only the ones where you
are interested in avoiding overflows. You use the form
if (_overflow(expression))
This is new form that, so far as I know, is unimplemented and not yet
defined. My comments may well have been different if this had been
the proposal you seemed to be putting forward.
Originally, you seemed to be suggesting a compiler intrinsic to access the
processor's overflow flag.
I think this is approach is too simple.
I use C as target language for my Seed7 to C compiler.
I would be happy if C had some overflow checking.
But I understand that there are also places where the
classic behaviour without overflow checking is needed.
I want to raise overflow exceptions (emulated with
setjmp, longjmp) in Seed7. C with overflow checking
would make this easier.
Checking the processor's overflow flag costs time and
there should be a cheaper way to handle overflows.
What could possibly be cheaper than reading a status register? If you want a software interrupt, the cost of a context switch will swamp the the cycle or two to read the status.
--
Ian Collins
.
- Follow-Ups:
- Re: Integer Overflow
- From: BartC
- Re: Integer Overflow
- From: Seebs
- 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: tm
- Integer Overflow
- Prev by Date: Re: Integer Overflow
- Next by Date: Re: Integer Overflow
- Previous by thread: Re: Integer Overflow
- Next by thread: Re: Integer Overflow
- Index(es):
Relevant Pages
|