annotate run/a/asm_fyl2xp1_01.d @ 1329:1c8652b3795a

inline asm review
author thomask
date Fri, 12 Jan 2007 23:07:17 +0000
parents 03c97933de98
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
1 // $HeadURL$
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
2 // $Date$
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
3 // $Author$
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
4
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_fyl2xp1_01;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
6
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
7 version(D_InlineAsm_X86){
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
8 version = runTest;
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
9 }else version(D_InlineAsm_X86_64){
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
10 version = runTest;
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
11 }
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
12
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
13 version(runTest){
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
14 import addon.cpuinfo;
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
15
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
16 int main(){
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
17 haveFPU!()();
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
18
1329
1c8652b3795a inline asm review
thomask
parents: 1044
diff changeset
19 float a = 7.0f;
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
20
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
21 asm{
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
22 fld a;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
23 fld a;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
24 fyl2xp1;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
25 fstp a;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
26 }
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
27
1329
1c8652b3795a inline asm review
thomask
parents: 1044
diff changeset
28 if(a != 21.0){
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
29 assert(0);
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
30 }
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
31
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
32 return 0;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
33 }
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
34 }else{
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
35 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
36 static assert(0);
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
37 }