summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/llvm/storage.cpp
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2007-10-29 13:42:58 -0400
committerZack Rusin <zack@tungstengraphics.com>2007-10-30 05:15:06 -0400
commita94251d081b202e81bcd51db0dd35f1aec82b0c5 (patch)
tree083b286140b6a6dc0a8f7bec79e663ee69541534 /src/mesa/pipe/llvm/storage.cpp
parent75a9018fb90c93033ee5cbade9dd2febdc195d11 (diff)
Cleanup constant vector handling a bit.
Diffstat (limited to 'src/mesa/pipe/llvm/storage.cpp')
-rw-r--r--src/mesa/pipe/llvm/storage.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/mesa/pipe/llvm/storage.cpp b/src/mesa/pipe/llvm/storage.cpp
index 6ed243d9f3..1715bd4de4 100644
--- a/src/mesa/pipe/llvm/storage.cpp
+++ b/src/mesa/pipe/llvm/storage.cpp
@@ -68,24 +68,12 @@ Storage::Storage(llvm::BasicBlock *block, llvm::Value *out,
llvm::Constant *Storage::shuffleMask(int vec)
{
if (!m_extSwizzleVec) {
- Constant *const_vec = Constant::getNullValue(m_floatVecType);
- InsertElementInst *res = new InsertElementInst(const_vec,
- ConstantFP::get(Type::FloatTy, APFloat(0.f)),
- unsigned(0),
- name("extswx"), m_block);
- res = new InsertElementInst(res, ConstantFP::get(Type::FloatTy, APFloat(1.f)),
- unsigned(1),
- name("extswy"),
- m_block);
- res = new InsertElementInst(res, ConstantFP::get(Type::FloatTy, APFloat(0.f)),
- unsigned(2),
- name("extswz"),
- m_block);
- res = new InsertElementInst(res, ConstantFP::get(Type::FloatTy, APFloat(1.f)),
- unsigned(3),
- name("extsww"),
- m_block);
- m_extSwizzleVec = res;
+ std::vector<Constant*> elems;
+ elems.push_back(ConstantFP::get(Type::FloatTy, APFloat(0.f)));
+ elems.push_back(ConstantFP::get(Type::FloatTy, APFloat(1.f)));
+ elems.push_back(ConstantFP::get(Type::FloatTy, APFloat(0.f)));
+ elems.push_back(ConstantFP::get(Type::FloatTy, APFloat(1.f)));
+ m_extSwizzleVec = ConstantVector::get(m_floatVecType, elems);
}
if (m_intVecs.find(vec) != m_intVecs.end()) {