annotate run/a/asm_shld_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 7a397590d6e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
856
7b2c5a101190 meta data maintenance
thomask
parents: 705
diff changeset
1 // $HeadURL$
7b2c5a101190 meta data maintenance
thomask
parents: 705
diff changeset
2 // $Date$
7b2c5a101190 meta data maintenance
thomask
parents: 705
diff changeset
3 // $Author$
705
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
4
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_shld_01_A;
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
6
1046
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
7 version(D_InlineAsm_X86){
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
8 version = runTest;
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
9 }else version(D_InlineAsm_X86_64){
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
10 version = runTest;
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
11 }
1044
03c97933de98 inline ASM review
thomask
parents: 856
diff changeset
12
1046
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
13 version(runTest){
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
14 int main(){
705
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
15 ushort a = 0b0000_0000__1000_0000;
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
16 ushort b = 0b1010_0000__0000_0000;
1044
03c97933de98 inline ASM review
thomask
parents: 856
diff changeset
17
705
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
18 asm{
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
19 mov BX, b;
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
20 shld a, BX, 3;
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
21 mov b, BX;
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
22 }
1044
03c97933de98 inline ASM review
thomask
parents: 856
diff changeset
23
1046
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
24 if(a != 0b0000_0100__0000_0101){
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
25 assert(0);
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
26 }
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
27 if(b != 0b1010_0000__0000_0000){
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
28 assert(0);
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
29 }
1044
03c97933de98 inline ASM review
thomask
parents: 856
diff changeset
30
705
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
31 return 0;
2aa02c15c639 some more integer iasm tests
thomask
parents:
diff changeset
32 }
1046
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
33 }else{
1386
7a397590d6e0 64-bit fixes
thomask
parents: 1046
diff changeset
34 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
1046
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
35 static assert(0);
01fb56fb4971 inline ASM review
thomask
parents: 1044
diff changeset
36 }