Thread overview
Floating point failures on x64
Feb 24, 2012
Daniel Murphy
Feb 24, 2012
Martin Nowak
Feb 24, 2012
Daniel Murphy
Feb 24, 2012
Martin Nowak
Feb 24, 2012
Daniel Murphy
Feb 24, 2012
Daniel Murphy
Feb 24, 2012
Martin Nowak
February 24, 2012
I've been trying to fix issue 4155, but it's a little difficult without the ability to test on x64 (I'm on win32).  Could anybody compile the following code for me with 'dmd -m64' with this patch https://github.com/D-Programming-Language/dmd/pull/760 and send me the disassembly?

Thanks.


template TT4155(T...) { alias T TT4155; }

void test4155()
{
    static int test4155a()
    {
        T getnan(T)() { return T.nan; } // OPcall
        static T getnanu(T)() { return T.nan; } // OPucall

        foreach(T; TT4155!(float, double, real, ifloat, idouble, ireal,
cfloat, cdouble, creal))
        {
            auto f = getnan!T();
            if (!__ctfe) // force f into memory
                asm { nop; };

            assert(!(T.nan == 0), T.stringof);
            assert(!(f == 0), T.stringof);
            assert(!(getnan!T == 0), T.stringof);
            assert(!(getnanu!T == 0), T.stringof);

            assert((T.nan != 0), T.stringof);
            assert((f != 0), T.stringof);
            assert((getnan!T != 0), T.stringof);
            assert((getnanu!T != 0), T.stringof);
        }
        return 1;
    }
    auto a = test4155a();
    enum b = test4155a();
}

void main()
{
    test4155();
}


February 24, 2012
On Fri, 24 Feb 2012 06:57:22 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:

> I've been trying to fix issue 4155, but it's a little difficult without the
> ability to test on x64 (I'm on win32).  Could anybody compile the following
> code for me with 'dmd -m64' with this patch
> https://github.com/D-Programming-Language/dmd/pull/760 and send me the
> disassembly?
>
http://codepad.org/1w2jRctt - objconv
http://codepad.org/pOCsPsMi - objdump (doesn't know sahf)
February 24, 2012
Thanks heaps!  Only failing for cfloat+ now!
I've updated the pull, do you mind doing it again?

"Martin Nowak" <dawg@dawgfoto.de> wrote in message news:op.v958yuyvsqugbd@dawg-freebsd.lan...
> On Fri, 24 Feb 2012 06:57:22 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:
>
>> I've been trying to fix issue 4155, but it's a little difficult without
>> the
>> ability to test on x64 (I'm on win32).  Could anybody compile the
>> following
>> code for me with 'dmd -m64' with this patch
>> https://github.com/D-Programming-Language/dmd/pull/760 and send me the
>> disassembly?
>>
> http://codepad.org/1w2jRctt - objconv
> http://codepad.org/pOCsPsMi - objdump (doesn't know sahf)


February 24, 2012
On Fri, 24 Feb 2012 09:02:05 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:

> Thanks heaps!  Only failing for cfloat+ now!
> I've updated the pull, do you mind doing it again?
>
> "Martin Nowak" <dawg@dawgfoto.de> wrote in message
> news:op.v958yuyvsqugbd@dawg-freebsd.lan...
>> On Fri, 24 Feb 2012 06:57:22 +0100, Daniel Murphy
>> <yebblies@nospamgmail.com> wrote:
>>
>>> I've been trying to fix issue 4155, but it's a little difficult without
>>> the
>>> ability to test on x64 (I'm on win32).  Could anybody compile the
>>> following
>>> code for me with 'dmd -m64' with this patch
>>> https://github.com/D-Programming-Language/dmd/pull/760 and send me the
>>> disassembly?
>>>
>> http://codepad.org/1w2jRctt - objconv
>> http://codepad.org/pOCsPsMi - objdump (doesn't know sahf)
>
>
Intel or AT&T?

http://codepad.org/4Gr237NH - dmd -c bug2.d && objconv -fasm bug2.o
http://codepad.org/MhqFv8ik - dmd -c bug2.d && objdump -d bug2.o
February 24, 2012
Intel, thanks.

(*shudder*, AT&T)

"Martin Nowak" <dawg@dawgfoto.de> wrote in message news:op.v96domsnsqugbd@dawg-freebsd.lan...
> On Fri, 24 Feb 2012 09:02:05 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:
>
>> Thanks heaps!  Only failing for cfloat+ now!
>> I've updated the pull, do you mind doing it again?
>>
>> "Martin Nowak" <dawg@dawgfoto.de> wrote in message news:op.v958yuyvsqugbd@dawg-freebsd.lan...
>>> On Fri, 24 Feb 2012 06:57:22 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:
>>>
>>>> I've been trying to fix issue 4155, but it's a little difficult without
>>>> the
>>>> ability to test on x64 (I'm on win32).  Could anybody compile the
>>>> following
>>>> code for me with 'dmd -m64' with this patch
>>>> https://github.com/D-Programming-Language/dmd/pull/760 and send me the
>>>> disassembly?
>>>>
>>> http://codepad.org/1w2jRctt - objconv
>>> http://codepad.org/pOCsPsMi - objdump (doesn't know sahf)
>>
>>
> Intel or AT&T?
>
> http://codepad.org/4Gr237NH - dmd -c bug2.d && objconv -fasm bug2.o http://codepad.org/MhqFv8ik - dmd -c bug2.d && objdump -d bug2.o


February 24, 2012
Do you know what happened to the rest of the intel disassembly?  It ends
rather abruptly...
I'd use the other listing but the callq instructions seem to be displaying
the return address instead of the target address.

"Martin Nowak" <dawg@dawgfoto.de> wrote in message news:op.v96domsnsqugbd@dawg-freebsd.lan...
> On Fri, 24 Feb 2012 09:02:05 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:
>
>> Thanks heaps!  Only failing for cfloat+ now!
>> I've updated the pull, do you mind doing it again?
>>
>> "Martin Nowak" <dawg@dawgfoto.de> wrote in message news:op.v958yuyvsqugbd@dawg-freebsd.lan...
>>> On Fri, 24 Feb 2012 06:57:22 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:
>>>
>>>> I've been trying to fix issue 4155, but it's a little difficult without
>>>> the
>>>> ability to test on x64 (I'm on win32).  Could anybody compile the
>>>> following
>>>> code for me with 'dmd -m64' with this patch
>>>> https://github.com/D-Programming-Language/dmd/pull/760 and send me the
>>>> disassembly?
>>>>
>>> http://codepad.org/1w2jRctt - objconv
>>> http://codepad.org/pOCsPsMi - objdump (doesn't know sahf)
>>
>>
> Intel or AT&T?
>
> http://codepad.org/4Gr237NH - dmd -c bug2.d && objconv -fasm bug2.o http://codepad.org/MhqFv8ik - dmd -c bug2.d && objdump -d bug2.o


February 24, 2012
On Fri, 24 Feb 2012 12:20:42 +0100, Daniel Murphy <yebblies@nospamgmail.com> wrote:

> Do you know what happened to the rest of the intel disassembly?  It ends
> rather abruptly...
It gets truncated while uploading?
https://gist.github.com/1903445

> I'd use the other listing but the callq instructions seem to be displaying
> the return address instead of the target address.
>
One great thing about objconv is that it resolves relocations.