annotate run/a/asm_fdivp_01_A.d @ 856:7b2c5a101190

meta data maintenance
author thomask
date Sun, 19 Feb 2006 12:16:35 +0000
parents a35e4f0a9049
children a468938b0160
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
856
7b2c5a101190 meta data maintenance
thomask
parents: 715
diff changeset
1 // $HeadURL$
7b2c5a101190 meta data maintenance
thomask
parents: 715
diff changeset
2 // $Date$
7b2c5a101190 meta data maintenance
thomask
parents: 715
diff changeset
3 // $Author$
715
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
4
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
5 // __DSTRESS_DFLAGS__ addon/cpuinfo.d
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
6
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
7 module dstress.run.a.asm_fdivp_01_A;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
8 import addon.cpuinfo;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
9
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
10 int main(){
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
11 version(D_InlineAsm){
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
12 haveFPU();
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
13
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
14 double a = 12.0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
15 double b = -3.0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
16
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
17 asm{
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
18 fld a;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
19 fldz;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
20 fld b;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
21 fdivp ST(2),ST;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
22 fstp a;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
23 fstp b;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
24 }
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
25
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
26 assert(a == 0.0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
27 assert(b == -4.0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
28
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
29 return 0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
30 }else{
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
31 pragma(msg, "no inline asm support");
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
32 static assert(0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
33 }
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
34 }