aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-05-30 21:30:59 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-05-30 21:30:59 +0000
commit51da42c28fba85d8bfe0faf235a42c9a142ff46f (patch)
tree81a12615ff59220e43657e048317cf3fb37a57e8
parent9e18ef52625dbcd33e0f415cea8cead2966a9f9b (diff)
downloadexternal_llvm-51da42c28fba85d8bfe0faf235a42c9a142ff46f.zip
external_llvm-51da42c28fba85d8bfe0faf235a42c9a142ff46f.tar.gz
external_llvm-51da42c28fba85d8bfe0faf235a42c9a142ff46f.tar.bz2
Oops. PSHUFD is only available with SSE2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28573 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp
index 3c84ef5..e414e19 100644
--- a/lib/Target/X86/X86InstrInfo.cpp
+++ b/lib/Target/X86/X86InstrInfo.cpp
@@ -121,11 +121,14 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr *MI) const {
default: break;
case X86::SHUFPSrri: {
assert(MI->getNumOperands() == 4 && "Unknown shufps instruction!");
- unsigned A = MI->getOperand(0).getReg();
- unsigned B = MI->getOperand(1).getReg();
- unsigned C = MI->getOperand(2).getReg();
- unsigned M = MI->getOperand(3).getImmedValue();
- return BuildMI(X86::PSHUFDri, 2, A).addReg(B).addImm(M);
+ const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
+ if (Subtarget->hasSSE2()) {
+ unsigned A = MI->getOperand(0).getReg();
+ unsigned B = MI->getOperand(1).getReg();
+ unsigned C = MI->getOperand(2).getReg();
+ unsigned M = MI->getOperand(3).getImmedValue();
+ return BuildMI(X86::PSHUFDri, 2, A).addReg(B).addImm(M);
+ }
}
}