LLVM backend for 6502
Go to file
Bill Wendling 43a6c5e2fc We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:41:22 +00:00
autoconf Fix LLVM target initialization to deal with sociopathic outside projects 2010-08-30 18:34:48 +00:00
bindings Remove unions from the ocaml bindings. 2010-08-28 09:47:42 +00:00
cmake Fix LLVM target initialization to deal with sociopathic outside projects 2010-08-30 18:34:48 +00:00
docs Stack slot access methods are in TargetInstrInfo. 2010-08-31 22:01:07 +00:00
examples Remove this from the main tree. I'll host it out of tree. 2010-08-30 21:34:26 +00:00
include Reapply r112623. Included additional check for unused byval argument. 2010-08-31 22:22:42 +00:00
lib We have a chance for an optimization. Consider this code: 2010-08-31 22:41:22 +00:00
projects Remove bogus link. 2010-07-16 06:33:36 +00:00
runtime Delete a blank line. 2010-04-16 13:32:55 +00:00
test We have a chance for an optimization. Consider this code: 2010-08-31 22:41:22 +00:00
tools Cleanup Whitespace. 2010-08-31 06:36:46 +00:00
unittests StringRef::compare_numeric also differed from StringRef::compare for characters > 127. 2010-08-26 15:25:35 +00:00
utils Don't worry about union types. 2010-08-29 14:50:21 +00:00
website
build-for-llvm-top.sh
CMakeLists.txt Attempt to remove the MSIL backend from CMake as well based on Chris's r112375. 2010-08-30 07:25:54 +00:00
configure Fix LLVM target initialization to deal with sociopathic outside projects 2010-08-30 18:34:48 +00:00
CREDITS.TXT Flesh out the list of things I've worked on. 2010-08-29 04:22:35 +00:00
LICENSE.TXT
llvm.spec.in
Makefile llvmc: remove dynamic plugins. 2010-08-15 07:07:12 +00:00
Makefile.common
Makefile.config.in Make the makefiles go much faster by using the realpath 2010-08-03 22:53:22 +00:00
Makefile.rules Fix the "Finished Creating" messages for aliases to print the 2010-08-18 01:35:53 +00:00
ModuleInfo.txt
README.txt (Hopefully) One last test. 2010-07-27 00:04:55 +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.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.