annotate run/a/asm_fucomip_01_A.d @ 1329:1c8652b3795a

inline asm review
author thomask
date Fri, 12 Jan 2007 23:07:17 +0000
parents 03c97933de98
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
1 // $HeadURL$
a468938b0160 inline ASM review
thomask
parents:
diff changeset
2 // $Date$
a468938b0160 inline ASM review
thomask
parents:
diff changeset
3 // $Author$
a468938b0160 inline ASM review
thomask
parents:
diff changeset
4
a468938b0160 inline ASM review
thomask
parents:
diff changeset
5 module dstress.run.a.asm_fucomip_01_A;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
6
a468938b0160 inline ASM review
thomask
parents:
diff changeset
7 version(D_InlineAsm_X86){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
8 version = runTest;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
9 }else version(D_InlineAsm_X86_64){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
10 version = runTest;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
11 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
12
a468938b0160 inline ASM review
thomask
parents:
diff changeset
13 version(runTest){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
14 import addon.cpuinfo;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
15
a468938b0160 inline ASM review
thomask
parents:
diff changeset
16 int main(){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
17 haveFPU!()();
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
18
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
19 float f1 = float.nan;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
20 float f2;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
21
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
22 ubyte CF = 2;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
23 ubyte PF = 2;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
24 ubyte ZF = 2;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
25
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
26 asm{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
27 fldz;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
28 fldz;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
29 fld1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
30 fld f1;
1329
1c8652b3795a inline asm review
thomask
parents: 1044
diff changeset
31 fucomip ST, ST(1);
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
32 fstp f1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
33 fstp f1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
34 fstp f2;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
35 setc CF;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
36 setp PF;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
37 setz ZF;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
38 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
39
a468938b0160 inline ASM review
thomask
parents:
diff changeset
40 if(f1 != 0.0f){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
41 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
42 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
43 if(f2 != 0.0f){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
44 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
45 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
46
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
47 if(CF != 1){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
48 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
49 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
50 if(PF != 1){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
51 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
52 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
53 if(ZF != 1){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
54 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
55 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
56
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
57 return 0;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
58 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
59 }else{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
60 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a468938b0160 inline ASM review
thomask
parents:
diff changeset
61 static assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
62 }