annotate run/a/asm_fisttp_01_B.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
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
5 module dstress.run.a.asm_fistp_01_B;
715
a35e4f0a9049 partial iasm FPU review
thomask
parents: 700
diff changeset
6
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
7 version(D_InlineAsm_X86){
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
8 version = runTest;
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
9 }else version(D_InlineAsm_X86_64){
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
10 version = runTest;
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
11 }
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
12
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
13 version(runTest){
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
14 import addon.cpuinfo;
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
15
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
16 int main(){
989
a468938b0160 inline ASM review
thomask
parents: 715
diff changeset
17 haveFPU!()();
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
18
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
19 float f = -800.9f;
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
20 int i;
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
21
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
22 asm{
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
23 fld f;
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
24 fisttp i;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
25 }
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
26
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
27 if(i != -800){
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
28 assert(0);
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
29 }
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
30
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
31 f = -800.0f;
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
32
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
33 asm{
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
34 fld f;
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
35 fisttp i;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
36 }
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
37
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
38 if(i != -800){
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
39 assert(0);
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
40 }
1044
03c97933de98 inline ASM review
thomask
parents: 990
diff changeset
41
700
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
42 return 0;
98e3d2ab382f added further fpu iasm tests
thomask
parents:
diff changeset
43 }
990
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
44 }else{
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
45 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
46 static assert(0);
15b0469145fb inline ASM review
thomask
parents: 989
diff changeset
47 }