Commit Graph

35211 Commits

Author SHA1 Message Date
Chris Lattner
b20b94de3a testcase for vector element access stuff.
llvm-svn: 40783
2007-08-03 16:42:43 +00:00
Chris Lattner
3a44aa7461 implement codegen for multidest ocuvector expressions, like:
vec2.yx = vec2; // reverse
 

llvm-svn: 40782
2007-08-03 16:37:04 +00:00
Chris Lattner
41d480e4d8 add codegen support for storing into a single-element ocu lvalue, such as:
vec2.x = f;

llvm-svn: 40781
2007-08-03 16:28:33 +00:00
Chris Lattner
40ff701674 refactor handling of ocuvector lvalue->rvalue codegen into its own method.
llvm-svn: 40780
2007-08-03 16:18:34 +00:00
Chris Lattner
fb837dccac In the common case where we are shuffling a vector, emit an
llvm vector shuffle instead of a bunch of insert/extract operations.
For:   vec4 = vec4.yyyy;  // splat

Emit:
        %tmp1 = shufflevector <4 x float> %tmp, <4 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > 

instead of:

        %tmp1 = extractelement <4 x float> %tmp, i32 1          
        %tmp2 = insertelement <4 x float> undef, float %tmp1, i32 0             
        %tmp3 = extractelement <4 x float> %tmp, i32 1          
        %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 1             
        %tmp5 = extractelement <4 x float> %tmp, i32 1          
        %tmp6 = insertelement <4 x float> %tmp4, float %tmp5, i32 2             
        %tmp7 = extractelement <4 x float> %tmp, i32 1          
        %tmp8 = insertelement <4 x float> %tmp6, float %tmp7, i32 3             

llvm-svn: 40779
2007-08-03 16:09:33 +00:00
Chris Lattner
177bd450e0 add OCUVectorComponent::getNumComponents()
llvm-svn: 40778
2007-08-03 16:00:20 +00:00
Chris Lattner
a1036f9155 Add support for scalar-returning element accesses like V.x
llvm-svn: 40777
2007-08-03 15:52:31 +00:00
Owen Anderson
774761c503 Fix a subtle iterator invalidation bug in a recursive algorithm.
llvm-svn: 40776
2007-08-03 11:03:26 +00:00
Reid Spencer
d8a382f66d Prepare for "core" website.
llvm-svn: 40775
2007-08-03 05:43:35 +00:00
Dale Johannesen
ff4c3be741 Long double, part 1 of N. Support in IR.
llvm-svn: 40774
2007-08-03 01:03:46 +00:00
Chris Lattner
99fbf13dc3 add an observation
llvm-svn: 40772
2007-08-03 00:17:42 +00:00
Chris Lattner
73ab9b3c14 implement lvalue to rvalue conversion for ocuvector components. We can now compile stuff
like this:

typedef __attribute__(( ocu_vector_type(4) )) float float4;
float4 test1(float4 V) {
  return V.wzyx+V;
}

to:
_test1:
        pshufd  $27, %xmm0, %xmm1
        addps   %xmm0, %xmm1
        movaps  %xmm1, %xmm0
        ret

and:

_test1:
        mfspr r2, 256
        oris r3, r2, 4096
        mtspr 256, r3
        li r3, lo16(LCPI1_0)
        lis r4, ha16(LCPI1_0)
        lvx v3, r4, r3
        vperm v3, v2, v2, v3
        vaddfp v2, v3, v2
        mtspr 256, r2
        blr 

llvm-svn: 40771
2007-08-03 00:16:29 +00:00
Chris Lattner
9e751cae27 add support for codegen of an OCUVectorComponent as an lvalue.
We can now codegen:

  vec4.xy;

as nothing!

llvm-svn: 40769
2007-08-02 23:37:31 +00:00
Chris Lattner
885b4959b6 Add support for encoding a OCUVectorComponent into a single integer.
llvm-svn: 40768
2007-08-02 23:36:59 +00:00
Chris Lattner
30709dc432 oops, this is the real fix.
llvm-svn: 40766
2007-08-02 22:41:43 +00:00
Chris Lattner
7aa350019a update test
llvm-svn: 40765
2007-08-02 22:36:03 +00:00
Chris Lattner
7e152dbb1f rename some helpers, have them return the idx of the field being accessed.
llvm-svn: 40764
2007-08-02 22:33:49 +00:00
Chris Lattner
f1cb1c8d70 Use static methods, which don't require an instance of OCUVectorType
llvm-svn: 40763
2007-08-02 22:20:00 +00:00
Chris Lattner
585afabddd mark some methods static, don't consider a vector to be an ocuvector
llvm-svn: 40762
2007-08-02 22:19:39 +00:00
Chris Lattner
acbd22aaec silence some warnings.
llvm-svn: 40761
2007-08-02 21:50:34 +00:00
Chris Lattner
680918a6fc Minor comment improvements.
llvm-svn: 40760
2007-08-02 21:47:28 +00:00
Chris Lattner
181b01bcfd make sure we don't lose the ability to parse carbon.h
llvm-svn: 40759
2007-08-02 21:40:29 +00:00
Chris Lattner
1f70816c73 Fix an accidental commit.
llvm-svn: 40758
2007-08-02 21:33:36 +00:00
Dan Gohman
5f6a9da530 More explicit keywords.
llvm-svn: 40757
2007-08-02 21:21:54 +00:00
Dan Gohman
8932bff7fe Fix the alignment requirements of several unpck and shuf instructions.
Generalize isPSHUFDMask and add a unary SHUFPD pattern so that SHUFPD's
memory operand alignment can be tested as well, with a fix to avoid
breaking MMX's use of isPSHUFDMask.

