diff options
author | Owen Anderson <resistor@mac.com> | 2011-08-30 22:15:17 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-08-30 22:15:17 +0000 |
commit | 21df36c57afc588c8073a070a47e3ba45fa87270 (patch) | |
tree | 71425f4d2087416a671f05ca6887df5ccc1657af /lib | |
parent | d4522460d495fb0be3303f0727f9bd00867c0b16 (diff) | |
download | external_llvm-21df36c57afc588c8073a070a47e3ba45fa87270.tar.gz external_llvm-21df36c57afc588c8073a070a47e3ba45fa87270.tar.bz2 external_llvm-21df36c57afc588c8073a070a47e3ba45fa87270.zip |
Fix encoding of CBZ/CBNZ Thumb2 instructions with immediate offsets rather than labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp index ab2162cbeb..7cac54c610 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp @@ -501,7 +501,10 @@ getThumbBCCTargetOpValue(const MCInst &MI, unsigned OpIdx, uint32_t ARMMCCodeEmitter:: getThumbCBTargetOpValue(const MCInst &MI, unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups) const { - return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_cb, Fixups); + const MCOperand MO = MI.getOperand(OpIdx); + if (MO.isExpr()) + return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_cb, Fixups); + return (MO.getImm() >> 1); } /// Return true if this branch has a non-always predication |