annotate tests/mini/asm3.d @ 945:03d7c4aac654

SWITCHED TO LLVM 2.5 ! Applied patch from ticket #129 to compile against latest LLVM. Thanks Frits van Bommel. Fixed implicit return by asm block at the end of a function on x86-32. Other architectures will produce an error at the moment. Adding support for new targets is fairly simple. Fixed return calling convention for complex numbers, ST and ST(1) were switched around. Added some testcases. I've run a dstress test and there are no regressions. However, the runtime does not seem to compile with symbolic debug information. -O3 -release -inline works well and is what I used for the dstress run. Tango does not compile, a small workaround is needed in tango.io.digest.Digest.Digest.hexDigest. See ticket #206 .
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 08 Feb 2009 05:26:54 +0100
parents ef5f75ae6895
children 4c524d80e6e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
228
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
1 module tangotests.asm3;
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
2
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
3 extern(C) int printf(char*, ...);
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
4
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
5 void main()
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
6 {
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
7 char* fmt = "Hello D World\n";
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
8 printf(fmt);
741
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
9 version (LLVM_InlineAsm_X86)
228
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
10 {
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
11 asm
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
12 {
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
13 push fmt;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
14 call printf;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
15 pop EAX;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
16 }
228
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
17 }
741
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
18 else version(LLVM_InlineAsm_X86_64)
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
19 {
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
20 asm
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
21 {
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
22 movq RDI, fmt;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
23 xor AL, AL;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 744
diff changeset
24 call printf;
741
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
25 }
4ac97ec7c18e Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents: 341
diff changeset
26 }
228
52d1e9d27dc6 [svn r244] added another asm test.
lindquist
parents:
diff changeset
27 }