Mercurial > projects > ldc
changeset 1447:a400b1dd657f
fix assembly code for mingw32 in minitests
author | Kelly Wilson <wilsonk cpsc.ucalgary.ca> |
---|---|
date | Sun, 31 May 2009 11:01:02 -0600 |
parents | fe151804995a |
children | e92e14690a4f |
files | tests/mini/callingconv1.d tests/mini/naked_asm5.d |
diffstat | 2 files changed, 37 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/mini/callingconv1.d Sun May 31 12:43:59 2009 +0200 +++ b/tests/mini/callingconv1.d Sun May 31 11:01:02 2009 -0600 @@ -15,15 +15,32 @@ version(D_InlineAsm_X86) { - asm - { - mov EAX, [a]; - push EAX; - mov EAX, [b]; - push EAX; - call foo; - fstp c; - } + version(mingw32) + { + asm + { + movss XMM0, [a]; + movss XMM1, [b]; + movss [ESP], XMM1; + movss [ESP]+4, XMM0; + call foo; + fstp [c]-4; + movss XMM0, [c]-4; + movss [c], XMM0; + } + } else + { + + asm + { + mov EAX, [a]; + push EAX; + mov EAX, [b]; + push EAX; + call foo; + fstp c; + } + } } else version(D_InlineAsm_X86_64) {
--- a/tests/mini/naked_asm5.d Sun May 31 12:43:59 2009 +0200 +++ b/tests/mini/naked_asm5.d Sun May 31 11:01:02 2009 -0600 @@ -3,9 +3,17 @@ version(X86) { const OP = (op == '+') ? "add" : "sub"; - asm { naked; } - mixin("asm{"~OP~" EAX, [ESP+4];}"); - asm { ret 4; } + version (mingw32) + { + asm { naked; } + mixin("asm{push EBP;mov EBP,ESP;sub ESP,8;mov ECX,[EBP+8];"~OP~" EAX, ECX;add ESP,8;pop EBP;}"); + asm { ret; } + } else + { + asm { naked; } + mixin("asm{"~OP~" EAX, [ESP+4];}"); + asm { ret 4; } + } } else version(X86_64) {