annotate run/a/asm_movnti_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
701
93c604903b9d small iasm update
thomask
parents:
diff changeset
1 // $HeadURL$
93c604903b9d small iasm update
thomask
parents:
diff changeset
2 // $Date$
93c604903b9d small iasm update
thomask
parents:
diff changeset
3 // $Author$
93c604903b9d small iasm update
thomask
parents:
diff changeset
4
93c604903b9d small iasm update
thomask
parents:
diff changeset
5 module dstress.run.a.asm_movnti_01;
93c604903b9d small iasm update
thomask
parents:
diff changeset
6
1002
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
7 version(D_InlineAsm_X86){
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
8 version = runTest;
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
9 }else version(D_InlineAsm_X86_64){
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
10 version = runTest;
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
11 }
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
12
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
13 version(runTest){
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
14 int main(){
701
93c604903b9d small iasm update
thomask
parents:
diff changeset
15 uint a = 0x1234_ABCD;
93c604903b9d small iasm update
thomask
parents:
diff changeset
16 uint b = 2;
1044
03c97933de98 inline ASM review
thomask
parents: 1002
diff changeset
17
701
93c604903b9d small iasm update
thomask
parents:
diff changeset
18 asm{
93c604903b9d small iasm update
thomask
parents:
diff changeset
19 mov EAX, a;
93c604903b9d small iasm update
thomask
parents:
diff changeset
20 movnti b, EAX;
93c604903b9d small iasm update
thomask
parents:
diff changeset
21 }
1044
03c97933de98 inline ASM review
thomask
parents: 1002
diff changeset
22
1002
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
23 if(a != 0x1234_ABCD){
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
24 assert(0);
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
25 }
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
26 if(b != 0x1234_ABCD){
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
27 assert(0);
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
28 }
1044
03c97933de98 inline ASM review
thomask
parents: 1002
diff changeset
29
701
93c604903b9d small iasm update
thomask
parents:
diff changeset
30 return 0;
93c604903b9d small iasm update
thomask
parents:
diff changeset
31 }
1002
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
32 }else{
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
33 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
34 static assert(0);
a7310ceac844 inline ASM review
thomask
parents: 701
diff changeset
35 }