[llvm-commits] CVS: llvm/lib/Target/X86/FloatingPoint.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 3 01:28:01 PST 2004


Changes in directory llvm/lib/Target/X86:

FloatingPoint.cpp updated: 1.18 -> 1.19

---
Log message:

Add support for one argument OneArgFP instructions


---
Diffs of the changes:  (+4 -3)

Index: llvm/lib/Target/X86/FloatingPoint.cpp
diff -u llvm/lib/Target/X86/FloatingPoint.cpp:1.18 llvm/lib/Target/X86/FloatingPoint.cpp:1.19
--- llvm/lib/Target/X86/FloatingPoint.cpp:1.18	Mon Feb  2 13:23:15 2004
+++ llvm/lib/Target/X86/FloatingPoint.cpp	Tue Feb  3 01:27:34 2004
@@ -383,10 +383,11 @@
 ///
 void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
   MachineInstr *MI = *I;
-  assert(MI->getNumOperands() == 5 && "Can only handle fst* instructions!");
+  assert((MI->getNumOperands() == 5 || MI->getNumOperands() == 1) &&
+         "Can only handle fst* & ftst instructions!");
 
   // Is this the last use of the source register?
-  unsigned Reg = getFPReg(MI->getOperand(4));
+  unsigned Reg = getFPReg(MI->getOperand(MI->getNumOperands()-1));
   bool KillsSrc = false;
   for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
 	 E = LV->killed_end(MI); KI != E; ++KI)
@@ -403,7 +404,7 @@
   } else {
     moveToTop(Reg, I);            // Move to the top of the stack...
   }
-  MI->RemoveOperand(4);           // Remove explicit ST(0) operand
+  MI->RemoveOperand(MI->getNumOperands()-1);    // Remove explicit ST(0) operand
   
   if (MI->getOpcode() == X86::FSTPr80 || MI->getOpcode() == X86::FISTPr64) {
     assert(StackTop > 0 && "Stack empty??");





More information about the llvm-commits mailing list