[PATCH][AArch64] Restrict MOV alias for ORR instruction

Egeyar Bagcioglu egeyar.bagcioglu@oracle.com
Tue Oct 30 18:12:00 GMT 2018


ARM Architecture Reference Manual for the profile ARMv8-A, Issue C.a, 
states that MOV (register) is an alias of the ORR (shifted register) iff 
shift == '00' && imm6 == '000000' && Rn == '11111'. However, mov is 
currently preferred for a broader range of orr instructions.

PR 23193 is filed for this purpose and still open. Another related one, 
19721 was filed earlier and resolved inconsistently with the manual.

The attached patch fixes the opcodes to match the manual in this regard, 
corrects existing test cases and adds new ones. I have re-used the test 
source and the driver of the older pr, 19721.

I did *not* replace the existing Rm_SFT used in the "mov" entry with an 
Rm. Therefore, "mov" usages with shifted registers such as "mov x7, x17, 
lsl 25" could continue to be accepted. However, they are not generated 

The suggested change log is the following:

2018-10-30  Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>

     [AArch64] Use MOV (register) as an alias for ORR (shifted register)
     iff shift == '00' && imm6 == '000000' && Rn == '11111'.

         PR 23193
         PR 19721
         * testsuite/gas/aarch64/pr19721.s: Add new test cases.
         * testsuite/gas/aarch64/pr19721.d: Correct existing test
         cases and add new ones.

         PR 23193
         PR 19721
         * aarch64-tbl.h: Use MOV (register) as an alias for ORR (shifted
         register) iff shift == '00' && imm6 == '000000' && Rn == '11111'.

Tested on aarch64-unknown-linux-gnu and showed no regressions.

Please take a look and apply if legitimate.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: restrict-mov-alias-for-orr.patch
Type: text/x-patch
Size: 2074 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20181030/ac6693ec/attachment.bin>

More information about the Binutils mailing list