annotate run/a/asm_setge_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
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
1 // $HeadURL$
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
2 // $Date$
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
3 // $Author$
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
4
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
5 module dstress.run.a.asm_setge_01_B;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
6
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
7 version(D_InlineAsm_X86){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
8 version = runTest;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
9 }else version(D_InlineAsm_X86_64){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
10 version = runTest;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
11 }
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
12
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
13 version(runTest){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
14 int main(){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
15 ubyte a;
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
16
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
17 a = 0xFF;
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
18
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
19 asm{
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
20 mov EAX, 3;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
21 cmp EAX, -4;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
22 setge BL;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
23 mov a, BL;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
24 }
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
25
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
26 if(a != 1){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
27 assert(0);
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
28 }
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
29
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
30 a = 0xFF;
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
31
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
32 asm{
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
33 mov EAX, -4;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
34 cmp EAX, 3;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
35 setge BL;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
36 mov a, BL;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
37 }
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
38
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
39 if(a != 0){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
40 assert(0);
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
41 }
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
42
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
43 a = 0xFF;
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
44
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
45 asm{
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
46 mov EAX, 4;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
47 cmp EAX, 4;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
48 setge BL;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
49 mov a, BL;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
50 }
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
51
1040
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
52 if(a != 1){
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
53 assert(0);
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
54 }
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
55
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
56 return 0;
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
57 }
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
58 }else{
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
59 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
60 static assert(0);
a3d6bbc8dec0 inline ASM review
thomask
parents:
diff changeset
61 }