aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86FloatingPoint.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp
index cd32ef5e02..832e09a53c 100644
--- a/lib/Target/X86/X86FloatingPoint.cpp
+++ b/lib/Target/X86/X86FloatingPoint.cpp
@@ -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()));