Portability bug in integral conversion

Jonathan M Davis jmdavisProg at gmx.com
Mon Jan 17 01:38:50 PST 2011


On Monday 17 January 2011 01:32:39 Walter Bright wrote:
> 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.

I think that you'd fare better with the cat. :)

- Jonathan M Davis


More information about the Digitalmars-d mailing list