Mercurial > projects > dstress
annotate run/a/asm_movshdup_01_A.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_movshdup_01_A; |
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 |
1002 | 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 |
1002 | 16 int main(){ |
1265 | 17 float* a = (new float[4]).ptr; |
1071 | 18 a[0] = 1.0f; |
19 a[1] = -1.0f; | |
20 a[2] = -2.0f; | |
21 a[3] = 2.0f; | |
22 | |
1265 | 23 float* b = (new float[4]).ptr; |
1044 | 24 |
1265 | 25 static if(size_t.sizeof == 4){ |
26 asm{ | |
27 mov EAX, a; | |
28 movups XMM0, [EAX]; | |
29 movshdup XMM1, XMM0; | |
30 mov EAX, b; | |
31 movups [EAX], XMM1; | |
32 } | |
33 }else static if(size_t.sizeof == 8){ | |
34 asm{ | |
35 mov RAX, a; | |
36 movups XMM0, [RAX]; | |
37 movshdup XMM1, XMM0; | |
38 mov RAX, b; | |
39 movups [RAX], XMM1; | |
40 } | |
41 }else{ | |
42 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
|
43 } |
1044 | 44 |
1028 | 45 if(a[1] != b[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
|
46 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
|
47 } |
1028 | 48 if(a[1] != b[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
|
49 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
|
50 } |
1028 | 51 if(a[3] != b[2]){ |
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
|
52 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
|
53 } |
1028 | 54 if(a[3] != b[3]){ |
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 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
|
56 } |
1044 | 57 |
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
|
58 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
|
59 } |
1002 | 60 }else{ |
61 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support"); | |
62 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
|
63 } |