mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
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
This commit is contained in:
parent
fcd75e5efb
commit
721cb1fde0
@ -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.
|
||||
|
@ -114,6 +114,8 @@ _func:
|
||||
beq _bar
|
||||
b #1838
|
||||
b #-420
|
||||
beq #336
|
||||
beq #160
|
||||
|
||||
@ CHECK: b _baz @ encoding: [A,0xe0'A']
|
||||
@ fixup A - offset: 0, value: _baz, kind: fixup_arm_thumb_br
|
||||
@ -121,6 +123,8 @@ _func:
|
||||
@ fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_bcc
|
||||
@ CHECK: b #1838 @ encoding: [0x97,0xe3]
|
||||
@ CHECK: b #-420 @ encoding: [0x2e,0xe7]
|
||||
@ CHECK: beq #336 @ encoding: [0xa8,0xd0]
|
||||
@ CHECK: beq #160 @ encoding: [0x50,0xd0]
|
||||
|
||||
@------------------------------------------------------------------------------
|
||||
@ BL/BLX
|
||||
|
Loading…
x
Reference in New Issue
Block a user