mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Correct encoding of BL with immediate offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4af54a461f
commit
d7568e1c35
@ -532,11 +532,16 @@ getBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
|
||||
uint32_t ARMMCCodeEmitter::
|
||||
getARMBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
|
||||
SmallVectorImpl<MCFixup> &Fixups) const {
|
||||
if (HasConditionalBranch(MI))
|
||||
return ::getBranchTargetOpValue(MI, OpIdx,
|
||||
ARM::fixup_arm_condbranch, Fixups);
|
||||
return ::getBranchTargetOpValue(MI, OpIdx,
|
||||
ARM::fixup_arm_uncondbranch, Fixups);
|
||||
const MCOperand MO = MI.getOperand(OpIdx);
|
||||
if (MO.isExpr()) {
|
||||
if (HasConditionalBranch(MI))
|
||||
return ::getBranchTargetOpValue(MI, OpIdx,
|
||||
ARM::fixup_arm_condbranch, Fixups);
|
||||
return ::getBranchTargetOpValue(MI, OpIdx,
|
||||
ARM::fixup_arm_uncondbranch, Fixups);
|
||||
}
|
||||
|
||||
return MO.getImm() >> 2;
|
||||
}
|
||||
|
||||
|
||||
|
@ -363,11 +363,13 @@ Lforward:
|
||||
|
||||
bl _bar
|
||||
blx _bar
|
||||
blls #28634268
|
||||
|
||||
@ CHECK: bl _bar @ encoding: [A,A,A,0xeb]
|
||||
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_arm_uncondbranch
|
||||
@ CHECK: blx _bar @ encoding: [A,A,A,0xfa]
|
||||
@ fixup A - offset: 0, value: _bar, kind: fixup_arm_uncondbranch
|
||||
@ CHECK: blls #28634268 @ encoding: [0x27,0x3b,0x6d,0x9b]
|
||||
|
||||
@------------------------------------------------------------------------------
|
||||
@ BLX (register)
|
||||
|
Loading…
Reference in New Issue
Block a user