aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-03-22 22:07:06 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-03-22 22:07:06 +0000
commitca6e8eafd2dfb13b89875405c54613b9cea1ca2e (patch)
tree6f6655062a8941a12ba6d597cd85d6c31d7a3090
parent7de48c143adcea967a12279cbac3f4486393fe8f (diff)
Added a ValueType operand to isShuffleMaskLegal(). For now, x86 will not do
64-bit vector shuffle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26964 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Target/TargetLowering.h4
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp5
-rw-r--r--lib/Target/X86/X86ISelLowering.h2
3 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 5083e86046..0615531a21 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -202,7 +202,7 @@ public:
/// support and the code generator is tasked with not creating illegal masks.
bool isShuffleLegal(MVT::ValueType VT, SDOperand Mask) const {
return isOperationLegal(ISD::VECTOR_SHUFFLE, VT) &&
- isShuffleMaskLegal(Mask);
+ isShuffleMaskLegal(Mask, VT);
}
/// getTypeToPromoteTo - If the action for this operation is to promote, this
@@ -489,7 +489,7 @@ protected:
/// support *some* VECTOR_SHUFFLE operations, those with specific masks.
/// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
/// are assumed to be legal.
- virtual bool isShuffleMaskLegal(SDOperand Mask) const {
+ virtual bool isShuffleMaskLegal(SDOperand Mask, MVT::ValueType VT) const {
return true;
}
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 73225b62d0..ea3832f70c 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -2371,7 +2371,10 @@ bool X86TargetLowering::isLegalAddressImmediate(GlobalValue *GV) const {
/// support *some* VECTOR_SHUFFLE operations, those with specific masks.
/// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
/// are assumed to be legal.
-bool X86TargetLowering::isShuffleMaskLegal(SDOperand Mask) const {
+bool
+X86TargetLowering::isShuffleMaskLegal(SDOperand Mask, MVT::ValueType VT) const {
+ // Only do shuffles on 128-bit vector types for now.
+ if (MVT::getSizeInBits(VT) == 64) return false;
return (X86::isSplatMask(Mask.Val) ||
(Subtarget->hasSSE2() && X86::isPSHUFDMask(Mask.Val)));
}
diff --git a/lib/Target/X86/X86ISelLowering.h b/lib/Target/X86/X86ISelLowering.h
index e9ff015b5a..4a3f7a65cb 100644
--- a/lib/Target/X86/X86ISelLowering.h
+++ b/lib/Target/X86/X86ISelLowering.h
@@ -267,7 +267,7 @@ namespace llvm {
/// support *some* VECTOR_SHUFFLE operations, those with specific masks.
/// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
/// are assumed to be legal.
- virtual bool isShuffleMaskLegal(SDOperand Mask) const;
+ virtual bool isShuffleMaskLegal(SDOperand Mask, MVT::ValueType VT) const;
private:
// C Calling Convention implementation.
std::vector<SDOperand> LowerCCCArguments(Function &F, SelectionDAG &DAG);