annotate run/a/asm_fyl2x_01.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
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_fyl2x_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;
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
15
993
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
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
19 float a = -2.0f;
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
20 float b;
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
21
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
22 asm{
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
23 fld a;
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
24 fld a;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
25 fld1;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
26 fyl2x;
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
27 fstp b;
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
28 fst a;
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
29 }
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
30
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
31 if(b != -0.0f){
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
32 assert(0);
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
33 }
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
34 if(a != -2.0f){
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
35 assert(0);
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
36 }
1044
03c97933de98 inline ASM review
thomask
parents: 993
diff changeset
37
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
38 return 0;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
39 }
993
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
40 }else{
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
41 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
42 static assert(0);
861fe190f7ef inline ASM review
thomask
parents: 700
diff changeset
43 }