Mercurial > projects > dstress
annotate run/a/asm_pf2id_01_A.d @ 1285:229e630d4b1a
partuial inline asm review
author | thomask |
---|---|
date | Tue, 26 Dec 2006 14:21:37 +0000 |
parents | 9dcac8d4e97f |
children | 7a397590d6e0 |
rev | line source |
---|---|
984
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
2 // $Date$ |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
3 // $Author$ |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
4 |
9acd7becc753
added 3DNow! tests - all 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_pf2id_01_A; |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
6 |
1042 | 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; | |
15 | |
16 int main(){ | |
17 have3DNow!()(); | |
18 | |
1285 | 19 float* a = (new float[2]).ptr; |
1071 | 20 a[0] = 123.0f; |
21 a[1] = -456.0f; | |
1091 | 22 |
1285 | 23 int* b = (new int[2]).ptr; |
984
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
24 |
1285 | 25 static if(size_t.sizeof == 4){ |
26 asm{ | |
27 mov EAX, a; | |
28 pf2id MM0, [EAX]; | |
29 mov EAX, b; | |
30 movq [EAX], MM0; | |
31 emms; | |
32 } | |
33 }else static if(size_t.sizeof == 8){ | |
34 asm{ | |
35 mov RAX, a; | |
36 pf2id MM0, [RAX]; | |
37 mov RAX, b; | |
38 movq [RAX], MM0; | |
39 emms; | |
40 } | |
41 }else{ | |
42 static assert(0, "unhandled pointer size"); | |
984
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
43 } |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
44 |
1071 | 45 if(b[0] != a[0]){ |
984
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
46 assert(0); |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
47 } |
1071 | 48 if(b[1] != a[1]){ |
984
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
49 assert(0); |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
50 } |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
51 |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
52 return 0; |
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
53 } |
1042 | 54 }else{ |
55 pragma(msg, "DSTRESS{XPASS}: no inline ASM support"); | |
56 static assert(0); | |
984
9acd7becc753
added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff
changeset
|
57 } |