[PATCH] Add range checking for Thumb2 PC-relative loads

Mihail Popa mihail.popa at gmail.com
Mon Jul 22 08:30:16 PDT 2013


Please see attached new version after suggested adjustments.

Mihai


On Mon, Jul 22, 2013 at 3:34 PM, Renato Golin <renato.golin at linaro.org>wrote:

> Hi Mihail,
>
> Still using newline after IF... ;)
>
> +  void addThumbMemPCOperands(MCInst &Inst, unsigned N) const {
> +    assert(N == 1 && "Invalid number of operands!");
> +    if(isImm())
> +    {
>
> cheers,
> --renato
>
>
> On 22 July 2013 15:05, Mihail Popa <mihail.popa at gmail.com> wrote:
>
>> Hi guys.
>>
>> I fixed the coding style and removed the RTTI usage. Also added two more
>> tests.
>> Flipping the emit bit doesn't seem to make any difference for some
>> reason, so
>> I propose to leave as is.
>>
>> New patch attached.
>>
>> Regards,
>> Mihai
>>
>>
>> On Mon, Jul 22, 2013 at 1:45 PM, Renato Golin <renato.golin at linaro.org>wrote:
>>
>>> Hi Mihail,
>>>
>>> Patch looks good, but you don't have any ldr.n tests, making sure
>>> they're still accepted and converted to plain ldr.
>>>
>>> cheers,
>>> --renato
>>>
>>>
>>> On 22 July 2013 11:51, Mihail Popa <mihail.popa at arm.com> wrote:
>>>
>>>>  Hi.
>>>>
>>>> Kindly review the attached patch. It adds range checking for "ldr Rn,
>>>> [pc, #imm]" Thumb
>>>> instructions. With this patch:
>>>>
>>>> 1. ldr.n is recognized as mnemonic for the short encoding
>>>> 2. ldr.w is recognized as menmonic for the long encoding
>>>> 3. ldr will map to either short or long encodings depending on the size
>>>> of the offset
>>>>
>>>> Regards,
>>>> Mihai
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>>
>>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130722/af974068/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-801.ldrpcrel.patch
Type: application/octet-stream
Size: 10954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130722/af974068/attachment.obj>


More information about the llvm-commits mailing list