llvm-svn: 40756
2007-08-02 21:17:01 +00:00
Dan Gohman
4d436e2b7d Fix pastos in vector arithmetic intrinsics.
llvm-svn: 40754
2007-08-02 21:06:40 +00:00
Owen Anderson
a8ba659976 Fix 80 col. violations.
llvm-svn: 40751
2007-08-02 18:20:52 +00:00
Owen Anderson
9699a6ea03 Fix 80 col. violations.
llvm-svn: 40750
2007-08-02 18:16:06 +00:00
Owen Anderson
e3590584b9 Fix 80 col. violations.
llvm-svn: 40749
2007-08-02 18:11:11 +00:00
Chris Lattner
3ffe7187db don't redefine a parameter
llvm-svn: 40748
2007-08-02 18:08:16 +00:00
Owen Anderson
0ac1fc8ac1 Fix a bug that was causing several miscompilations on SPEC.
llvm-svn: 40746
2007-08-02 17:56:05 +00:00
Christopher Lamb
531f260ac0 Implement review feedback.
llvm-svn: 40745
2007-08-02 17:52:00 +00:00
Chris Lattner
9ea0287e25 I don't have time to restore this functionality right now.
llvm-svn: 40743
2007-08-02 17:43:39 +00:00
Chris Lattner
dc2cf228ce Replacing a cast with another one does not reduce the number of
casts in the input.

llvm-svn: 40741
2007-08-02 17:23:38 +00:00
Chris Lattner
498137dbfc Reduced testcase for PR1594
llvm-svn: 40740
2007-08-02 17:11:24 +00:00
Chris Lattner
222b214be7 Disable an xform that causes an infinite loop. This fixes PR1594
llvm-svn: 40739
2007-08-02 16:56:32 +00:00
Chris Lattner
2740694450 wrap some long lines. Major offenders that are left include
gvn, gvnpre, dse, and predsimplify.  To see these, use:

  make check-line-length

llvm-svn: 40738
2007-08-02 16:53:43 +00:00
Devang Patel
a882328e61 Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589, again

llvm-svn: 40737
2007-08-02 15:25:57 +00:00
Dan Gohman
fa3eeeedc0 Mark the SSE and MMX load instructions that
X86InstrInfo::isReallyTriviallyReMaterializable knows how to handle
with the isReMaterializable flag so that it is given a chance to handle
them. Without hoisting constant-pool loads from loops this isn't very
visible, though it does keep CodeGen/X86/constant-pool-remat-0.ll from
making a copy of the constant pool on the stack.

llvm-svn: 40736
2007-08-02 14:27:55 +00:00
Reid Spencer
3d5386d545 Hyphenate a word, to check auto-update feature. Third times the charm!
llvm-svn: 40734
2007-08-02 09:58:41 +00:00
Reid Spencer
1d32b07d28 Expand a contraction to test auto-update on commit.
llvm-svn: 40733
2007-08-02 09:54:52 +00:00
Reid Spencer
28f1c63015 Test auto-update with minor grammaro fix.
llvm-svn: 40732
2007-08-02 09:50:49 +00:00
Chris Lattner
b0418fc607 Enhance instcombine to be more aggressive about folding casts of
operations of casts.  This implements InstCombine/zext-fold.ll

llvm-svn: 40726
2007-08-02 06:11:14 +00:00
Anders Carlsson
af8908451e Fix bug spotted by Chris.
llvm-svn: 40725
2007-08-02 06:05:19 +00:00
Anders Carlsson
cac9c624a1 Add extend and extOrTrunc methods that do sign or zero extension depending on whether the integer is signed or not
llvm-svn: 40724
2007-08-02 06:00:13 +00:00
Evan Cheng
473c5111c3 Switch some multiplication instructions over to the new scheme for testing.
llvm-svn: 40723
2007-08-02 05:48:35 +00:00
Evan Cheng
358c3d1dac Do not emit copies for physical register output if it's not used.
llvm-svn: 40722
2007-08-02 05:29:38 +00:00
Evan Cheng
824693c87a Fix test.
llvm-svn: 40721
2007-08-02 05:04:16 +00:00
Chris Lattner
d7cb625a9e Fix PR1575 and test/Transforms/CondProp/2007-08-01-InvalidRead.ll
llvm-svn: 40720
2007-08-02 04:47:05 +00:00
Chris Lattner
6a340b4351 Fix a bug in my previous commit
llvm-svn: 40719
2007-08-02 04:22:39 +00:00