annotate run/a/asm_jge_01_C.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 2a1a6610f7ad
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
1 // $HeadURL$
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
2 // $Date$
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
3 // $Author$
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
4
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_jge_01_C;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
6
1151
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
7 version(D_InlineAsm_X86){
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
8 version = runTest;
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
9 }else version(D_InlineAsm_X86_64){
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
10 version = runTest;
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
11 }
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
12
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
13 version(runTest){
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
14 int main(){
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
15 int a = int.min;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
16 int b = int.max;
1044
03c97933de98 inline ASM review
thomask
parents: 640
diff changeset
17
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
18 asm{
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
19 mov EAX, a;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
20 cmp EAX, b;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
21 jge save;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
22 mov EAX, 1;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
23 save: mov a, EAX;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
24 }
1044
03c97933de98 inline ASM review
thomask
parents: 640
diff changeset
25
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
26 assert(a == 1);
1044
03c97933de98 inline ASM review
thomask
parents: 640
diff changeset
27
640
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
28 return 0;
1fc8a80e4599 * added conditional jump tests
thomask
parents:
diff changeset
29 }
1151
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
30 }else{
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
31 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
32 static assert(0);
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1044
diff changeset
33 }