1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Somehow I lost a condition when I was shuffling some code around. Anyway,

only transform a shufps to pshufd when the first two operands are the same.

llvm-svn: 28575
This commit is contained in:
Evan Cheng 2006-05-30 22:13:36 +00:00
parent bdb6af8e7d
commit 88bd79b75b

View File

@ -125,11 +125,11 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr *MI) const {
case X86::SHUFPSrri: {
assert(MI->getNumOperands() == 4 && "Unknown shufps instruction!");
const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
if (!Subtarget->hasSSE2()) return 0;
unsigned A = MI->getOperand(0).getReg();
unsigned B = MI->getOperand(1).getReg();
unsigned C = MI->getOperand(2).getReg();
unsigned M = MI->getOperand(3).getImmedValue();
if (!Subtarget->hasSSE2() || B != C) return 0;
return BuildMI(X86::PSHUFDri, 2, A).addReg(B).addImm(M);
}
}