diff options
author | Owen Anderson <resistor@mac.com> | 2011-08-31 20:26:14 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-08-31 20:26:14 +0000 |
commit | 721cb1fde07423fd1905338d443172a8028ad634 (patch) | |
tree | 42cab40fe8b8dbbbc001163898e697d24121dbf6 /lib/Target/ARM | |
parent | fcd75e5efb482f35cfc22fd4b64e047930130fd6 (diff) | |
download | external_llvm-721cb1fde07423fd1905338d443172a8028ad634.zip external_llvm-721cb1fde07423fd1905338d443172a8028ad634.tar.gz external_llvm-721cb1fde07423fd1905338d443172a8028ad634.tar.bz2 |
Fix encoding for tBcc with immediate offset operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp index f6b8af8..69ec197 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp @@ -522,7 +522,11 @@ getThumbBRTargetOpValue(const MCInst &MI, unsigned OpIdx, uint32_t ARMMCCodeEmitter:: getThumbBCCTargetOpValue(const MCInst &MI, unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups) const { - return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_bcc, Fixups); + const MCOperand MO = MI.getOperand(OpIdx); + if (MO.isExpr()) + return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_bcc, + Fixups); + return (MO.getImm() >> 1); } /// getThumbCBTargetOpValue - Return encoding info for Thumb branch target. |