annotate run/a/asm_fsubp_01_B.d @ 992:4c6602a06f32

inline ASM review
author thomask
date Wed, 10 May 2006 19:00:54 +0000
parents
children 03c97933de98
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
1 // $HeadURL$
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
2 // $Date$
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
3 // $Author$
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
4
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
5 module dstress.run.a.asm_fsubp_01_B;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
6
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
7 version(D_InlineAsm_X86){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
8 version = runTest;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
9 }else version(D_InlineAsm_X86_64){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
10 version = runTest;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
11 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
12
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
13 version(runTest){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
14 import addon.cpuinfo;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
15
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
16 int main(){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
17 double a = 2.4;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
18 double b = -1.2;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
19
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
20 asm{
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
21 fld1;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
22 fld a;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
23 fldz;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
24 fld b;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
25 fsubp ST(2), ST;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
26 fstp b;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
27 fstp a;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
28 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
29
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
30 a -= 3.6;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
31
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
32 if(a < 0.0){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
33 a = -a;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
34 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
35
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
36 if(a > a.epsilon * 4.0){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
37 assert(0);
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
38 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
39
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
40 if(b != 0.0){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
41 assert(0);
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
42 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
43
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
44 return 0;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
45 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
46 }else{
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
47 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
48 static assert(0);
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
49 }