annotate run/a/asm_or_01_A.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
856
7b2c5a101190 meta data maintenance
thomask
parents: 702
diff changeset
1 // $HeadURL$
7b2c5a101190 meta data maintenance
thomask
parents: 702
diff changeset
2 // $Date$
7b2c5a101190 meta data maintenance
thomask
parents: 702
diff changeset
3 // $Author$
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
4
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_or_01_A;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
6
1010
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
7 version(D_InlineAsm_X86){
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
8 version = runTest;
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
9 }else version(D_InlineAsm_X86_64){
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
10 version = runTest;
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
11 }
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
12
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
13 version(runTest){
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
14 int main(){
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
15 uint a = 0b0110_1110__0000_1111__1100_0011__0011_1111;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
16 uint b = 0b1110_1111__1111_1111__1111_1110__0111_1111;
1044
03c97933de98 inline ASM review
thomask
parents: 1010
diff changeset
17
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
18 asm{
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
19 mov EAX, a;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
20 or b, EAX;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
21 }
1044
03c97933de98 inline ASM review
thomask
parents: 1010
diff changeset
22
1010
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
23 if(b != 0b1110_1111__1111_1111__1111_1111__0111_1111){
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
24 assert(0);
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
25 }
1044
03c97933de98 inline ASM review
thomask
parents: 1010
diff changeset
26
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
27 return 0;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
28 }
1010
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
29 }else{
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
30 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
31 static assert(0);
731f93c13ad6 inline ASM review
thomask
parents: 856
diff changeset
32 }