From f322eabbce14ca5c96a022d5ab2a2d8837cbccd9 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Fri, 9 May 2008 06:41:27 +0000 Subject: 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. llvm-svn: 50892 --- clang/lib/CodeGen/CodeGenFunction.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.h') diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index a6caa379cc9..f067a0e2250 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/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; } -- cgit v1.2.3