[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

Chris Lattner sabre at nondot.org
Wed May 16 20:30:00 PDT 2007



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.400 -> 1.401
---
Log message:

Fix PR1427: http://llvm.org/PR1427  and test/CodeGen/X86/mmx-shuffle.ll


---
Diffs of the changes:  (+10 -1)

 X86ISelLowering.cpp |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.400 llvm/lib/Target/X86/X86ISelLowering.cpp:1.401
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.400	Mon May 14 20:28:08 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Wed May 16 22:29:42 2007
@@ -1614,6 +1614,13 @@
 static bool isSHUFPMask(const SDOperand *Elems, unsigned NumElems) {
   if (NumElems != 2 && NumElems != 4) return false;
 
+  // Ensure this is not an mmx shuffle.
+  if (NumElems == 4 && Elems[0].getValueType() == MVT::i16)
+    return false;
+  if (NumElems == 2 && Elems[0].getValueType() == MVT::i32)
+    return false;
+  
+  
   unsigned Half = NumElems / 2;
   for (unsigned i = 0; i < Half; ++i)
     if (!isUndefOrInRange(Elems[i], 0, NumElems))
@@ -2712,7 +2719,9 @@
     }
   }
 
-  if (NumElems == 4) {
+  if (NumElems == 4 && 
+      // Don't do this for MMX.
+      MVT::getSizeInBits(VT) != 64) {
     MVT::ValueType MaskVT = PermMask.getValueType();
     MVT::ValueType MaskEVT = MVT::getVectorBaseType(MaskVT);
     SmallVector<std::pair<int, int>, 8> Locs;






More information about the llvm-commits mailing list