llvm-6502/lib
Chris Lattner 8d5a894501 Codegen insertelement with constant insertion points as scalar_to_vector
and a shuffle.  For this:

void %test2(<4 x float>* %F, float %f) {
        %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
        %tmp3 = add <4 x float> %tmp, %tmp              ; <<4 x float>> [#uses=1]
        %tmp2 = insertelement <4 x float> %tmp3, float %f, uint 2               ; <<4 x float>> [#uses=2]
        %tmp6 = add <4 x float> %tmp2, %tmp2            ; <<4 x float>> [#uses=1]
        store <4 x float> %tmp6, <4 x float>* %F
        ret void
}

we now get this on X86 (which will get better):

_test2:
        movl 4(%esp), %eax
        movaps (%eax), %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, %xmm1
        shufps $3, %xmm1, %xmm1
        movaps %xmm0, %xmm2
        shufps $1, %xmm2, %xmm2
        unpcklps %xmm1, %xmm2
        movss 8(%esp), %xmm1
        unpcklps %xmm1, %xmm0
        unpcklps %xmm2, %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, (%eax)
        ret

instead of:

_test2:
        subl $28, %esp
        movl 32(%esp), %eax
        movaps (%eax), %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, (%esp)
        movss 36(%esp), %xmm0
        movss %xmm0, 8(%esp)
        movaps (%esp), %xmm0
        addps %xmm0, %xmm0
        movaps %xmm0, (%eax)
        addl $28, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27765 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 19:21:01 +00:00
..
Analysis Implement value #'ing for vector operations, implementing 2006-04-14 05:10:20 +00:00
Archive more C++ daintiness 2005-12-26 14:31:26 +00:00
AsmParser Make sure CVS versions of yacc and lex files get distributed. 2006-04-12 20:57:05 +00:00
Bytecode use isValidOperands instead of duplicating checks 2006-04-08 04:09:19 +00:00
CodeGen Codegen insertelement with constant insertion points as scalar_to_vector 2006-04-17 19:21:01 +00:00
Debugger Add the README files to the distribution. 2006-04-13 06:39:24 +00:00
ExecutionEngine Get JIT/Interpreter working on Windows again. 2006-03-24 02:53:49 +00:00
Linker Add shufflevector support 2006-04-08 01:19:47 +00:00
Support Qualify dwarf namespace inside llvm namespace. 2006-02-27 22:37:23 +00:00
System Add checks for __OpenBSD__. 2006-04-17 17:55:41 +00:00
Target Make sure to check splats of every constant we can, handle splat(31) by 2006-04-17 18:09:22 +00:00
Transforms Fix a bug in the 'shuffle(undef,x,mask) -> shuffle(x, undef,mask')' xform 2006-04-16 00:51:47 +00:00
VMCore Move these ctors out of line 2006-04-14 22:20:32 +00:00
Makefile Add the Linker library 2004-11-14 21:54:41 +00:00