annotate run/a/asm_movntpd_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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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_movntpd_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
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
7 version(D_InlineAsm_X86){
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
8 version = runTest;
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
9 }else version(D_InlineAsm_X86_64){
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
10 version = runTest;
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
11 }
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
12
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
13 version(runTest){
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
14 import addon.cpuinfo;
1044
03c97933de98 inline ASM review
thomask
parents: 1028
diff changeset
15
1002
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
16 int main(){
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
17 haveSSE2!()();
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
18
1265
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
19 double* a = (new double[2]).ptr;
1071
f9084d3862e8 pre 0.162 review
thomask
parents: 1044
diff changeset
20 a[0] = 1.0;
f9084d3862e8 pre 0.162 review
thomask
parents: 1044
diff changeset
21 a[1] = -1.0;
f9084d3862e8 pre 0.162 review
thomask
parents: 1044
diff changeset
22
1265
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
23 double* b = (aligned_new!(double)(2, 16)).ptr;
1044
03c97933de98 inline ASM review
thomask
parents: 1028
diff changeset
24
1265
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
25 static if(size_t.sizeof == 4){
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
26 asm{
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
27 mov EAX, a;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
28 movupd XMM0, [EAX];
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
29 mov EAX, b;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
30 movntpd [EAX], XMM0;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
31 sfence;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
32 }
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
33 }else static if(size_t.sizeof == 8){
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
34 asm{
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
35 mov RAX, a;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
36 movupd XMM0, [RAX];
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
37 mov RAX, b;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
38 movntpd [RAX], XMM0;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
39 sfence;
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
40 }
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
41 }else{
236f0d02b8b9 32<->64 iasm fixes
thomask
parents: 1071
diff changeset
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
03c97933de98 inline ASM review
thomask
parents: 1028
diff changeset
44
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
45 if(a[0] != b[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
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 }
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 if(a[1] != b[1]){
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 }
1044
03c97933de98 inline ASM review
thomask
parents: 1028
diff changeset
51
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 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
53 }
1002
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
54 }else{
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
55 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a7310ceac844 inline ASM review
thomask
parents: 983
diff changeset
56 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
57 }