]> granicus.if.org Git - clang/commitdiff
IRgen/NEON: Fix codegen of vzip and vzipq.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 26 Aug 2010 00:55:57 +0000 (00:55 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 26 Aug 2010 00:55:57 +0000 (00:55 +0000)
 - Will be adding an executable test case to test-suite repo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112126 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp

index 23c63e4452ab6b7cb47f0261d5816b58f1024948..7fc27c8075dc4539cda60bd91ee980d31ac75ecf 100644 (file)
@@ -1710,8 +1710,8 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
     for (unsigned vi = 0; vi != 2; ++vi) {
       SmallVector<Constant*, 16> Indices;
       for (unsigned i = 0, e = VTy->getNumElements(); i != e; i += 2) {
-        Indices.push_back(ConstantInt::get(Int32Ty, (i >> 1)));
-        Indices.push_back(ConstantInt::get(Int32Ty, (i >> 1)+e));
+        Indices.push_back(ConstantInt::get(Int32Ty, (i + vi*e) >> 1));
+        Indices.push_back(ConstantInt::get(Int32Ty, ((i + vi*e) >> 1)+e));
       }
       Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ops[0], vi);
       SV = llvm::ConstantVector::get(Indices.begin(), Indices.size());