summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-02-12 22:38:52 +0000
committerCraig Topper <craig.topper@intel.com>2018-02-12 22:38:52 +0000
commitebb0838f74f694a62957646463b6a650903adb97 (patch)
treefde4ccd7b1f18d9ac51a6bc2c717c7fd1c5bce4b /clang/lib
parent8d19c6fba2fa1d7d0ee3ae999e9f5c3a93f8c067 (diff)
downloadbcm5719-llvm-ebb0838f74f694a62957646463b6a650903adb97.tar.gz
bcm5719-llvm-ebb0838f74f694a62957646463b6a650903adb97.zip
[X86] Reverse the operand order of the implementation of the kunpack builtins.
The second operand needs to be in the lower bits of the concatenation. This matches llvm 5.0, gcc, and icc behavior. Fixes PR36360. llvm-svn: 324954
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 8a48b4eae77..49dfc60d0ca 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -8846,7 +8846,8 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
RHS = Builder.CreateShuffleVector(RHS, RHS,
makeArrayRef(Indices, NumElts / 2));
// Concat the vectors.
- Value *Res = Builder.CreateShuffleVector(LHS, RHS,
+ // NOTE: Operands are swapped to match the intrinsic definition.
+ Value *Res = Builder.CreateShuffleVector(RHS, LHS,
makeArrayRef(Indices, NumElts));
return Builder.CreateBitCast(Res, Ops[0]->getType());
}
OpenPOWER on IntegriCloud