Portability bug in integral conversion

Walter Bright newshound2 at digitalmars.com
Mon Jan 17 01:32:39 PST 2011


bearophile wrote:
>> 1. Yes it is meaningful - depending on what you're doing.
> 
> I am not sure.
> 
> 
>> 2. Such a runtime test is expensive in terms of performance and code bloat.
>> 
> 
> I have not seen even synthetic benchmarks about this.

Look at the asm dump of a function. It's full of add's - not only ADD
instructions, but addressing mode multiplies and add's. Subtraction is often
expressed in terms of addition, relying on twos-complement wraparound.

Trying to remove twos-complement arithmetic from a systems language is like 
trying to teach your cat to fetch.


More information about the Digitalmars-d mailing list