From a4fc5b86998d47294c02b74925e5e40467a0134b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 30 May 2006 21:30:59 +0000 Subject: [PATCH] Oops. PSHUFD is only available with SSE2. llvm-svn: 28573 --- llvm/lib/Target/X86/X86InstrInfo.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 3c84ef5f9e88..e414e19656eb 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/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(); + 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); + } } }