Mercurial > projects > dstress
annotate run/a/asm_movupd_01_C.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 | 236f0d02b8b9 |
children |
rev | line source |
---|---|
983
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
2 // $Date$ |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
3 // $Author$ |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
4 |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
5 module dstress.run.a.asm_movupd_01_C; |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
6 |
1010 | 7 version(D_InlineAsm_X86){ |
8 version = runTest; | |
9 }else version(D_InlineAsm_X86_64){ | |
10 version = runTest; | |
11 } | |
12 | |
13 version(runTest){ | |
14 import addon.cpuinfo; | |
1044 | 15 |
1010 | 16 int main(){ |
17 haveSSE2!()(); | |
18 | |
1265 | 19 double* a = (new double[2]).ptr; |
1071 | 20 a[0] = 1.0; |
21 a[1] = 4.0; | |
1091 | 22 |
1265 | 23 double* b = (new double[2]).ptr; |
1044 | 24 |
1265 | 25 static if(size_t.sizeof == 4){ |
26 asm{ | |
27 mov EAX, a; | |
28 movupd XMM0, [EAX]; | |
29 mov EAX, b; | |
30 movdqu [EAX], XMM0; | |
31 } | |
32 }else static if(size_t.sizeof == 8){ | |
33 asm{ | |
34 mov RAX, a; | |
35 movupd XMM0, [RAX]; | |
36 mov RAX, b; | |
37 movdqu [RAX], XMM0; | |
38 } | |
39 }else{ | |
40 static assert(0, "unhandled pointer size"); | |
983
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
41 } |
1044 | 42 |
1071 | 43 if(b[0] != a[0]){ |
983
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
44 assert(0); |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
45 } |
1071 | 46 if(b[1] != a[1]){ |
983
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
47 assert(0); |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
48 } |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
49 |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
50 return 0; |
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
51 } |
1010 | 52 }else{ |
53 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support"); | |
54 static assert(0); | |
983
642e3fea11a9
extended SSE tests - most of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
55 } |