annotate run/a/asm_fsubp_01_B2.d @ 1607:1bbcc6407d4b

Update module statement for renamed tests.
author Christian Kamm <kamm incasoftware de>
date Mon, 13 Apr 2009 13:48:46 +0200
parents ebff718ff18b
children
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
1607
1bbcc6407d4b Update module statement for renamed tests.
Christian Kamm <kamm incasoftware de>
parents: 1606
diff changeset
5 module dstress.run.a.asm_fsubp_01_B2;
992
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;
1044
03c97933de98 inline ASM review
thomask
parents: 992
diff changeset
15
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
16 int main(){
1329
1c8652b3795a inline asm review
thomask
parents: 1044
diff changeset
17 haveFPU!()();
1c8652b3795a inline asm review
thomask
parents: 1044
diff changeset
18
1606
ebff718ff18b Fix tests from #3. Thanks Don!
Christian Kamm <kamm incasoftware de>
parents: 1329
diff changeset
19 double b = -1.2;
ebff718ff18b Fix tests from #3. Thanks Don!
Christian Kamm <kamm incasoftware de>
parents: 1329
diff changeset
20 double a = 2.4;
1044
03c97933de98 inline ASM review
thomask
parents: 992
diff changeset
21
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
22 asm{
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
23 fld1;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
24 fld a;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
25 fldz;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
26 fld b;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
27 fsubp ST(2), ST;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
28 fstp b;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
29 fstp a;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
30 }
1044
03c97933de98 inline ASM review
thomask
parents: 992
diff changeset
31
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
32 a -= 3.6;
1044
03c97933de98 inline ASM review
thomask
parents: 992
diff changeset
33
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
34 if(a < 0.0){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
35 a = -a;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
36 }
1044
03c97933de98 inline ASM review
thomask
parents: 992
diff changeset
37
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
38 if(a > a.epsilon * 4.0){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
39 assert(0);
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
40 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
41
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
42 if(b != 0.0){
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
43 assert(0);
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
44 }
1044
03c97933de98 inline ASM review
thomask
parents: 992
diff changeset
45
992
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
46 return 0;
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
47 }
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
48 }else{
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
49 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
50 static assert(0);
4c6602a06f32 inline ASM review
thomask
parents:
diff changeset
51 }