oota-llvm.git
18 years agoImplement promotion for EXTRACT_VECTOR_ELT, allowing v16i8 multiplies to work with...
Chris Lattner [Sun, 2 Apr 2006 05:06:04 +0000 (05:06 +0000)]
Implement promotion for EXTRACT_VECTOR_ELT, allowing v16i8 multiplies to work with PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27349 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoadd a note
Chris Lattner [Sun, 2 Apr 2006 03:59:11 +0000 (03:59 +0000)]
add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27348 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement the Expand action for binary vector operations to break the binop
Chris Lattner [Sun, 2 Apr 2006 03:57:31 +0000 (03:57 +0000)]
Implement the Expand action for binary vector operations to break the binop
into elements and operate on each piece.  This allows generic vector integer
multiplies to work on PPC, though the generated code is horrible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27347 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoIntrinsics that just load from memory can be treated like loads: they don't
Chris Lattner [Sun, 2 Apr 2006 03:41:14 +0000 (03:41 +0000)]
Intrinsics that just load from memory can be treated like loads: they don't
have to serialize against each other.  This allows us to schedule lvx's
across each other, for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27346 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdjust the Intrinsics.gen interface a little bit
Chris Lattner [Sun, 2 Apr 2006 03:35:30 +0000 (03:35 +0000)]
Adjust the Intrinsics.gen interface a little bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27345 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdjust to change in Intrinsics.gen interface.
Chris Lattner [Sun, 2 Apr 2006 03:35:01 +0000 (03:35 +0000)]
Adjust to change in Intrinsics.gen interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27344 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoConstant fold all of the vector binops. This allows us to compile this:
Chris Lattner [Sun, 2 Apr 2006 03:25:57 +0000 (03:25 +0000)]
Constant fold all of the vector binops.  This allows us to compile this:

"vector unsigned char mergeLowHigh = (vector unsigned char)
( 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15, 20, 21, 22, 23 );
vector unsigned char mergeHighLow = vec_xor( mergeLowHigh, vec_splat_u8(8));"

aka:

void %test2(<16 x sbyte>* %P) {
  store <16 x sbyte> cast (<4 x int> xor (<4 x int> cast (<16 x ubyte> < ubyte 8, ubyte 9, ubyte 10, ubyte 11, ubyte 16, ubyte 17, ubyte 18, ubyte 19, ubyte 12, ubyte 13, ubyte 14, ubyte 15, ubyte 20, ubyte 21, ubyte 22, ubyte 23 > to <4 x int>), <4 x int> cast (<16 x sbyte> < sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8, sbyte 8 > to <4 x int>)) to <16 x sbyte>), <16 x sbyte> * %P
  ret void
}

into this:

_test2:
        mfspr r2, 256
        oris r4, r2, 32768
        mtspr 256, r4
        li r4, lo16(LCPI2_0)
        lis r5, ha16(LCPI2_0)
        lvx v0, r5, r4
        stvx v0, 0, r3
        mtspr 256, r2
        blr

instead of this:

_test2:
        mfspr r2, 256
        oris r4, r2, 49152
        mtspr 256, r4
        li r4, lo16(LCPI2_0)
        lis r5, ha16(LCPI2_0)
        vspltisb v0, 8
        lvx v1, r5, r4
        vxor v0, v1, v0
        stvx v0, 0, r3
        mtspr 256, r2
        blr

