annotate tests/mini/naked_asm6.d @ 981:855889b7b268

Update some testcases now that 64-bit immediates are working.
author Frits van Bommel <fvbommel wxs.nl>
date Wed, 18 Feb 2009 23:18:34 +0100
parents 97688ff7cf93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
920
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
1 extern(C) int printf(char*, ...);
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
2
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
3 ulong retval() {
927
97688ff7cf93 Added X86-64 versioning
wilsonk@ubuntu
parents: 920
diff changeset
4 version (X86)
97688ff7cf93 Added X86-64 versioning
wilsonk@ubuntu
parents: 920
diff changeset
5 asm { naked; mov EAX, 0xff; mov EDX, 0xaa; ret; }
97688ff7cf93 Added X86-64 versioning
wilsonk@ubuntu
parents: 920
diff changeset
6 else version (X86_64)
981
855889b7b268 Update some testcases now that 64-bit immediates are working.
Frits van Bommel <fvbommel wxs.nl>
parents: 927
diff changeset
7 asm { naked; mov RAX, 0xaa000000ff; ret; }
920
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
8 }
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
9
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
10 ulong retval2() {
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
11 return (cast(ulong)0xaa << 32) | 0xff;
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
12 }
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
13
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
14 void main() {
981
855889b7b268 Update some testcases now that 64-bit immediates are working.
Frits van Bommel <fvbommel wxs.nl>
parents: 927
diff changeset
15 auto a = retval();
855889b7b268 Update some testcases now that 64-bit immediates are working.
Frits van Bommel <fvbommel wxs.nl>
parents: 927
diff changeset
16 auto b = retval2();
920
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
17 printf("%llu\n%llu\n", retval(), retval2());
981
855889b7b268 Update some testcases now that 64-bit immediates are working.
Frits van Bommel <fvbommel wxs.nl>
parents: 927
diff changeset
18 assert(a == 0xaa000000ff);
920
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
19 assert(a == b);
545f54041d91 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
20 }