annotate run/a/asm_fdivr_01_D.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_fdivr_01_D;
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 float a = 12.0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
15 float b = -3.0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
16 float c = 9.9;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
17
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
18 asm{
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
19 fld b;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
20 fldz;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
21 fld a;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
22 fdivr ST(2),ST;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
23 fstp a;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
24 fstp b;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
25 fstp c;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
26 }
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
27
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
28 assert(a == 12.0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
29 assert(b == 0.0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
30 assert(c == -4.0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
31
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
32 return 0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
33 }else{
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
34 pragma(msg, "no inline asm support");
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
35 static assert(0);
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
36 }
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
37 }