Re: DMD Issue with Asm Generation?

2016-02-13 Thread user001 via Digitalmars-d
Disregard all that above, looks like someone used a "double" 
which uses 0x7FF0 to check if infinite. Not sure why the code 
runs fine on x86 though, different library maybe?


https://github.com/D-Programming-Language/phobos/blob/master/std/format.d#L1709


Re: DMD Issue with Asm Generation?

2016-02-13 Thread jkpl via Digitalmars-d

On Saturday, 13 February 2016 at 20:50:22 UTC, user001 wrote:
Disregard all that above, looks like someone used a "double" 
which uses 0x7FF0 to check if infinite. Not sure why the code 
runs fine on x86 though, different library maybe?


https://github.com/D-Programming-Language/phobos/blob/master/std/format.d#L1709


yes the line you highlight is for DMD64 (windows of course), 
which explains well why x86 is OK since it uses the C runtime 
library by DigitalMars (aka snn.lib). Now I'm not quite sure if 
it should be


T tval = val;

because of the comment just after:


convert early to get "inf" in case of overflow