[PATCH] Fix Thumb2 aliasing complementary instructions taking modified immediates

Mihail Popa mihail.popa at arm.com
Fri Aug 16 02:13:25 PDT 2013


Hi.

Please review the attached patch.

There are many Thumb instructions which take 12-bit immediates encoded 
in a special
8-byte value + 4-byte rotator form. Not all numbers are represented, and 
it's legal
to transform an assembly instruction to be able to encode the immediate.

For example: AND and BIC are complementary instructions; one can switch 
the AND
to a BIC as long as the immediate is complemented.

The intent is to switch one instruction into its complementary one when 
the immediate
cannot be encoded in the form requested in the original assembly and 
when the
complementary immediate is encodable.

The patch addresses two issues:
1. definition of t2SOImmNot immediate - it has to check that the orignal 
value is
not encoded naturally
2. t2AND and t2BIC instruction aliases which should use the Thumb2 SOImm 
operand
rather than the ARM one.

Regards,
Mihai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130816/4704e602/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-828.andbic.patch
Type: text/x-patch
Size: 3781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130816/4704e602/attachment.bin>


More information about the llvm-commits mailing list