comparison run/a/asm_fsubrp_01_A2.d @ 1606:ebff718ff18b

Fix tests from #3. Thanks Don!
author Christian Kamm <kamm incasoftware de>
date Mon, 13 Apr 2009 13:47:03 +0200
parents run/a/asm_fsubrp_01_A.d@1c8652b3795a
children 1bbcc6407d4b
comparison
equal deleted inserted replaced
1605:392a442e2d64 1606:ebff718ff18b
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 module dstress.run.a.asm_fsubrp_01_A;
6
7 version(D_InlineAsm_X86){
8 version = runTest;
9 }else version(D_InlineAsm_X86_64){
10 version = runTest;
11 }
12
13 version(runTest){
14 import addon.cpuinfo;
15
16 int main(){
17 haveFPU!()();
18
19 double b = -1.2;
20 double a = 2.4;
21
22 asm{
23 fld1;
24 fldz;
25 fld b;
26 fld a;
27 fsubrp;
28 fstp a;
29 fstp b;
30 }
31
32 a -= 3.6;
33
34 if(a < 0.0){
35 a = -a;
36 }
37
38 if(a > a.epsilon * 4.0){
39 assert(0);
40 }
41
42 if(b != 0.0){
43 assert(0);
44 }
45
46 return 0;
47 }
48 }else{
49 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
50 static assert(0);
51 }