Mercurial > projects > ldc
comparison tests/mini/callingconv1.d @ 741:4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 30 Oct 2008 11:08:34 +0100 |
parents | 642f6fa854e5 |
children | 12b423e17860 |
comparison
equal
deleted
inserted
replaced
740:96484f5bf5af | 741:4ac97ec7c18e |
---|---|
11 { | 11 { |
12 float a = 1.5; | 12 float a = 1.5; |
13 float b = 2.5; | 13 float b = 2.5; |
14 float c; | 14 float c; |
15 | 15 |
16 asm | 16 version(LLVM_InlineAsm_X86) |
17 { | 17 { |
18 mov EAX, [a]; | 18 asm |
19 push EAX; | 19 { |
20 mov EAX, [b]; | 20 mov EAX, [a]; |
21 push EAX; | 21 push EAX; |
22 call foo; | 22 mov EAX, [b]; |
23 fstp c; | 23 push EAX; |
24 call foo; | |
25 fstp c; | |
26 } | |
24 } | 27 } |
28 else version(LLVM_InlineAsm_X86_64) | |
29 { | |
30 asm | |
31 { | |
32 movss XMM0, [a]; | |
33 movss XMM1, [b]; | |
34 call foo; | |
35 movss [c], XMM0; | |
36 } | |
37 } | |
38 printf("%f\n", c); | |
25 | 39 |
26 printf("%f\n", c); | |
27 | |
28 assert(c == 4.0); | 40 assert(c == 4.0); |
29 | 41 |
30 printf("passed\n", c); | 42 printf("passed %f\n", c); |
31 } | 43 } |