Bugfix to work with the two-addr changes that have been made in the tree recently
authorChris Lattner <sabre@nondot.org>
Tue, 5 Sep 2006 20:27:32 +0000 (20:27 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Sep 2006 20:27:32 +0000 (20:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30121 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FloatingPoint.cpp

index cd32ef5e02fd4ca21c969b4602dee039fc854ee9..832e09a53c91842becda950a3524eb7c4513b81a 100644 (file)
@@ -752,7 +752,7 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
   MachineInstr *MI = I;
 
   unsigned Op0 = getFPReg(MI->getOperand(0));
-  unsigned Op1 = getFPReg(MI->getOperand(1));
+  unsigned Op1 = getFPReg(MI->getOperand(2));
 
   // The first operand *must* be on the top of the stack.
   moveToTop(Op0, I);
@@ -760,6 +760,7 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
   // Change the second operand to the stack register that the operand is in.
   // Change from the pseudo instruction to the concrete instruction.
   MI->RemoveOperand(0);
+  MI->RemoveOperand(1);
   MI->getOperand(0).setReg(getSTReg(Op1));
   MI->setOpcode(getConcreteOpcode(MI->getOpcode()));