diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-02 02:10:31 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-06-02 02:10:31 +0000 |
commit | 24a26e58ef065a411e49adc7cd85d945381bcb17 (patch) | |
tree | 53e50b002d117cb82ea285ce87c30d87971c994f /lib/ExecutionEngine/JIT/SparcEmitter.cpp | |
parent | d5af63f325b01f31a06d1b1b31df9bbc5fe64926 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/SparcEmitter.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/SparcEmitter.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/JIT/SparcEmitter.cpp b/lib/ExecutionEngine/JIT/SparcEmitter.cpp index a9547ac38a..6c9cdc9a83 100644 --- a/lib/ExecutionEngine/JIT/SparcEmitter.cpp +++ b/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; |