LLVM backend for 6502
Go to file
Chris Lattner ce7cafa960 shld is a very high latency operation. Instead of emitting it for shifts of
two or three, open code the equivalent operation which is faster on athlon
and P4 (by a substantial margin).

For example, instead of compiling this:

long long X2(long long Y) { return Y << 2; }

to:

X3_2:
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        shldl $2, %eax, %edx
        shll $2, %eax
        ret

Compile it to:

X2:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        shrl $30, %edx
        leal (%edx,%ecx,4), %edx
        shll $2, %eax
        ret

Likewise, for << 3, compile to:

X3:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        shrl $29, %edx
        leal (%edx,%ecx,8), %edx
        shll $3, %eax
        ret

This matches icc, except that icc open codes the shifts as adds on the P4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-13 20:48:57 +00:00
autoconf Add the RUNTEST autoconf onfiguration variable for Deja-gnu support. This 2004-11-07 23:29:39 +00:00
docs Document the new llvm-ranlib command. 2004-11-12 00:18:35 +00:00
examples Clean up code layout, delete extra blank line, say fibonacci' instead of foo' 2004-11-05 04:11:40 +00:00
include/llvm Add support for shifts 2004-11-13 19:32:45 +00:00
lib shld is a very high latency operation. Instead of emitting it for shifts of 2004-11-13 20:48:57 +00:00
projects Change macro names per naming standard in Makefile.rules. 2004-10-30 09:26:22 +00:00
runtime Internalize variable names to prevent recursive assignment. Cleanup docs. 2004-10-30 09:19:36 +00:00
test New testcase 2004-11-13 19:49:39 +00:00
tools Make sure llee can deal with compressed bytecode too. 2004-11-09 20:21:25 +00:00
utils * Add support for f2c and the -f2c switch to enable Fortran benchmarks 2004-11-08 03:28:27 +00:00
win32 This file is gone 2004-11-08 18:46:09 +00:00
.cvsignore
configure Add the RUNTEST autoconf onfiguration variable for Deja-gnu support. This 2004-11-07 23:29:39 +00:00
CREDITS.TXT
LICENSE.TXT
llvm.spec
llvm.spec.in
Makefile Move path override in test/Makefile. 2004-11-08 05:44:05 +00:00
Makefile.common No really, this is LLVM! 2004-10-30 00:57:52 +00:00
Makefile.config.in Add the RUNTEST autoconf onfiguration variable for Deja-gnu support. This 2004-11-07 23:29:39 +00:00
Makefile.rules * Clean up all the shared library output on uninstall 2004-11-12 02:27:36 +00:00
README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level 
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments. 

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.