mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-20 20:38:48 +00:00
Add support for one argument OneArgFP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11094 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4e7854407c
commit
b97046ae4f
@ -383,10 +383,11 @@ void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) {
|
|||||||
///
|
///
|
||||||
void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
||||||
MachineInstr *MI = *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?
|
// 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;
|
bool KillsSrc = false;
|
||||||
for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
|
for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
|
||||||
E = LV->killed_end(MI); KI != E; ++KI)
|
E = LV->killed_end(MI); KI != E; ++KI)
|
||||||
@ -403,7 +404,7 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
|||||||
} else {
|
} else {
|
||||||
moveToTop(Reg, I); // Move to the top of the stack...
|
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) {
|
if (MI->getOpcode() == X86::FSTPr80 || MI->getOpcode() == X86::FISTPr64) {
|
||||||
assert(StackTop > 0 && "Stack empty??");
|
assert(StackTop > 0 && "Stack empty??");
|
||||||
|
@ -383,10 +383,11 @@ void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) {
|
|||||||
///
|
///
|
||||||
void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
||||||
MachineInstr *MI = *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?
|
// 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;
|
bool KillsSrc = false;
|
||||||
for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
|
for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
|
||||||
E = LV->killed_end(MI); KI != E; ++KI)
|
E = LV->killed_end(MI); KI != E; ++KI)
|
||||||
@ -403,7 +404,7 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
|||||||
} else {
|
} else {
|
||||||
moveToTop(Reg, I); // Move to the top of the stack...
|
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) {
|
if (MI->getOpcode() == X86::FSTPr80 || MI->getOpcode() == X86::FISTPr64) {
|
||||||
assert(StackTop > 0 && "Stack empty??");
|
assert(StackTop > 0 && "Stack empty??");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user