[Issue 10677] New: Win64: cfloat return value not forwarded correctly as function argument
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jul 20 00:57:24 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10677
Summary: Win64: cfloat return value not forwarded correctly as
function argument
Product: D
Version: D1 & D2
Platform: x86_64
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: r.sagitario at gmx.de
--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-07-20 00:57:23 PDT ---
Another one from the phobos unittests that I hoped was covered by other
reports:
///////////////////////////////
void formatTest2(cfloat s, double re, double im)
{
assert(s.re == re);
assert(s.im == im);
}
cfloat getcf()
{
return 2 + 1i;
}
unittest
{
formatTest2( getcf(), 2, 1 );
}
void main() {}
//////////////////////////////
compile with "dmd -m64 -unittest test.d" to trigger the assertion.
Here's the disassembly:
_D4test5getcfFZq:
0000000000000000: 55 push rbp
0000000000000001: 48 8B EC mov rbp,rsp
0000000000000004: 48 83 EC 10 sub rsp,10h
0000000000000008: D9 05 00 00 00 00 fld dword ptr [_TMP0]
000000000000000E: D9 05 04 00 00 00 fld dword ptr [_TMP0+4]
0000000000000014: D9 5D F0 fstp dword ptr [rbp-10h]
0000000000000017: F3 0F 10 4D F0 movss xmm1,dword ptr [rbp-10h]
000000000000001C: D9 5D F0 fstp dword ptr [rbp-10h]
000000000000001F: F3 0F 10 45 F0 movss xmm0,dword ptr [rbp-10h]
0000000000000024: 48 8D 65 00 lea rsp,[rbp]
0000000000000028: 5D pop rbp
0000000000000029: C3 ret
_D4test15__unittestL13_1FZv:
0000000000000000: 55 push rbp
0000000000000001: 48 8B EC mov rbp,rsp
0000000000000004: 48 83 EC 10 sub rsp,10h
0000000000000008: 48 83 EC 20 sub rsp,20h
000000000000000C: E8 00 00 00 00 call _D4test5getcfFZq
0000000000000011: 48 83 C4 20 add rsp,20h
0000000000000015: 49 89 C0 mov r8,rax
0000000000000018: F2 48 0F 10 0D 00 movsd xmm1,mmword ptr [_TMP1]
00 00 00
0000000000000021: 48 B8 00 00 00 00 mov rax,3FF0000000000000h
00 00 F0 3F
000000000000002B: 48 89 45 F0 mov qword ptr [rbp-10h],rax
000000000000002F: F2 0F 10 45 F0 movsd xmm0,mmword ptr [rbp-10h]
0000000000000034: 48 83 EC 20 sub rsp,20h
0000000000000038: 66 48 0F 7E CA movd rdx,xmm1
000000000000003D: 66 48 0F 7E C1 movd rcx,xmm0
0000000000000042: E8 00 00 00 00 call _D4test11formatTest2FqddZv
0000000000000047: 48 83 C4 20 add rsp,20h
000000000000004B: 48 8D 65 00 lea rsp,[rbp]
000000000000004F: 5D pop rbp
0000000000000050: C3 ret
getcf returns the result in xmm0 and xmm1, but it is expected in rax by the
caller.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list