[PATCH] Add support for ARM modified immediate syntax

Mihail Popa mihail.popa at gmail.com
Fri Aug 23 07:11:49 PDT 2013


Just for the record, attached is the patch which fixes the code deciding
whether an immediate is in canonic encoding.

Regards,
Mihai


On Fri, Aug 23, 2013 at 12:04 PM, Mihail Popa <mihail.popa at gmail.com> wrote:

> > This isn't quite right. "#1, #30" is not canonical, for example (I
> > only know this because I made the same mistake in my patch at first).
>
> Yes, indeed. Thanks for spotting that.
>
> Mihai
>
>
> On Thu, Aug 22, 2013 at 11:46 AM, Tim Northover <t.p.northover at gmail.com>wrote:
>
>> Hi Mihai,
>>
>> I think the approach is interesting, but a dead end. It cements the
>> duplicated instructions rather than moving towards unification.
>>
>> http://llvm-reviews.chandlerc.com/D1432 *does* move that way (and also
>> converts "add r0, #0, #0" back into "add r0, #0" automatically).
>>
>> That said, I did have a look at the code and spotted this:
>>
>> +  static inline bool isSOImmCanonical(unsigned Val, unsigned Rot) {
>> +    if (Rot == 0) return true;
>> +    if (Val == 0 && Rot != 0) return false;
>> +    return (Val % 4) != 0;
>> +  }
>>
>> This isn't quite right. "#1, #30" is not canonical, for example (I
>> only know this because I made the same mistake in my patch at first).
>>
>> Cheers.
>>
>> Tim.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130823/99dc35c2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-759.modimm.patch
Type: application/octet-stream
Size: 39848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130823/99dc35c2/attachment.obj>


More information about the llvm-commits mailing list