annotate run/a/asm_movq_02_N.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents e6887749b811
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1037
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
1 // $HeadURL$
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
2 // $Date$
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
3 // $Author$
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
4
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
5 // @author@ <thomas-dloop@kuehne.cn>
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
6 // @date@ 2006-05-26
1321
e6887749b811 cleaned up remaining puremagic @uri@s
thomask
parents: 1062
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=173
1037
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
8
1062
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
9 // __DSTRESS_TORTURE_BLOCK__ -fPIC
7360e428ad73 pre 0.162 review
thomask
parents: 1044
diff changeset
10
1037
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
11 module dstress.run.a.asm_movq_02_N;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
12
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
13 version(D_InlineAsm_X86){
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
14 version = runTest;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
15 }else version(D_InlineAsm_X86_64){
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
16 version = runTest;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
17 }
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
18
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
19 version(runTest){
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
20 import addon.cpuinfo;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
21
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
22 int main(){
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
23 haveSSE2!()();
1044
03c97933de98 inline ASM review
thomask
parents: 1037
diff changeset
24
1037
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
25 const double A = 4.1;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
26 double b;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
27
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
28 asm{
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
29 movq MM0, A;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
30 movq b, MM0;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
31 finit;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
32 }
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
33
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
34 if(A != 4.1){
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
35 assert(0);
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
36 }
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
37 if(b != 4.1){
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
38 assert(0);
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
39 }
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
40
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
41 return 0;
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
42 }
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
43 }else{
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
44 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
45 static assert(0);
22f348c04a9b [Bug 173] New: incorrect size calculation for movq
thomask
parents:
diff changeset
46 }