Chris Lattner
2a099c04c1
Pull some code out into a helper function.
...
Effeciently codegen even splats in the range [-32,30].
This allows us to codegen <30,30,30,30> as:
vspltisw v0, 15
vadduwm v2, v0, v0
instead of as a cp load.
llvm-svn: 27750
2006-04-17 06:00:21 +00:00
Chris Lattner
31b7d89e66
New testcase
...
llvm-svn: 27749
2006-04-17 05:58:22 +00:00
Chris Lattner
071ad01ceb
Implement a TODO: for any shuffle that can be viewed as a v4[if]32 shuffle,
...
if it can be implemented in 3 or fewer discrete altivec instructions, codegen
it as such. This implements Regression/CodeGen/PowerPC/vec_perf_shuffle.ll
llvm-svn: 27748
2006-04-17 05:28:54 +00:00
Chris Lattner
6e98b49b54
new testcase, these shuffles can be implemented with discrete instructions,
...
and shouldn't be lowered to vperm.
llvm-svn: 27747
2006-04-17 05:27:31 +00:00
Chris Lattner
85bfa3c2bc
Regenerate with adjusted costs
...
llvm-svn: 27746
2006-04-17 05:26:20 +00:00
Chris Lattner
e2e2cc5b28
Encode a cost of zero as a cost of 1.
...
llvm-svn: 27745
2006-04-17 05:25:16 +00:00
Chris Lattner
aac2a200cd
Regenerate with correct offset
...
llvm-svn: 27744
2006-04-17 05:08:46 +00:00
Chris Lattner
3dcfef6310
Really, I can count!
...
llvm-svn: 27743
2006-04-17 05:05:52 +00:00
Chris Lattner
311b1a6e23
Increase the opcodes by one each to disambiguate COPY from VMRGHW.
...
llvm-svn: 27742
2006-04-17 00:47:48 +00:00
Chris Lattner
895dba9714
assign stable opcodes to the various altivec ops.
...
llvm-svn: 27741
2006-04-17 00:47:18 +00:00
Chris Lattner
77a3ca6357
PPCPerfectShuffle.h is autogenerated, don't include it in the LOC counts.
...
llvm-svn: 27740
2006-04-17 00:46:09 +00:00
Chris Lattner
07a3d01a91
Check in a table, generated by llvm-PerfectShuffle, of optimal shuffles
...
of various 4-element vectors.
llvm-svn: 27739
2006-04-17 00:37:02 +00:00
Chris Lattner
ac66b4a11d
Rename BuildShuffleTable -> PerfectShuffle
...
llvm-svn: 27738
2006-04-17 00:35:34 +00:00
Chris Lattner
156c85ea42
rename the table
...
llvm-svn: 27737
2006-04-17 00:33:35 +00:00
Chris Lattner
2951955da9
Initial checking of a perfect shuffle generation program for 4-element
...
Altivec vectors.
llvm-svn: 27736
2006-04-17 00:30:41 +00:00
Evan Cheng
c6f665f5f3
Better way to splat v2f64
...
llvm-svn: 27735
2006-04-16 18:16:43 +00:00
Evan Cheng
20712deecb
movduprm, movshduprm bugs
...
llvm-svn: 27734
2006-04-16 18:11:28 +00:00
Evan Cheng
3064f9aaa6
Encoding bugs
...
llvm-svn: 27733
2006-04-16 07:02:22 +00:00
Evan Cheng
685ddd8152
Can't fold loads into alias vector SSE ops used for scalar operation. The load
...
address has to be 16-byte aligned but the values aren't spilled to 128-bit
locations.
llvm-svn: 27732
2006-04-16 06:58:19 +00:00
Chris Lattner
06a21ba96b
Implement a TODO: have the legalizer canonicalize a bunch of operations to
...
one type (v4i32) so that we don't have to write patterns for each type, and
so that more CSE opportunities are exposed.
llvm-svn: 27731
2006-04-16 01:37:57 +00:00
Chris Lattner
91226e5799
Add support for promoting stores from one legal type to another, allowing us
...
to write one pattern for vector stores instead of 4.
llvm-svn: 27730
2006-04-16 01:36:45 +00:00
Chris Lattner
fa5aa396c2
Make the BUILD_VECTOR lowering code much more aggressive w.r.t constant vectors.
...
Remove some done items from the todo list.
llvm-svn: 27729
2006-04-16 01:01:29 +00:00
Chris Lattner
9095186deb
Fix a bug in the 'shuffle(undef,x,mask) -> shuffle(x, undef,mask')' xform
...
Make the insert/extract elt -> shuffle code more aggressive.
This fixes CodeGen/PowerPC/vec_shuffle.ll
llvm-svn: 27728
2006-04-16 00:51:47 +00:00
Chris Lattner
34cebe785d
Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask').
...
llvm-svn: 27727
2006-04-16 00:03:56 +00:00
Chris Lattner
24acbe46c0
Fix a crash when faced with a shuffle vector that has an undef in its mask.
...
llvm-svn: 27726
2006-04-15 23:48:05 +00:00
Chris Lattner
873202fabd
Add patterns for matching vnots with bit converted inputs. Most of these will
...
go away when I start using evan's binop type canonicalizer
llvm-svn: 27725
2006-04-15 23:45:24 +00:00
Chris Lattner
41df12ff4c
Add a new vnot_conv predicate for matching vnot's where the allones vector is
...
bitconverted from some other type.
llvm-svn: 27724
2006-04-15 23:39:14 +00:00
Chris Lattner
7e7ad593cc
Make these predicates return true for bit_convert(buildvector)'s as well as
...
buildvectors.
llvm-svn: 27723
2006-04-15 23:38:00 +00:00
Evan Cheng
8f1d801389
More encoding bugs
...
llvm-svn: 27722
2006-04-15 06:10:09 +00:00
Evan Cheng
91944e8699
pslldrm, psrawrm, etc. encoding bug
...
llvm-svn: 27721
2006-04-15 05:59:08 +00:00
Evan Cheng
1220b31a31
hsubp{s|d} encoding bug
...
llvm-svn: 27720
2006-04-15 05:52:42 +00:00
Evan Cheng
6222cf2a36
Silly bug
...
llvm-svn: 27719
2006-04-15 05:37:34 +00:00
Evan Cheng
65bb720a8b
Do not use movs{h|l}dup for a shuffle with a single non-undef node.
...
llvm-svn: 27718
2006-04-15 03:13:24 +00:00
Chris Lattner
39fac448d6
significant cleanups to code that uses insert/extractelt heavily. This builds
...
maximal shuffles out of them where possible.
llvm-svn: 27717
2006-04-15 01:39:45 +00:00
Evan Cheng
0ba896c75b
Added SSE (and other) entries to foldMemoryOperand().
...
llvm-svn: 27716
2006-04-14 23:33:27 +00:00
Evan Cheng
00a5b3d9d3
Some clean up
...
llvm-svn: 27715
2006-04-14 23:32:40 +00:00
Chris Lattner
559c8ba466
Allow undef in a shuffle mask
...
llvm-svn: 27714
2006-04-14 23:19:08 +00:00
Chris Lattner
0875d94567
Move these ctors out of line
...
llvm-svn: 27713
2006-04-14 22:20:32 +00:00
Chris Lattner
5876571afc
These instructions always return a packed vector. Improve the class definitions to expose this fact.
...
llvm-svn: 27712
2006-04-14 22:20:07 +00:00
Evan Cheng
5d247f81c1
Last few SSE3 intrinsics.
...
llvm-svn: 27711
2006-04-14 21:59:03 +00:00
Chris Lattner
3323ce165d
Teach scalarrepl to promote unions of vectors and floats, producing
...
insert/extractelement operations. This implements
Transforms/ScalarRepl/vector_promote.ll
llvm-svn: 27710
2006-04-14 21:42:41 +00:00
Chris Lattner
1c0ef4385d
New testcase, checking to see we can turn this code:
...
void test(vector float *F, float f) {
vector float G = *F + *F;
*((float*)&G) = f;
*F = G + G;
}
void test2(vector float *F, float f) {
vector float G = *F + *F;
((float*)&G)[2] = f;
*F = G + G;
}
void test3(vector float *F, float *f) {
vector float G = *F + *F;
*f = ((float*)&G)[2];
}
void test4(vector float *F, float *f) {
vector float G = *F + *F;
*f = *((float*)&G);
}
into insert/extract element operations with no memory traffic.
llvm-svn: 27709
2006-04-14 21:41:54 +00:00
Tanya Lattner
b138bbe85b
Adding back vector instructions to keep in mainline.
...
llvm-svn: 27704
2006-04-14 19:24:33 +00:00
Tanya Lattner
8333c7d736
Removing unimplemented vector instructions from language referrence.
...
llvm-svn: 27703
2006-04-14 19:07:42 +00:00
Reid Spencer
83ee73fdb8
Correct the Superclasses list for GlobalVariable and Function to indicate
...
that they are "Constant" as they derive from GlobalValue. Also, fix some of
the wording where it mentions this.
Patch inspired by Nai Xia.
llvm-svn: 27701
2006-04-14 14:11:48 +00:00
Reid Spencer
9a20587c27
Allow an option, -with-externals, to be specified that provides the location
...
of the external tests. This turns into --with-externals option to configure.
llvm-svn: 27700
2006-04-14 13:53:56 +00:00
Evan Cheng
3bd605397b
Misc. SSE2 intrinsics: clflush, lfench, mfence
...
llvm-svn: 27699
2006-04-14 07:43:12 +00:00
Evan Cheng
e349d01acf
We were not adjusting the frame size to ensure proper alignment when alloca /
...
vla are present in the function. This causes a crash when a leaf function
allocates space on the stack used to store / load with 128-bit SSE
instructions.
llvm-svn: 27698
2006-04-14 07:26:43 +00:00
Evan Cheng
8d76f3922b
New entry
...
llvm-svn: 27697
2006-04-14 07:24:04 +00:00
Reid Spencer
ef56d92d6c
Don't print out the install command for Intrinsics.gen unless VERBOSE mode.
...
llvm-svn: 27696
2006-04-14 06:32:31 +00:00