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
examples
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
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
.cvsignore
configure Fix the definitions of LLVMGCC and LLVMGXX to include the EXEEXT (the 2005-06-02 22:34:49 +00:00
CREDITS.TXT
LICENSE.TXT
llvm.spec
llvm.spec.in
Makefile Make sure the tools get built if no build target is specified. 2005-05-29 00:49:24 +00:00
Makefile.common
Makefile.config.in
Makefile.rules Two dist-check related changes: 2005-05-24 02:33:20 +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.