... which occurs here:
http://developer.apple.com/hardware/ve/calcspeed.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27343 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a new -view-legalize-dags command line option
Chris Lattner [Sun, 2 Apr 2006 03:07:27 +0000 (03:07 +0000)]
Add a new -view-legalize-dags command line option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27342 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement constant folding of bit_convert of arbitrary constant vbuild_vector nodes.
Chris Lattner [Sun, 2 Apr 2006 02:53:43 +0000 (02:53 +0000)]
Implement constant folding of bit_convert of arbitrary constant vbuild_vector nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27341 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoThese entries already exist
Chris Lattner [Sun, 2 Apr 2006 02:51:27 +0000 (02:51 +0000)]
These entries already exist

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27340 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd some missing node names
Chris Lattner [Sun, 2 Apr 2006 02:41:18 +0000 (02:41 +0000)]
Add some missing node names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27339 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agosimplify this method
Chris Lattner [Sun, 2 Apr 2006 02:28:52 +0000 (02:28 +0000)]
simplify this method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27338 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNew note
Chris Lattner [Sun, 2 Apr 2006 01:47:20 +0000 (01:47 +0000)]
New note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27337 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoConstant fold casts from things like <4 x int> -> <4 x uint>, likewise int<->fp.
Chris Lattner [Sun, 2 Apr 2006 01:38:28 +0000 (01:38 +0000)]
Constant fold casts from things like <4 x int> -> <4 x uint>, likewise int<->fp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27336 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoCustom lower all BUILD_VECTOR's so that we can compile vec_splat_u8(8) into
Chris Lattner [Sun, 2 Apr 2006 00:43:36 +0000 (00:43 +0000)]
Custom lower all BUILD_VECTOR's so that we can compile vec_splat_u8(8) into
"vspltisb v0, 8" instead of a constant pool load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27335 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoPrefer larger register classes over smaller ones when a register occurs in
Chris Lattner [Sun, 2 Apr 2006 00:24:45 +0000 (00:24 +0000)]
Prefer larger register classes over smaller ones when a register occurs in
multiple register classes.  This fixes PowerPC/2006-04-01-FloatDoubleExtend.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27334 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNew testcase that crashes the compiler.
Chris Lattner [Sun, 2 Apr 2006 00:23:59 +0000 (00:23 +0000)]
New testcase that crashes the compiler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27333 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoadd valuemapper support for inline asm
Chris Lattner [Sat, 1 Apr 2006 23:17:11 +0000 (23:17 +0000)]
add valuemapper support for inline asm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27332 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement vnot using VNOR instead of using 'vspltisb v0, -1' and vxor
Chris Lattner [Sat, 1 Apr 2006 22:41:47 +0000 (22:41 +0000)]
Implement vnot using VNOR instead of using 'vspltisb v0, -1' and vxor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27331 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix InstCombine/2006-04-01-InfLoop.ll
Chris Lattner [Sat, 1 Apr 2006 22:05:01 +0000 (22:05 +0000)]
Fix InstCombine/2006-04-01-InfLoop.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27330 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNew testcase that caused instcombine to infinitely loop (with my recent
Chris Lattner [Sat, 1 Apr 2006 22:04:40 +0000 (22:04 +0000)]
New testcase that caused instcombine to infinitely loop (with my recent
patch), distilled from Applications/JM/ldecod

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27329 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFold A^(B&A) -> (B&A)^A
Chris Lattner [Sat, 1 Apr 2006 08:03:55 +0000 (08:03 +0000)]
Fold A^(B&A) -> (B&A)^A
Fold (B&A)^A == ~B & A

This implements InstCombine/xor.ll:test2[56]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27328 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcases
Chris Lattner [Sat, 1 Apr 2006 08:02:51 +0000 (08:02 +0000)]
new testcases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27327 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll and
Chris Lattner [Sat, 1 Apr 2006 04:48:52 +0000 (04:48 +0000)]
Fix Transforms/IndVarsSimplify/2006-03-31-NegativeStride.ll and
PR726 by performing consistent signed division, not consistent unsigned
division when evaluating scev's.  Do not touch udivs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27326 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase for PR726
Chris Lattner [Sat, 1 Apr 2006 04:47:17 +0000 (04:47 +0000)]
new testcase for PR726

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27325 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoADd a note
Chris Lattner [Sat, 1 Apr 2006 04:08:29 +0000 (04:08 +0000)]
ADd a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27324 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoIf we can look through vector operations to find the scalar version of an
Chris Lattner [Fri, 31 Mar 2006 23:01:56 +0000 (23:01 +0000)]
If we can look through vector operations to find the scalar version of an
extract_element'd value, do so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27323 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoShrinkify some more intrinsic definitions.
Chris Lattner [Fri, 31 Mar 2006 22:41:56 +0000 (22:41 +0000)]
Shrinkify some more intrinsic definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27322 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAn entry about packed type alignments.
Evan Cheng [Fri, 31 Mar 2006 22:35:14 +0000 (22:35 +0000)]
An entry about packed type alignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27321 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoPull operand asm string into base class, shrinkifying intrinsic definitions.
Chris Lattner [Fri, 31 Mar 2006 22:34:05 +0000 (22:34 +0000)]
Pull operand asm string into base class, shrinkifying intrinsic definitions.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27320 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoTargetData.cpp::getTypeInfo() was returning alignment of element type as the
Evan Cheng [Fri, 31 Mar 2006 22:33:42 +0000 (22:33 +0000)]
TargetData.cpp::getTypeInfo() was returning alignment of element type as the
alignment of a packed type. This is obviously wrong. Added a workaround that
returns the size of the packed type as its alignment. The correct fix would
be to return a target dependent alignment value provided via TargetLowering
(or some other interface).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27319 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoDelete identity shuffles, implementing CodeGen/Generic/vector-identity-shuffle.ll
Chris Lattner [Fri, 31 Mar 2006 22:16:43 +0000 (22:16 +0000)]
Delete identity shuffles, implementing CodeGen/Generic/vector-identity-shuffle.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27317 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAn identity shuffle shouldn't generate any permute code.
Chris Lattner [Fri, 31 Mar 2006 22:16:19 +0000 (22:16 +0000)]
An identity shuffle shouldn't generate any permute code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27316 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix 80 column violations :)
Chris Lattner [Fri, 31 Mar 2006 21:57:36 +0000 (21:57 +0000)]
Fix 80 column violations :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27315 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoUse a X86 target specific node X86ISD::PINSRW instead of a mal-formed
Evan Cheng [Fri, 31 Mar 2006 21:55:24 +0000 (21:55 +0000)]
Use a X86 target specific node X86ISD::PINSRW instead of a mal-formed
INSERT_VECTOR_ELT to insert a 16-bit value in a 128-bit vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27314 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoregenerate
Chris Lattner [Fri, 31 Mar 2006 21:54:11 +0000 (21:54 +0000)]
regenerate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27313 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoGeneralize the previous binary operator support and add a string concatenation
Chris Lattner [Fri, 31 Mar 2006 21:53:49 +0000 (21:53 +0000)]
Generalize the previous binary operator support and add a string concatenation
operation.  This implements Regression/TableGen/strconcat.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27312 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase
Chris Lattner [Fri, 31 Mar 2006 21:53:01 +0000 (21:53 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27311 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdded support for SSE3 horizontal ops: haddp{s|d} and hsub{s|d}.
Evan Cheng [Fri, 31 Mar 2006 21:29:33 +0000 (21:29 +0000)]
Added support for SSE3 horizontal ops: haddp{s|d} and hsub{s|d}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27310 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdded haddp{s|d} and hsubp{s|d} intrinsics.
Evan Cheng [Fri, 31 Mar 2006 21:28:46 +0000 (21:28 +0000)]
Added haddp{s|d} and hsubp{s|d} intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27309 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agofix a pasto
Chris Lattner [Fri, 31 Mar 2006 21:19:06 +0000 (21:19 +0000)]
fix a pasto

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27308 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd vperm support for all datatypes
Chris Lattner [Fri, 31 Mar 2006 20:00:35 +0000 (20:00 +0000)]
Add vperm support for all datatypes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27307 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRearrange code a bit
Chris Lattner [Fri, 31 Mar 2006 19:52:36 +0000 (19:52 +0000)]
Rearrange code a bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27306 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd, sub and shuffle are legal for all vector types
Chris Lattner [Fri, 31 Mar 2006 19:48:58 +0000 (19:48 +0000)]
Add, sub and shuffle are legal for all vector types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27305 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd support to use pextrw and pinsrw to extract and insert a word element
Evan Cheng [Fri, 31 Mar 2006 19:22:53 +0000 (19:22 +0000)]
Add support to use pextrw and pinsrw to extract and insert a word element
from a 128-bit vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27304 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd vector_extract and vector_insert nodes.
Evan Cheng [Fri, 31 Mar 2006 19:21:16 +0000 (19:21 +0000)]
Add vector_extract and vector_insert nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27303 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoadd a note
Chris Lattner [Fri, 31 Mar 2006 19:00:22 +0000 (19:00 +0000)]
add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27302 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoconstant fold extractelement with undef operands.
Chris Lattner [Fri, 31 Mar 2006 18:31:40 +0000 (18:31 +0000)]
constant fold extractelement with undef operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27301 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoextractelement(undef,x) -> undef
Chris Lattner [Fri, 31 Mar 2006 18:25:14 +0000 (18:25 +0000)]
extractelement(undef,x) -> undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27300 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoDo not endian swap split vector loads. This fixes UnitTests/Vector/sumarray-dbl...
Chris Lattner [Fri, 31 Mar 2006 18:22:37 +0000 (18:22 +0000)]
Do not endian swap split vector loads.  This fixes UnitTests/Vector/sumarray-dbl on PPC.

Now all UnitTests/Vector/* tests pass on PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27299 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoDo not endian swap the operands to a store if the operands came from a vector.
Chris Lattner [Fri, 31 Mar 2006 18:20:46 +0000 (18:20 +0000)]
Do not endian swap the operands to a store if the operands came from a vector.

This fixes UnitTests/Vector/simple.c with altivec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27298 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove dead *extloads. This allows us to codegen vector.ll:test_extract_elt
Chris Lattner [Fri, 31 Mar 2006 18:10:41 +0000 (18:10 +0000)]
Remove dead *extloads.  This allows us to codegen vector.ll:test_extract_elt
to:

test_extract_elt:
        alloc r3 = ar.pfs,0,1,0,0
        adds r8 = 12, r32
        ;;
        ldfs f8 = [r8]
        mov ar.pfs = r3
        br.ret.sptk.many rp

instead of:

test_extract_elt:
        alloc r3 = ar.pfs,0,1,0,0
        adds r8 = 28, r32
        adds r9 = 24, r32
        adds r10 = 20, r32
        adds r11 = 16, r32
        ;;
        ldfs f6 = [r8]
        ;;
        ldfs f6 = [r9]
        adds r8 = 12, r32
        adds r9 = 8, r32
        adds r14 = 4, r32
        ;;
        ldfs f6 = [r10]
        ;;
        ldfs f6 = [r11]
        ldfs f8 = [r8]
        ;;
        ldfs f6 = [r9]
        ;;
        ldfs f6 = [r14]
        ;;
        ldfs f6 = [r32]
        mov ar.pfs = r3
        br.ret.sptk.many rp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27297 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoDelete dead loads in the dag. This allows us to compile
Chris Lattner [Fri, 31 Mar 2006 18:06:18 +0000 (18:06 +0000)]
Delete dead loads in the dag.  This allows us to compile
vector.ll:test_extract_elt2 into:

_test_extract_elt2:
        lfd f1, 32(r3)
        blr

instead of:

_test_extract_elt2:
        lfd f0, 56(r3)
        lfd f0, 48(r3)
        lfd f0, 40(r3)
        lfd f1, 32(r3)
        lfd f0, 24(r3)
        lfd f0, 16(r3)
        lfd f0, 8(r3)
        lfd f0, 0(r3)
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27296 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMake this test harder, always check generic x86 and SSE-enabled x86.
Chris Lattner [Fri, 31 Mar 2006 17:59:16 +0000 (17:59 +0000)]
Make this test harder, always check generic x86 and SSE-enabled x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27295 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement PromoteOp for VEXTRACT_VECTOR_ELT. Thsi fixes
Chris Lattner [Fri, 31 Mar 2006 17:55:51 +0000 (17:55 +0000)]
Implement PromoteOp for VEXTRACT_VECTOR_ELT.  Thsi fixes
Generic/vector.ll:test_extract_elt on non-sse X86 systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27294 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoScalarized vector stores need not be legal, e.g. if the vector element type
Chris Lattner [Fri, 31 Mar 2006 17:37:22 +0000 (17:37 +0000)]
Scalarized vector stores need not be legal, e.g. if the vector element type
needs to be promoted or expanded.  Relegalize the scalar store once created.
This fixes CodeGen/Generic/vector.ll:test1 on non-SSE x86 targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27293 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix build breakage.
Jeff Cohen [Fri, 31 Mar 2006 07:22:05 +0000 (07:22 +0000)]
Fix build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27292 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonote to self: *save* file, then check it in
Chris Lattner [Fri, 31 Mar 2006 06:04:53 +0000 (06:04 +0000)]
note to self: *save* file, then check it in

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27291 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement an item from the readme, folding vcmp/vcmp. instructions with
Chris Lattner [Fri, 31 Mar 2006 06:02:07 +0000 (06:02 +0000)]
Implement an item from the readme, folding vcmp/vcmp. instructions with
identical instructions into a single instruction.  For example, for:

void test(vector float *x, vector float *y, int *P) {
  int v = vec_any_out(*x, *y);
  *x = (vector float)vec_cmpb(*x, *y);
  *P = v;
}

we now generate:

_test:
        mfspr r2, 256
        oris r6, r2, 49152
        mtspr 256, r6
        lvx v0, 0, r4
        lvx v1, 0, r3
        vcmpbfp. v0, v1, v0
        mfcr r4, 2
        stvx v0, 0, r3
        rlwinm r3, r4, 27, 31, 31
        xori r3, r3, 1
        stw r3, 0(r5)
        mtspr 256, r2
        blr

instead of:

_test:
        mfspr r2, 256
        oris r6, r2, 57344
        mtspr 256, r6
        lvx v0, 0, r4
        lvx v1, 0, r3
        vcmpbfp. v2, v1, v0
        mfcr r4, 2
***     vcmpbfp v0, v1, v0
        rlwinm r4, r4, 27, 31, 31
        stvx v0, 0, r3
        xori r3, r4, 1
        stw r3, 0(r5)
        mtspr 256, r2
        blr

Testcase here: CodeGen/PowerPC/vcmp-fold.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27290 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase
Chris Lattner [Fri, 31 Mar 2006 06:01:48 +0000 (06:01 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27289 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agocompactify some more instruction definitions
Chris Lattner [Fri, 31 Mar 2006 05:38:32 +0000 (05:38 +0000)]
compactify some more instruction definitions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27288 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoCompactify comparisons.
Chris Lattner [Fri, 31 Mar 2006 05:32:57 +0000 (05:32 +0000)]
Compactify comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27287 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAllow bits init values to be used in patterns, turn them into ints.
Chris Lattner [Fri, 31 Mar 2006 05:25:56 +0000 (05:25 +0000)]
Allow bits init values to be used in patterns, turn them into ints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27286 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoLower vector compares to VCMP nodes, just like we lower vector comparison
Chris Lattner [Fri, 31 Mar 2006 05:13:27 +0000 (05:13 +0000)]
Lower vector compares to VCMP nodes, just like we lower vector comparison
predicates to VCMPo nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27285 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoThese are done
Chris Lattner [Fri, 31 Mar 2006 04:53:21 +0000 (04:53 +0000)]
These are done

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27284 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFinal bugfix for PR724. GCC won't inline varargs functions, so use one to
Chris Lattner [Fri, 31 Mar 2006 04:48:26 +0000 (04:48 +0000)]
Final bugfix for PR724.  GCC won't inline varargs functions, so use one to
validate the prototype of intrinsic functions.  This prevents GCC from going
crazy and inlining too much stuff, eventually running out of memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27283 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a new method to verify intrinsic function prototypes.
Chris Lattner [Fri, 31 Mar 2006 04:46:47 +0000 (04:46 +0000)]
Add a new method to verify intrinsic function prototypes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27282 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoWhen emitting code for the verifier, instead of emitting each case statement
Chris Lattner [Fri, 31 Mar 2006 04:24:58 +0000 (04:24 +0000)]
When emitting code for the verifier, instead of emitting each case statement
independently, batch up checks so that identically typed intrinsics share
verifier code.  This dramatically reduces the size of the verifier function,
which should help avoid GCC running out of memory compiling Verifier.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27281 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMake sure to pass enough values to phi nodes when we are dealing with
Chris Lattner [Fri, 31 Mar 2006 02:12:18 +0000 (02:12 +0000)]
Make sure to pass enough values to phi nodes when we are dealing with
decimated vectors.  This fixes UnitTests/Vector/sumarray-dbl.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27280 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSignificantly improve handling of vectors that are live across basic blocks,
Chris Lattner [Fri, 31 Mar 2006 02:06:56 +0000 (02:06 +0000)]
Significantly improve handling of vectors that are live across basic blocks,
handling cases where the vector elements need promotion, expansion, and when
the vector type itself needs to be decimated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27278 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoWas returning the wrong type.
Chris Lattner [Fri, 31 Mar 2006 01:50:09 +0000 (01:50 +0000)]
Was returning the wrong type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27277 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMark INSERT_VECTOR_ELT as expand
Chris Lattner [Fri, 31 Mar 2006 01:48:55 +0000 (01:48 +0000)]
Mark INSERT_VECTOR_ELT as expand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27276 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoExpand all INSERT_VECTOR_ELT (obviously bad) for now.
Evan Cheng [Fri, 31 Mar 2006 01:30:39 +0000 (01:30 +0000)]
Expand all INSERT_VECTOR_ELT (obviously bad) for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27275 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoExpand INSERT_VECTOR_ELT to store vec, sp; store elt, sp+k; vec = load sp;
Evan Cheng [Fri, 31 Mar 2006 01:27:51 +0000 (01:27 +0000)]
Expand INSERT_VECTOR_ELT to store vec, sp; store elt, sp+k; vec = load sp;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27274 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoModify the TargetLowering::getPackedTypeBreakdown method to also return the
Chris Lattner [Fri, 31 Mar 2006 00:46:36 +0000 (00:46 +0000)]
Modify the TargetLowering::getPackedTypeBreakdown method to also return the
unpromoted element type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27273 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoTypo
Evan Cheng [Fri, 31 Mar 2006 00:33:57 +0000 (00:33 +0000)]
Typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27272 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoOk for vector_shuffle mask to contain undef elements.
Evan Cheng [Fri, 31 Mar 2006 00:30:29 +0000 (00:30 +0000)]
Ok for vector_shuffle mask to contain undef elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27271 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement TargetLowering::getPackedTypeBreakdown
Chris Lattner [Fri, 31 Mar 2006 00:28:56 +0000 (00:28 +0000)]
Implement TargetLowering::getPackedTypeBreakdown

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27270 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a method useful for decimating vectors.
Chris Lattner [Fri, 31 Mar 2006 00:28:23 +0000 (00:28 +0000)]
Add a method useful for decimating vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27269 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd the rest of the vmul instructions and the vmulsum* instructions.
Chris Lattner [Thu, 30 Mar 2006 23:39:06 +0000 (23:39 +0000)]
Add the rest of the vmul instructions and the vmulsum* instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27268 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agofix incorrect prototypes
Chris Lattner [Thu, 30 Mar 2006 23:32:58 +0000 (23:32 +0000)]
fix incorrect prototypes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27267 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoUse a new tblgen feature to significantly shrinkify instruction definitions that
Chris Lattner [Thu, 30 Mar 2006 23:21:27 +0000 (23:21 +0000)]
Use a new tblgen feature to significantly shrinkify instruction definitions that
directly correspond to intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27266 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a bunch of new instructions for intrinsics.
Chris Lattner [Thu, 30 Mar 2006 23:07:36 +0000 (23:07 +0000)]
Add a bunch of new instructions for intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27265 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoregenerate
Chris Lattner [Thu, 30 Mar 2006 22:51:12 +0000 (22:51 +0000)]
regenerate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27264 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement Regression/TableGen/DagDefSubst.ll
Chris Lattner [Thu, 30 Mar 2006 22:50:40 +0000 (22:50 +0000)]
Implement Regression/TableGen/DagDefSubst.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27263 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoDag operator should be able to be template params.
Chris Lattner [Thu, 30 Mar 2006 22:49:59 +0000 (22:49 +0000)]
Dag operator should be able to be template params.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27262 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix Transforms/InstCombine/2006-03-30-ExtractElement.ll
Chris Lattner [Thu, 30 Mar 2006 22:02:40 +0000 (22:02 +0000)]
Fix Transforms/InstCombine/2006-03-30-ExtractElement.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27261 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase that crashes instcombine
Chris Lattner [Thu, 30 Mar 2006 22:01:08 +0000 (22:01 +0000)]
new testcase that crashes instcombine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27260 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMake sure all possible shuffles are matched.
Evan Cheng [Thu, 30 Mar 2006 19:54:57 +0000 (19:54 +0000)]
Make sure all possible shuffles are matched.
Use pshufd, pshuhw, and pshulw to shuffle v4f32 if shufps doesn't match.
Use shufps to shuffle v4f32 if pshufd, pshuhw, and pshulw don't match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27259 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd vector multiply, multiply sum, pack, unpack, and lvsl/lvsr intrinsics.
Chris Lattner [Thu, 30 Mar 2006 18:52:02 +0000 (18:52 +0000)]
Add vector multiply, multiply sum, pack, unpack, and lvsl/lvsr intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27258 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMore logical ops patterns
Evan Cheng [Thu, 30 Mar 2006 07:33:32 +0000 (07:33 +0000)]
More logical ops patterns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27257 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd support for _mm_cmp{cc}_ss and _mm_cmp{cc}_ps intrinsics
Evan Cheng [Thu, 30 Mar 2006 06:21:22 +0000 (06:21 +0000)]
Add support for _mm_cmp{cc}_ss and _mm_cmp{cc}_ps intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27256 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd 128-bit pmovmskb intrinsic support.
Evan Cheng [Thu, 30 Mar 2006 00:33:26 +0000 (00:33 +0000)]
Add 128-bit pmovmskb intrinsic support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27255 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoChange SSE pack operation definitions to fit what the intrinsics expected.
Evan Cheng [Wed, 29 Mar 2006 23:53:14 +0000 (23:53 +0000)]
Change SSE pack operation definitions to fit what the intrinsics expected.
For example, packsswb actually creates a v16i8 from a pair of v8i16. But since
the intrinsic specification forces the output type to match the operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27254 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd SSE2 integer pack with saturation intrinsics.
Evan Cheng [Wed, 29 Mar 2006 23:09:19 +0000 (23:09 +0000)]
Add SSE2 integer pack with saturation intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27253 91177308-0d34-0410-b5e6-96231b3b80d8

18 years ago- Added some SSE2 128-bit packed integer ops.
Evan Cheng [Wed, 29 Mar 2006 23:07:14 +0000 (23:07 +0000)]
- Added some SSE2 128-bit packed integer ops.
- Added SSE2 128-bit integer pack with signed saturation ops.
- Added pshufhw and pshuflw ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27252 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a pshufhw test case.
Evan Cheng [Wed, 29 Mar 2006 22:51:28 +0000 (22:51 +0000)]
Add a pshufhw test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27251 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNeed to special case splat after all. Make the second operand of splat
Evan Cheng [Wed, 29 Mar 2006 19:02:40 +0000 (19:02 +0000)]
Need to special case splat after all. Make the second operand of splat
vector_shuffle undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27250 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoUse unpcklpd for v2f64 splat.
Evan Cheng [Wed, 29 Mar 2006 18:59:48 +0000 (18:59 +0000)]
Use unpcklpd for v2f64 splat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27249 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFloating point logical operation patterns should match bit_convert. Or else
Evan Cheng [Wed, 29 Mar 2006 18:47:40 +0000 (18:47 +0000)]
Floating point logical operation patterns should match bit_convert. Or else
integer vector logical operations would match andp{s|d} instead of pand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27248 91177308-0d34-0410-b5e6-96231b3b80d8