[Issue 21376] [x86-only] Returning 32-bit floats have wrong precision

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 10 18:38:13 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21376

--- Comment #4 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Iain Buclaw from comment #3)
>     return sqrt(u*u + v*v);

-----------------------------------------------------
dmd x86:
    movss  %xmm0,-0x18(%ebp)
    flds   -0x18(%ebp)
    fmul   %st(0),%st
    movss  %xmm2,-0x18(%ebp)
    flds   -0x18(%ebp)
    fmul   %st(0),%st
    faddp  %st,%st(1)
    fsqrt
    leave
    ret    $0x8
-----------------------------------------------------
dmd x86_64:
    movss  %xmm0,-0x30(%rbp)
    flds   -0x30(%rbp)
    fmul   %st(0),%st
    movss  %xmm2,-0x30(%rbp)
    flds   -0x30(%rbp)
    fmul   %st(0),%st
    faddp  %st,%st(1)
    fsqrt
    fstps  -0x30(%rbp)
    movss  -0x30(%rbp),%xmm0
    leaveq
    retq
-----------------------------------------------------

--


More information about the Digitalmars-d-bugs mailing list