diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-10-28 21:39:47 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-10-28 21:39:47 +0000 |
| commit | b31f9c3ea6a294fdd206119b02ea02da4018489d (patch) | |
| tree | 67371cce855d7d39381638e1d3ee65328277a9d4 /llvm/lib/Target/Sparc | |
| parent | 71b265a848db1dff9d165e19eb97215ed31d73e9 (diff) | |
| download | bcm5719-llvm-b31f9c3ea6a294fdd206119b02ea02da4018489d.tar.gz bcm5719-llvm-b31f9c3ea6a294fdd206119b02ea02da4018489d.zip | |
Need to subtract, not add, stack size in SAVE instruction!
llvm-svn: 1005
Diffstat (limited to 'llvm/lib/Target/Sparc')
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcInstrSelection.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/Sparc/SparcInstrSelection.cpp b/llvm/lib/Target/Sparc/SparcInstrSelection.cpp index dc8ab1b761f..4bcb9f5f10e 100644 --- a/llvm/lib/Target/Sparc/SparcInstrSelection.cpp +++ b/llvm/lib/Target/Sparc/SparcInstrSelection.cpp @@ -1011,7 +1011,7 @@ GetInstructionsForProlog(BasicBlock* entryBB, mvec[0] = new MachineInstr(SAVE); mvec[0]->SetMachineOperand(0, target.getRegInfo().getStackPointer()); mvec[0]->SetMachineOperand(1, MachineOperand::MO_SignExtendedImmed, - staticStackSize); + - staticStackSize); mvec[0]->SetMachineOperand(2, target.getRegInfo().getStackPointer()); return 1; @@ -1519,8 +1519,11 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, case 42: // bool: SetCC(reg, reg): { // If result of the SetCC is only used for a single branch, we can - // discard the result. Otherwise, the boolean value must go into - // an integer register. + // discard the boolean result and keep only the condition code. + // Otherwise, the boolean value must go into an integer register. + // To put the boolean result in a register we use a conditional move, + // unless the result of the SUBCC instruction can be used as the bool! + // This assumes that zero is FALSE and any non-zero integer is TRUE. // bool keepBoolVal = (subtreeRoot->parent() == NULL || ((InstructionNode*) subtreeRoot->parent()) |

