Mercurial > projects > dstress
annotate run/a/asm_movss_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_movss_01_C; |
1002 | 6 version(D_InlineAsm_X86){ |
7 version = runTest; | |
8 }else version(D_InlineAsm_X86_64){ | |
9 version = runTest; | |
10 } | |
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
|
11 |
1002 | 12 version(runTest){ |
13 import addon.cpuinfo; | |
1044 | 14 |
1002 | 15 int main(){ |
16 haveSSE!()(); | |
1044 | 17 |
1265 | 18 float* a = (new float[4]).ptr; |
1071 | 19 a[0] = 1.0f; |
20 a[1] = 2.0f; | |
21 a[2] = 3.0f; | |
22 a[3] = 4.0f; | |
23 | |
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
|
24 float b; |
1044 | 25 |
1265 | 26 static if(size_t.sizeof == 4){ |
27 asm{ | |
28 mov EAX, a; | |
29 movups XMM0, [EAX]; | |
30 movss b, XMM0; | |
31 } | |
32 }else static if(size_t.sizeof == 8){ | |
33 asm{ | |
34 mov RAX, a; | |
35 movups XMM0, [RAX]; | |
36 movss b, XMM0; | |
37 } | |
38 }else{ | |
39 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
|
40 } |
1044 | 41 |
1071 | 42 if(b != 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
|
43 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
|
44 } |
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 |
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 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
|
47 } |
1002 | 48 }else{ |
49 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support"); | |
50 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
|
51 } |