LLVM backend for 6502
Go to file
Chris Lattner ae6a305094 * Eliminate calls to CastInst::createInferredCast.
* Add support for promoting unions with fp values in them.  This produces
   our new int<->fp bitcast instructions, implementing
   Transforms/ScalarRepl/union-fp-int.ll

As an example, this allows us to compile this:

union intfloat { int i; float f; };
float invsqrt(const float arg_x) {
    union intfloat x = { .f = arg_x };
    const float xhalf = arg_x * 0.5f;
    x.i = 0x5f3759df - (x.i >> 1);
    return x.f * (1.5f - xhalf * x.f * x.f);
}

into:

_invsqrt:
        movss 4(%esp), %xmm0
        movd %xmm0, %eax
        sarl %eax
        movl $1597463007, %ecx
        subl %eax, %ecx
        movd %ecx, %xmm1
        mulss LCPI1_0, %xmm0
        mulss %xmm1, %xmm0
        movss LCPI1_1, %xmm2
        mulss %xmm1, %xmm0
        subss %xmm0, %xmm2
        movl 8(%esp), %eax
        mulss %xmm2, %xmm1
        movss %xmm1, (%eax)
        ret

instead of:

_invsqrt:
        subl $4, %esp
        movss 8(%esp), %xmm0
        movss %xmm0, (%esp)
        movl (%esp), %eax
        movl $1597463007, %ecx
        sarl %eax
        subl %eax, %ecx
        movl %ecx, (%esp)
        mulss LCPI1_0, %xmm0
        movss (%esp), %xmm1
        mulss %xmm1, %xmm0
        mulss %xmm1, %xmm0
        movss LCPI1_1, %xmm2
        subss %xmm0, %xmm2
        mulss %xmm2, %xmm1
        movl 12(%esp), %eax
        movss %xmm1, (%eax)
        addl $4, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32418 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-10 23:56:50 +00:00
autoconf Cleaned setjmp/longjmp lowering interfaces. Now we're producing right 2006-12-10 23:12:42 +00:00
docs Fixed some formatting. 2006-12-09 01:35:43 +00:00
examples Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are 2006-12-07 01:30:32 +00:00
include/llvm Cleaned setjmp/longjmp lowering interfaces. Now we're producing right 2006-12-10 23:12:42 +00:00
lib * Eliminate calls to CastInst::createInferredCast. 2006-12-10 23:56:50 +00:00
projects Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are 2006-12-07 01:30:32 +00:00
runtime Undo removal of the runtime libraries. While this may have been a bit 2006-11-17 03:32:33 +00:00
test new testcase 2006-12-10 23:52:28 +00:00
tools make statistics and timing info print even if the JIT'd program calls exit 2006-12-10 19:01:52 +00:00
utils Allow the input of the test program to be specified. 2006-12-09 04:42:33 +00:00
win32 Unbreak VC++ build. 2006-12-02 02:22:01 +00:00
Xcode Try again. 2006-11-05 21:21:20 +00:00
.cvsignore Add llvm.spec, a generated file. 2006-10-18 19:23:56 +00:00
configure Regenerate. 2006-12-10 23:29:19 +00:00
CREDITS.TXT The list is sorted by name. 2006-08-29 01:42:47 +00:00
LICENSE.TXT burg is gone 2006-09-11 17:28:11 +00:00
llvm.spec.in
Makefile Undo removal of the runtime libraries. While this may have been a bit 2006-11-17 03:32:33 +00:00
Makefile.common
Makefile.config.in For PR739: 2006-12-10 04:09:19 +00:00
Makefile.rules Don't bother with setting the path before running llvm-gcc4, it doesn't 2006-12-10 04:56:38 +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.