mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-01 10:02:42 +00:00
Fix encoding of PC-relative Thumb1 LDR's when using immediate offsets instead of labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138835 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
391ac65377
commit
a7710edd98
@ -930,7 +930,10 @@ getAddrModeISOpValue(const MCInst &MI, unsigned OpIdx,
|
||||
uint32_t ARMMCCodeEmitter::
|
||||
getAddrModePCOpValue(const MCInst &MI, unsigned OpIdx,
|
||||
SmallVectorImpl<MCFixup> &Fixups) const {
|
||||
return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_cp, Fixups);
|
||||
const MCOperand MO = MI.getOperand(OpIdx);
|
||||
if (MO.isExpr())
|
||||
return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_cp, Fixups);
|
||||
return (MO.getImm() >> 2);
|
||||
}
|
||||
|
||||
/// getAddrMode5OpValue - Return encoding info for 'reg +/- imm10' operand.
|
||||
|
@ -224,10 +224,13 @@ _func:
|
||||
@ LDR (literal)
|
||||
@------------------------------------------------------------------------------
|
||||
ldr r1, _foo
|
||||
ldr r3, #604
|
||||
ldr r3, #368
|
||||
|
||||
@ CHECK: ldr r1, _foo @ encoding: [A,0x49]
|
||||
@ fixup A - offset: 0, value: _foo, kind: fixup_arm_thumb_cp
|
||||
|
||||
@ CHECK: ldr r3, #604 @ encoding: [0x97,0x4b]
|
||||
@ CHECK: ldr r3, #368 @ encoding: [0x5c,0x4b]
|
||||
|
||||
@------------------------------------------------------------------------------
|
||||
@ LDR (register)
|
||||
|
Loading…
x
Reference in New Issue
Block a user