On Tue, Jan 29, 2019 at 12:11:46AM +0000, Steve Ellcey wrote:
> > As mentioned in rs6000.md, I believe you also need a similar pattern where
> > the two ANDs are swapped, because they have the same priority.
>
> I fixed the long lines in aarch64.md and I added a second pattern for
> the *aarch64_bfi<GPI:mode>4_noshift pattern, swapping the order of the
> IOR operands. I did not swap the AND operands, I assume the compiler
> would ensure that the register was always before the constant or that
> it would check both orderings.
Yes, you can look at commutative_operand_precedence and
swap_commutative_operands_p. The issue is just if
commutative_operand_precedence
of both operands is equal (and that function doesn't recurse for
suboperands).
> I tried adding a second version of *aarch64_bfi<GPI:mode>5_shift as
> well but when I tested it, it never got used during a bootstrap build
> or a GCC test run so I decided it was not needed.
I'll try tomorrow if I can construct a testcase or not.
In any case, you want an aarch64 maintainer to ack this.
Thanks for working on this.
Jakub