llvm-6502/lib
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
..
Analysis Removed more <iostream> includes 2006-12-07 20:28:15 +00:00
Archive Use ostream instead of iostream 2006-11-28 22:49:32 +00:00
AsmParser Hopefully these are the regenerated files 2006-12-08 18:07:09 +00:00
Bytecode Packed Structures 2006-12-08 18:06:16 +00:00
CodeGen Cleaned setjmp/longjmp lowering interfaces. Now we're producing right 2006-12-10 23:12:42 +00:00
Debugger Don't use <sstream> in Streams.h but <iosfwd> instead. 2006-12-07 23:41:45 +00:00
ExecutionEngine Removing even more <iostream> includes. 2006-12-07 20:04:42 +00:00
Linker Don't use <sstream> in Streams.h but <iosfwd> instead. 2006-12-07 23:41:45 +00:00
Support Change the implementation of statistic to not need destructors at all. 2006-12-08 20:00:42 +00:00
System Eliminate "control reaches end of non-void function" warnings. 2006-12-05 17:53:26 +00:00
Target Cleaned setjmp/longjmp lowering interfaces. Now we're producing right 2006-12-10 23:12:42 +00:00
Transforms * Eliminate calls to CastInst::createInferredCast. 2006-12-10 23:56:50 +00:00
VMCore fix PR1039 by making timing info be destroyed by llvm_shutdown, not by 2006-12-10 07:40:46 +00:00
Makefile