diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-05-09 06:41:27 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-05-09 06:41:27 +0000 |
commit | 8a99764f9b778a54e7440b1ee06a1e48f25d76d8 (patch) | |
tree | 7bf5796b3eab91a05ef45f397f9054bedd7c7646 /lib/CodeGen/CodeGenFunction.h | |
parent | f291b10fa99ed1c82256b7600911c09e82021205 (diff) |
Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.
Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.
Remove some unnecessary methods/types in the ExtVectorElementExpr class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index a6caa379cc..f067a0e225 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -161,8 +161,12 @@ class LValue { llvm::Value *V; union { - llvm::Value *VectorIdx; // Index into a vector subscript: V[i] - unsigned VectorElts; // Encoded ExtVector element subset: V.xyx + // Index into a vector subscript: V[i] + llvm::Value *VectorIdx; + + // ExtVector element subset: V.xyx + llvm::Constant *VectorElts; + struct { unsigned short StartBit; unsigned short Size; @@ -182,7 +186,7 @@ public: llvm::Value *getVectorIdx() const { assert(isVectorElt()); return VectorIdx; } // extended vector elements. llvm::Value *getExtVectorAddr() const { assert(isExtVectorElt()); return V; } - unsigned getExtVectorElts() const { + llvm::Constant *getExtVectorElts() const { assert(isExtVectorElt()); return VectorElts; } @@ -216,11 +220,11 @@ public: return R; } - static LValue MakeExtVectorElt(llvm::Value *Vec, unsigned Elements) { + static LValue MakeExtVectorElt(llvm::Value *Vec, llvm::Constant *Elts) { LValue R; R.LVType = ExtVectorElt; R.V = Vec; - R.VectorElts = Elements; + R.VectorElts = Elts; return R; } |