LLVM backend for 6502
Go to file
Chris Lattner b20e0b1fdd it turns out that when ".with.overflow" intrinsics were added to the X86
backend that they were all implemented except umul.  This one fell back
to the default implementation that did a hi/lo multiply and compared the
top.  Fix this to check the overflow flag that the 'mul' instruction
sets, so we can avoid an explicit test.  Now we compile:

void *func(long count) {
      return new int[count];
}

into:

__Z4funcl:                              ## @_Z4funcl
	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
	seto	%cl                     ## encoding: [0x0f,0x90,0xc1]
	testb	%cl, %cl                ## encoding: [0x84,0xc9]
	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
	jmp	__Znam                  ## TAILCALL

instead of:

__Z4funcl:                              ## @_Z4funcl
	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
	testq	%rdx, %rdx              ## encoding: [0x48,0x85,0xd2]
	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
	jmp	__Znam                  ## TAILCALL

Other than the silly seto+test, this is using the o bit directly, so it's going in the right
direction.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 07:30:36 +00:00
autoconf Apparently OS X 10.4 doesn't have __crashreporter_info__. 2010-12-03 07:45:22 +00:00
bindings Try to fix ocaml bindings. 2010-10-08 00:36:21 +00:00
cmake Disable C++ exception handling on MSVC. 2010-12-04 14:30:22 +00:00
docs Add naming rules to the coding standards. 2010-12-02 05:10:07 +00:00
examples Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks 2010-11-16 17:28:22 +00:00
include Remember the contents of leb and dwarfline fragments when relaxing. This avoids 2010-12-04 21:58:52 +00:00
lib it turns out that when ".with.overflow" intrinsics were added to the X86 2010-12-05 07:30:36 +00:00
projects I swear I did a make clean and make before committing all this... 2010-11-29 18:47:54 +00:00
runtime
test it turns out that when ".with.overflow" intrinsics were added to the X86 2010-12-05 07:30:36 +00:00
tools Do not try luck by using given name to create temporary file. In parallel builds it may not work. 2010-12-03 23:58:31 +00:00
unittests Unittests/Support/PathV2: Add FileSystem tests. 2010-12-04 03:18:42 +00:00
utils Remove trailing whitespace. 2010-12-04 04:40:15 +00:00
website
build-for-llvm-top.sh
CMakeLists.txt Disable C++ exception handling on MSVC. 2010-12-04 14:30:22 +00:00
configure Apparently OS X 10.4 doesn't have __crashreporter_info__. 2010-12-03 07:45:22 +00:00
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
Makefile Merge System into Support. 2010-11-29 18:16:10 +00:00
Makefile.common
Makefile.config.in It seems inconsistent to have LLVMCC_EMITIR_FLAG and 2010-11-25 17:57:43 +00:00
Makefile.rules Now to chant the magical incantation that will exorcise the System library 2010-11-29 19:44:50 +00:00
ModuleInfo.txt
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.

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