summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-06-02 02:10:31 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-06-02 02:10:31 +0000
commit78e8ade959c9c5ac343b27203c20ae3235c96373 (patch)
tree47dc5f15261a66c56d2170df87dd6e1051f80c74 /llvm/lib
parentcd0a9fa5b494c816a35fc4812630cbf503402efc (diff)
downloadbcm5719-llvm-78e8ade959c9c5ac343b27203c20ae3235c96373.tar.gz
bcm5719-llvm-78e8ade959c9c5ac343b27203c20ae3235c96373.zip
The flag modifications weren't picking up the old values of the
flags before. Save them in a temporary variable, then restore them from the temporary after creating the new constant. llvm-svn: 6520
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/SparcEmitter.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/SparcEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/SparcEmitter.cpp
index a9547ac38ab..6c9cdc9a83f 100644
--- a/llvm/lib/ExecutionEngine/JIT/SparcEmitter.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/SparcEmitter.cpp
@@ -106,13 +106,18 @@ void SparcEmitter::finishFunction(MachineFunction &F) {
// Location is the target of the branch
// Ref is the location of the instruction, and hence the PC
unsigned branchTarget = (Location - (long)Ref) >> 2;
+ // Save the flags.
+ bool loBits32=false, hiBits32=false, loBits64=false, hiBits64=false;
+ if (op.opLoBits32()) { loBits32=true; }
+ if (op.opHiBits32()) { hiBits32=true; }
+ if (op.opLoBits64()) { loBits64=true; }
+ if (op.opHiBits64()) { hiBits64=true; }
MI->SetMachineOperandConst(ii, MachineOperand::MO_SignExtendedImmed,
branchTarget);
- // Copy the flags.
- if (op.opLoBits32()) { MI->setOperandLo32(ii); }
- else if (op.opHiBits32()) { MI->setOperandHi32(ii); }
- else if (op.opLoBits64()) { MI->setOperandLo64(ii); }
- else if (op.opHiBits64()) { MI->setOperandHi64(ii); }
+ if (loBits32) { MI->setOperandLo32(ii); }
+ else if (hiBits32) { MI->setOperandHi32(ii); }
+ else if (loBits64) { MI->setOperandLo64(ii); }
+ else if (hiBits64) { MI->setOperandHi64(ii); }
std::cerr << "Rewrote BB ref: ";
unsigned fixedInstr = SparcV9CodeEmitter::getBinaryCodeForInstr(*MI);
*Ref = fixedInstr;
OpenPOWER on IntegriCloud