Egeyar Bagcioglu
2018-10-30 18:12:38 UTC
Hello,
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
anymore.
The suggested change log is the following:
2018-10-30Â Egeyar Bagcioglu <***@oracle.com>
   [AArch64] Use MOV (register) as an alias for ORR (shifted register)
   iff shift == '00' && imm6 == '000000' && Rn == '11111'.
   gas/ChangeLog:
       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.
   opcodes/ChangeLog:
       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.
Regards,
Egeyar
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
anymore.
The suggested change log is the following:
2018-10-30Â Egeyar Bagcioglu <***@oracle.com>
   [AArch64] Use MOV (register) as an alias for ORR (shifted register)
   iff shift == '00' && imm6 == '000000' && Rn == '11111'.
   gas/ChangeLog:
       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.
   opcodes/ChangeLog:
       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.
Regards,
Egeyar