LLVM backend for 6502
Go to file
Nate Begeman b2c4bf3ff6 Handle some more real world cases of rlwimi. These don't come up that
regularly in "normal" code, but for things like software graphics, they
make a big difference.

For the following code:
unsigned short Trans16Bit(unsigned srcA,unsigned srcB,unsigned alpha)
{
	unsigned tmpA,tmpB,mixed;
	tmpA = ((srcA & 0x03E0) << 15) | (srcA & 0x7C1F);
	tmpB = ((srcB & 0x03E0) << 15) | (srcB & 0x7C1F);
	mixed = (tmpA * alpha) + (tmpB * (32 - alpha));
	return ((mixed >> 5) & 0x7C1F) | ((mixed >> 20) & 0x03E0);
}

We now generate:
_Trans16Bit:
.LBB_Trans16Bit_0:      ; entry
        andi. r2, r4, 31775
        rlwimi r2, r4, 15, 7, 11
        subfic r4, r5, 32
        mullw r2, r2, r4
        andi. r4, r3, 31775
        rlwimi r4, r3, 15, 7, 11
        mullw r3, r4, r5
        add r2, r2, r3
        srwi r3, r2, 5
        andi. r3, r3, 31775
        rlwimi r3, r2, 12, 22, 26
        blr

Instead of:
_Trans16Bit:
.LBB_Trans16Bit_0:      ; entry
        slwi r2, r4, 15
        rlwinm r2, r2, 0, 7, 11
        andi. r4, r4, 31775
        or r2, r2, r4
        subfic r4, r5, 32
        mullw r2, r2, r4
        slwi r4, r3, 15
        rlwinm r4, r4, 0, 7, 11
        andi. r3, r3, 31775
        or r3, r4, r3
        mullw r3, r3, r5
        add r2, r2, r3
        srwi r3, r2, 5
        andi. r3, r3, 31775
        srwi r2, r2, 20
        rlwimi r3, r2, 0, 22, 26
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22201 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 04:14:27 +00:00
autoconf We also have V8, so do not force every Sparc to be treated like a V9. It is 2005-06-06 19:29:36 +00:00
docs Reid linked to the CVS release notes on newsforge :( 2005-05-18 22:23:56 +00:00
examples Don't forget these are calls 2005-05-06 06:21:59 +00:00
include/llvm Give the asmparser the ability to parse strings, patch contributed by 2005-05-20 03:25:29 +00:00
lib Handle some more real world cases of rlwimi. These don't come up that 2005-06-08 04:14:27 +00:00
projects Make the value to -s not be interpreted as a file name 2005-05-19 01:05:02 +00:00
runtime Remove trailing whitespace 2005-04-21 23:48:37 +00:00
test Remove trailing blank line, just to test whether the new commit script 2005-05-21 01:29:30 +00:00
tools Make sure that tool names don't have any leading or trailing spaces in them. 2005-05-19 21:10:31 +00:00
utils * Add ability to specify the target LLVM will compile for via configure 2005-06-06 19:17:05 +00:00
win32 Add SimplyLibCalls.cpp to VC++ build 2005-04-26 02:57:49 +00:00
.cvsignore Ignore the autom4te.cache directoy. 2004-12-24 15:11:23 +00:00
configure Fix the definitions of LLVMGCC and LLVMGXX to include the EXEEXT (the 2005-06-02 22:34:49 +00:00
CREDITS.TXT Improve statement 2005-05-15 21:38:32 +00:00
LICENSE.TXT Remove extraneous colons after program names for consistency 2005-05-12 21:39:01 +00:00
llvm.spec Onward to LLVM-1.6 and beyond! 2005-05-18 20:23:20 +00:00
llvm.spec.in Onward to LLVM-1.6 and beyond! 2005-05-18 20:23:20 +00:00
Makefile Make sure the tools get built if no build target is specified. 2005-05-29 00:49:24 +00:00
Makefile.common Update comments to reflect new variable names. Patch contributed by 2005-02-14 16:02:19 +00:00
Makefile.config.in Two changes: 2005-04-22 17:14:14 +00:00
Makefile.rules Two dist-check related changes: 2005-05-24 02:33:20 +00:00
README.txt Make the text of this file a little more useful. 2004-09-02 22:49:27 +00:00

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.