[PATCH] Fix implementation for Thumb ADR instruction

Mihail Popa mihail.popa at gmail.com
Tue Jul 2 04:03:15 PDT 2013


Hi Tim.

Please see attached the revised patch. I have made the template function
and the
new operand classes clearly refer to PC-relative addresses and changed the
shifting
policy.

Regards,
Mihai


On Mon, Jul 1, 2013 at 1:38 PM, Tim Northover <t.p.northover at gmail.com>wrote:

> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130702/26e8d039/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-788.tadr.patch
Type: application/octet-stream
Size: 8416 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130702/26e8d039/attachment.obj>


More information about the llvm-commits mailing list