[llvm-commits] [llvm] r63830 - /llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp
Bill Wendling
isanbard at gmail.com
Wed Feb 4 20:41:57 PST 2009
Author: void
Date: Wed Feb 4 22:41:57 2009
New Revision: 63830
URL: http://llvm.org/viewvc/llvm-project?rev=63830&view=rev
Log:
Pull r63702 into Dib:
Fixes a case where we generate an incorrect mask for pshfhw in the presence of
undefs and incorrectly determining if we have punpckldq.
Modified:
llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp?rev=63830&r1=63829&r2=63830&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/X86ISelLowering.cpp Wed Feb 4 22:41:57 2009
@@ -2308,7 +2308,7 @@
if (!isUndefOrEqual(BitI, j))
return false;
if (V2IsSplat) {
- if (isUndefOrEqual(BitI1, NumElts))
+ if (!isUndefOrEqual(BitI1, NumElts))
return false;
} else {
if (!isUndefOrEqual(BitI1, j + NumElts))
@@ -2643,9 +2643,10 @@
for (unsigned i = 7; i >= 4; --i) {
unsigned Val = 0;
SDValue Arg = N->getOperand(i);
- if (Arg.getOpcode() != ISD::UNDEF)
+ if (Arg.getOpcode() != ISD::UNDEF) {
Val = cast<ConstantSDNode>(Arg)->getZExtValue();
- Mask |= (Val - 4);
+ Mask |= (Val - 4);
+ }
if (i != 4)
Mask <<= 2;
}
@@ -4160,10 +4161,10 @@
// new vector_shuffle with the corrected mask.
SDValue NewMask = NormalizeMask(PermMask, DAG);
if (NewMask.getNode() != PermMask.getNode()) {
- if (X86::isUNPCKLMask(PermMask.getNode(), true)) {
+ if (X86::isUNPCKLMask(NewMask.getNode(), true)) {
SDValue NewMask = getUnpacklMask(NumElems, DAG);
return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, NewMask);
- } else if (X86::isUNPCKHMask(PermMask.getNode(), true)) {
+ } else if (X86::isUNPCKHMask(NewMask.getNode(), true)) {
SDValue NewMask = getUnpackhMask(NumElems, DAG);
return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, V1, V2, NewMask);
}
More information about the llvm-commits
mailing list