diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-05-30 20:26:50 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-05-30 20:26:50 +0000 |
commit | 66f849bd7b8967681acbce3b746e532eaf5baf9e (patch) | |
tree | 4d517ebcff0b7f6b54901aaea41bbd834d2dfffd /llvm/lib/Target/X86/X86InstrInfo.cpp | |
parent | b33e54ead70ff294acab743c0a7c2c89b8cd6526 (diff) | |
download | bcm5719-llvm-66f849bd7b8967681acbce3b746e532eaf5baf9e.tar.gz bcm5719-llvm-66f849bd7b8967681acbce3b746e532eaf5baf9e.zip |
Allow shufps x, x, mask to be converted to pshufd x, mask to save a move.
llvm-svn: 28565
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index e397163a893..3c84ef5f9e8 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -102,7 +102,6 @@ unsigned X86InstrInfo::isStoreToStackSlot(MachineInstr *MI, } - /// convertToThreeAddress - This method must be implemented by targets that /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target /// may be able to convert a two-address instruction into a true @@ -118,6 +117,18 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr *MI) const { unsigned Dest = MI->getOperand(0).getReg(); unsigned Src = MI->getOperand(1).getReg(); + switch (MI->getOpcode()) { + 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); + } + } + // FIXME: None of these instructions are promotable to LEAs without // additional information. In particular, LEA doesn't set the flags that // add and inc do. :( |