[AArch64] PR target/20666, fix wrong encoding of new introduced BFC pseudo

Jiong Wang jiong.wang@foss.arm.com
Mon Oct 10 16:41:00 GMT 2016


On 24/11/15 11:17, Matthew Wahab wrote:
> opcodes/
> 2015-11-24  Matthew Wahab  <matthew.wahab@arm.com>
>
>     * aarch64-asm-2.c: Regenerate.
>     * aarch64-asm.c (convert_bfc_to_bfm): New.

There looks like a copy & paste error in this function, and caused PR target/20666.

+convert_bfc_to_bfm (aarch64_inst *inst)
+{
+  int64_t lsb, width;
+
+  /* Insert XZR.  */
+  copy_operand_info (inst, 3, 2);
+  copy_operand_info (inst, 2, 1);
+  copy_operand_info (inst, 2, 0);
                             ^~~~~~~ should be "0".

"BFC Xd, lsb, width" is simplified form of "BFI Xd, XZR, lsb, width", and both
are alias and will be transformed into "BFM Xd, XZR, immr, imms" during encoding,
we inserting XZR into operand 1 of BFM, and the operand 0 (Xd) is not changed.

The expected results in the testcase are also wrong. Both fixed.

OK for master?

And I want to backport to 2.26/2.27 as this is a encoding bug.

opcode/
2016-10-10  Jiong Wang  <jiong.wang@arm.com>

         PR target/20666
         * aarch64-asm.c (convert_bfc_to_bfm): Fix dest index.

gas/
2016-10-10  Jiong Wang  <jiong.wang@arm.com>

         PR target/20666
         * testsuite/gas/aarch64/alias-2.d: Update expected results.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: e.patch
Type: text/x-patch
Size: 2674 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20161010/dfe7b7aa/attachment.bin>


More information about the Binutils mailing list