annotate run/a/asm_rcr_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
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_rcr_01_B;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
6
1040
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
7 version(D_InlineAsm_X86){
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
8 version = runTest;
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
9 }else version(D_InlineAsm_X86_64){
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
10 version = runTest;
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
11 }
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
12
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
13 version(runTest){
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
14 int main(){
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
15 ushort a = 0b1111_1100__0000_0001;
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
16
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
17 asm{
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
18 clc;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
19 rcr a, 1;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
20 }
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
21
1040
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
22 if(a != 0b0111_1110__0000_0000){
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
23 assert(0);
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
24 }
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
25
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
26 asm{
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
27 stc;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
28 rcr a, 1;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
29 }
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
30
1040
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
31 if(a != 0b1011_1111__0000_0000){
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
32 assert(0);
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
33 }
1044
03c97933de98 inline ASM review
thomask
parents: 1040
diff changeset
34
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
35 return 0;
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
36 }
1040
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
37 }else{
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
38 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
a3d6bbc8dec0 inline ASM review
thomask
parents: 856
diff changeset
39 static assert(0);
702
4c5b7f538994 some more asm tests
thomask
parents:
diff changeset
40 }