[PATCH] Fix implementation for Thumb ADR instruction
Tim Northover
t.p.northover at gmail.com
Mon Jul 1 05:38:07 PDT 2013
Hi Mihail,
> I think that my template method will actually work for all offsets. Let's
> take a case study: ldr r0, [r1, #-4]
I mean the one in the AsmParser, not in the decoder, the decoder one
is versatile but unnecessary if we stick to pre-encoded MCOperands
(where sane).
The problem is more "ldr r0, [r1, #-4096]" for the LDRi12 instruction.
This should not be allowed, but it looks like your "Min" would get set
to -4096 because a 13-bit 2s complement integer can accept that
immediate.
> Regarding the shifting of the immediate for ADR's PC-relative operand, I can
> of course have it shifted in the MCOperand if you insist.
I think that would be better.
Cheers.
Tim.
More information about the llvm-commits
mailing list