annotate run/a/asm_fdiv_01_D.d @ 1044:03c97933de98

inline ASM review
author thomask
date Thu, 08 Jun 2006 18:26:22 +0000
parents a468938b0160
children 1c8652b3795a
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
989
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
5 module dstress.run.a.asm_fdiv_01_D;
715
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
6
989
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
7 version(D_InlineAsm_X86){
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
8 version = runTest;
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
9 }else version(D_InlineAsm_X86_64){
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
10 version = runTest;
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
11 }
715
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
12
989
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
13 version(runTest){
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
14 import addon.cpuinfo;
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
15
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
16 int main(){
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
17 haveFPU!()();
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
18
989
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
19 float a = 12.0f;
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
20 float b = -3.0f;
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
21 float c;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
22
715
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
23 asm{
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
24 fld a;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
25 fld b;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
26 fdiv ST(1),ST;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
27 fstp c;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
28 fstp c;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
29 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
30
989
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
31 if(c != -4.0f){
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
32 assert(0);
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
33 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
34
715
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
35 return 0;
a35e4f0a9049 partial iasm FPU review
thomask
parents:
diff changeset
36 }
989
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
37 }else{
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
38 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
39 static assert(0);
a468938b0160 inline ASM review
thomask
parents: 856
diff changeset
40 }