annotate run/a/asm_fcomip_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_fcomip_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, f2;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
20
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
21 ubyte CF = 2;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
22 ubyte PF = 2;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
23 ubyte ZF = 2;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
24
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
25 asm{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
26 fldz;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
27 fldz;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
28 fld1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
29 fldz;
1329
1c8652b3795a inline asm review
thomask
parents: 1044
diff changeset
30 fcomip ST, ST(1);
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
31 fstp f1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
32 fstp f2;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
33 setc CF;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
34 setp PF;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
35 setz ZF;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
36 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
37
a468938b0160 inline ASM review
thomask
parents:
diff changeset
38 if(f1 != 1.0f){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
39 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
40 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
41 if(f2 != 0.0f){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
42 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
43 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
44
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
45 if(CF != 1){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
46 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
47 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
48 if(PF != 0){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
49 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
50 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
51 if(ZF != 0){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
52 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
53 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
54
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
55 return 0;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
56 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
57 }else{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
58 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a468938b0160 inline ASM review
thomask
parents:
diff changeset
59 static assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
60 }