aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-11 20:21:06 +0000
committerChris Lattner <sabre@nondot.org>2004-04-11 20:21:06 +0000
commit4cf15e7a3bed2ff3a7fa87f18cdf65b7eecccee2 (patch)
tree90c2cf25d482526d2ff6cbb56ce487ee5aea476c /lib
parent427aeb476f80adb1dbc7ab93210a8ae6e7bf7df8 (diff)
downloadexternal_llvm-4cf15e7a3bed2ff3a7fa87f18cdf65b7eecccee2.zip
external_llvm-4cf15e7a3bed2ff3a7fa87f18cdf65b7eecccee2.tar.gz
external_llvm-4cf15e7a3bed2ff3a7fa87f18cdf65b7eecccee2.tar.bz2
Relax assertion to make this function work with a broader class of instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/FloatingPoint.cpp10
-rw-r--r--lib/Target/X86/X86FloatingPoint.cpp10
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/Target/X86/FloatingPoint.cpp b/lib/Target/X86/FloatingPoint.cpp
index b1a2ceb..6afa7e7 100644
--- a/lib/Target/X86/FloatingPoint.cpp
+++ b/lib/Target/X86/FloatingPoint.cpp
@@ -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));
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp
index b1a2ceb..6afa7e7 100644
--- a/lib/Target/X86/X86FloatingPoint.cpp
+++ b/lib/Target/X86/X86FloatingPoint.cpp
@@ -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));