Relax assertion to make this function work with a broader class of instructions
authorChris Lattner <sabre@nondot.org>
Sun, 11 Apr 2004 20:21:06 +0000 (20:21 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 11 Apr 2004 20:21:06 +0000 (20:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12836 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/FloatingPoint.cpp
lib/Target/X86/X86FloatingPoint.cpp

index b1a2ceb79c56af24a19e71496e86954b49f3a6fc..6afa7e76cfb62bec7ba7b5ff72e21c332341c2c7 100644 (file)
@@ -449,11 +449,17 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
 }
 
 
-/// handleOneArgFPRW - fchs - ST(0) = -ST(0)
+/// handleOneArgFPRW: Handle instructions that read from the top of stack and
+/// replace the value with a newly computed value.  These instructions may have
+/// non-fp operands after their FP operands.
+///
+///  Examples:
+///     R1 = fchs R2
+///     R1 = fadd R2, [mem]
 ///
 void FPS::handleOneArgFPRW(MachineBasicBlock::iterator &I) {
   MachineInstr *MI = I;
-  assert(MI->getNumOperands() == 2 && "Can only handle fst* instructions!");
+  assert(MI->getNumOperands() >= 2 && "FPRW instructions must have 2 ops!!");
 
   // Is this the last use of the source register?
   unsigned Reg = getFPReg(MI->getOperand(1));
index b1a2ceb79c56af24a19e71496e86954b49f3a6fc..6afa7e76cfb62bec7ba7b5ff72e21c332341c2c7 100644 (file)
@@ -449,11 +449,17 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
 }
 
 
-/// handleOneArgFPRW - fchs - ST(0) = -ST(0)
+/// handleOneArgFPRW: Handle instructions that read from the top of stack and
+/// replace the value with a newly computed value.  These instructions may have
+/// non-fp operands after their FP operands.
+///
+///  Examples:
+///     R1 = fchs R2
+///     R1 = fadd R2, [mem]
 ///
 void FPS::handleOneArgFPRW(MachineBasicBlock::iterator &I) {
   MachineInstr *MI = I;
-  assert(MI->getNumOperands() == 2 && "Can only handle fst* instructions!");
+  assert(MI->getNumOperands() >= 2 && "FPRW instructions must have 2 ops!!");
 
   // Is this the last use of the source register?
   unsigned Reg = getFPReg(MI->getOperand(1));