annotate run/a/asm_fcmovnu_01_A.d @ 1621:8f6d65d2b129

Fix #4.
author Christian Kamm <kamm incasoftware de>
date Sat, 07 Nov 2009 19:06:53 +0100
parents 31d658aa7480
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$
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
4
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
5 module dstress.run.a.asm_fcmovnu_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;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
15
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
16 int main(){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
17 haveFPU!()();
a468938b0160 inline ASM review
thomask
parents:
diff changeset
18 haveCMOV!()();
a468938b0160 inline ASM review
thomask
parents:
diff changeset
19
a468938b0160 inline ASM review
thomask
parents:
diff changeset
20 float f = float.nan;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
21
a468938b0160 inline ASM review
thomask
parents:
diff changeset
22 asm{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
23 fld1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
24 fld f;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
25 fucomip;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
26 fldz;
1621
8f6d65d2b129 Fix #4.
Christian Kamm <kamm incasoftware de>
parents: 1522
diff changeset
27 fcmovnu ST, ST(1);
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
28 fst f;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
29 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
30
a468938b0160 inline ASM review
thomask
parents:
diff changeset
31 if(f != 0.0f){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
32 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
33 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
34
a468938b0160 inline ASM review
thomask
parents:
diff changeset
35 asm{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
36 fld1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
37 fld1;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
38 fucomip;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
39 fldz;
1621
8f6d65d2b129 Fix #4.
Christian Kamm <kamm incasoftware de>
parents: 1522
diff changeset
40 fcmovnu ST, ST(1);
989
a468938b0160 inline ASM review
thomask
parents:
diff changeset
41 fst f;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
42 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
43
a468938b0160 inline ASM review
thomask
parents:
diff changeset
44 if(f != 1.0f){
a468938b0160 inline ASM review
thomask
parents:
diff changeset
45 assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
46 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
47
a468938b0160 inline ASM review
thomask
parents:
diff changeset
48
a468938b0160 inline ASM review
thomask
parents:
diff changeset
49 return 0;
a468938b0160 inline ASM review
thomask
parents:
diff changeset
50 }
a468938b0160 inline ASM review
thomask
parents:
diff changeset
51 }else{
a468938b0160 inline ASM review
thomask
parents:
diff changeset
52 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a468938b0160 inline ASM review
thomask
parents:
diff changeset
53 static assert(0);
a468938b0160 inline ASM review
thomask
parents:
diff changeset
54 }