A request for hardware overflow tests:
http://blog.regehr.org/archives/1154
From the blog post:
Processors should support integer math instructions that
optionally trap on overflow. Because popular architectures lack
this feature, otherwise excellent modern systems programming
languages, such
I don't see any valid alternatives. What should ideally happen if
you increment 0x..? Should the value remain the same?
That's not much better than resetting back to zero, still a
mathematical error. Throw an exception? That would kill
performance and break lots of existing code.
If y
Wanderer:
If you need perfect calculations, you can always use an
according library for numbers with arbitrary precision.
The D Zen points in the opposite direction: if you don't care of
having bogus results in your code, then use unsafe integers :-)
Bye,
bearophile
On Thursday, 29 May 2014 at 15:32:54 UTC, Wanderer wrote:
I don't see any valid alternatives. What should ideally happen
if you increment 0x..? Should the value remain the same?
I know at least one firmware running in cars from several
manufacturers where
this is the desired behavior i
On Thursday, 29 May 2014 at 20:01:25 UTC, Tobias Pankrath wrote:
On Thursday, 29 May 2014 at 15:32:54 UTC, Wanderer wrote:
I don't see any valid alternatives. What should ideally happen
if you increment 0x..? Should the value remain the
same?
I know at least one firmware running in ca
Am Thu, 29 May 2014 20:10:13 +
schrieb "John Colvin" :
> On Thursday, 29 May 2014 at 20:01:25 UTC, Tobias Pankrath wrote:
> > On Thursday, 29 May 2014 at 15:32:54 UTC, Wanderer wrote:
> >> I don't see any valid alternatives. What should ideally happen
> >> if you increment 0x..? Shoul
On Friday, 30 May 2014 at 07:00:58 UTC, Marco Leise wrote:
Am Thu, 29 May 2014 20:10:13 +
schrieb "John Colvin" :
On Thursday, 29 May 2014 at 20:01:25 UTC, Tobias Pankrath
wrote:
> On Thursday, 29 May 2014 at 15:32:54 UTC, Wanderer wrote:
>> I don't see any valid alternatives. What should
Actually such instructions exist since MMX on Intel CPUs. The
question is: Can these new SSE instructions replace integer
math seemlessly?
My opinion is "no". When you increment an integer value (any
value), you at least expect its lower bit to change. All
cryptographic algorithms would crash