annotate run/a/asm_pfcmpgt_01_B.d @ 1288:61d7e32e70a8

partial inline asm review
author thomask
date Wed, 27 Dec 2006 11:59:19 +0000
parents 6e5d377573e1
children 7a397590d6e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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_pfcmpgt_01_B;
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
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
7 version(D_InlineAsm_X86){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
8 version = runTest;
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
9 }else version(D_InlineAsm_X86_64){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
10 version = runTest;
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
11 }
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
12
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
13 version(runTest){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
14 import addon.cpuinfo;
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
15
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
16 int main(){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
17 haveMMX!()();
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
18 have3DNow!()();
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
19
1288
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
20 float[] A = [123.0f, 457.0f];
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
21 float* a = A.ptr;
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
22
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
23 float[] B = [124.0f, 456.0f];
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
24 float* b = B.ptr;
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
25
61d7e32e70a8 partial inline asm review
thomask
parents: 1182
diff changeset
26 uint* c = (new uint[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
27
1182
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
28 static if(size_t.sizeof == 4){
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
29 asm{
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
30 mov EAX, a;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
31 movq MM0, [EAX];
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
32 mov EAX, b;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
33 movq MM1, [EAX];
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
34 pfcmpgt MM0, MM1;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
35 mov EAX, c;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
36 movq [EAX], MM0;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
37 emms;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
38 }
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
39 }else static if(size_t.sizeof == 8){
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
40 asm{
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
41 mov RAX, a;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
42 movq MM0, [RAX];
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
43 mov RAX, b;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
44 movq MM1, [RAX];
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
45 pfcmpgt MM0, MM1;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
46 mov RAX, c;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
47 movq [RAX], MM0;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
48 emms;
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
49 }
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
50 }else{
6e5d377573e1 fixed 64bit inline asm issues
thomask
parents: 1164
diff changeset
51 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
52 }
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
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
54 if(c[0] != 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
55 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
56 }
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 if(c[1] != 0xFFFF_FFFF){
9acd7becc753 added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff changeset
58 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
59 }
9acd7becc753 added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff changeset
60
9acd7becc753 added 3DNow! tests - all of them are broken, see http://d.puremagic.com/bugzilla/show_bug.cgi?id=115
thomask
parents:
diff changeset
61 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
62 }
1042
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
63 }else{
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
64 pragma(msg, "DSTRESS{XPASS}: no inline ASM support");
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 984
diff changeset
65 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
66 }