aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-03 00:16:29 +0000
committerChris Lattner <sabre@nondot.org>2007-08-03 00:16:29 +0000
commit46ea8eb7cc6244b479e6feca55cf234a91d383d7 (patch)
tree0f8bb74bb9676d72031fa4561fb96acca30ed604 /CodeGen/CodeGenFunction.h
parent349aaec106b459206479f7600990230b9d799c61 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenFunction.h')
-rw-r--r--CodeGen/CodeGenFunction.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h
index 37614e95f0..919e68c91d 100644
--- a/CodeGen/CodeGenFunction.h
+++ b/CodeGen/CodeGenFunction.h
@@ -141,6 +141,7 @@ public:
llvm::Value *getVectorAddr() const { assert(isVectorElt()); return V; }
llvm::Value *getVectorIdx() const { assert(isVectorElt()); return VectorIdx; }
// ocu vector components.
+ llvm::Value *getOCUVectorAddr() const { assert(isOCUVectorComp()); return V; }
unsigned getOCUVectorComp() const {
assert(isOCUVectorComp());
return VectorComp;
@@ -164,7 +165,7 @@ public:
static LValue MakeOCUVectorComp(llvm::Value *Vec, unsigned Components) {
LValue R;
- R.LVType = VectorElt;
+ R.LVType = OCUVectorComp;
R.V = Vec;
R.VectorComp = Components;
return R;