annotate run/a/asm_clflush_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 2a1a6610f7ad
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
856
7b2c5a101190 meta data maintenance
thomask
parents: 756
diff changeset
1 // $HeadURL$
7b2c5a101190 meta data maintenance
thomask
parents: 756
diff changeset
2 // $Date$
7b2c5a101190 meta data maintenance
thomask
parents: 756
diff changeset
3 // $Author$
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
4
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
5 module dstress.run.a.asm_clflush_01;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
6
1151
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1116
diff changeset
7 // __DSTRESS_TORTURE_BLOCK__ -fPIC
2a1a6610f7ad various inline assembler fixes
thomask
parents: 1116
diff changeset
8
988
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
9 version(D_InlineAsm_X86){
989
a468938b0160 inline ASM review
thomask
parents: 988
diff changeset
10 version = runTest;
988
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
11 }else version(D_InlineAsm_X86_64){
989
a468938b0160 inline ASM review
thomask
parents: 988
diff changeset
12 version = runTest;
988
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
13 }
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
14
1116
5aa513911316 partial -fPIC fixes
thomask
parents: 1044
diff changeset
15 version(runTest){
5aa513911316 partial -fPIC fixes
thomask
parents: 1044
diff changeset
16 int main(){
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
17 uint a;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
18 ubyte b = 1;
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
19
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
20 asm{
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
21 mov EAX, 1;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
22 cpuid;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
23 mov EAX, EDX;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
24 mov EBX, 0x2000;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
25 and EAX, EBX;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
26 cmp EAX, EBX;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
27 jne not_supported;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
28 clflush b;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
29 inc EAX;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
30 not_supported:
756
9a121126b077 major "Torture" review
thomask
parents: 698
diff changeset
31 mov a, 1;
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
32 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
33
988
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
34 if((a != 0x20001) && (a != 1)){
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
35 assert(0);
052b82b4924c inline ASM review
thomask
parents: 856
diff changeset
36 }
1044
03c97933de98 inline ASM review
thomask
parents: 989
diff changeset
37
698
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
38 return 0;
5b99d1577b50 added some more iasm tests
thomask
parents:
diff changeset
39 }
1116
5aa513911316 partial -fPIC fixes
thomask
parents: 1044
diff changeset
40 }else{
5aa513911316 partial -fPIC fixes
thomask
parents: 1044
diff changeset
41 pragma(msg, "DSTRESS{XFAIL}: no inline ASM support");
5aa513911316 partial -fPIC fixes
thomask
parents: 1044
diff changeset
42 static assert(0);
756
9a121126b077 major "Torture" review
thomask
parents: 698
diff changeset
43 }