]> git.ipfire.org Git - thirdparty/gcc.git/commit
arm: add commutative alternatives to <US>mull pattern.
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 25 Mar 2025 11:50:30 +0000 (11:50 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 25 Mar 2025 12:06:22 +0000 (12:06 +0000)
commita86891525d200c1ae81d9f5f441a5b8e24b647ca
tree99bdc75422ab92a716eb7a1cc8494a03fe666f76
parent7679b826840c58343d72d05922355b646db4bdcc
arm: add commutative alternatives to <US>mull pattern.

Prior to Armv6, the SMULL and UMULL instructions, which have the form

     UMULL Rdlo, Rdhi, Rm, Rs

had an operand restriction such that Rdlo, Rdhi and Rm must all be
different registers.  Rs, however can overlap either of the
destination registers.  Add some register-tie alternatives to allow
the register allocator to find these forms without having to use
additional register moves.

In addition to this, the test is pretty meaningless on Thumb-1 targets
as the S/UMULL instructions do not exist in a 16-bit encoding.  So skip
the test in this case.

gcc/ChangeLog:

* config/arm/arm.md (<US>mull): Add alternatives that allow Rs
to be tied to either Rdlo or Rdhi.

gcc/testsuite/ChangeLog:

* gcc.target/arm/pr42575.c: Skip test if thumb1.
gcc/config/arm/arm.md
gcc/testsuite/gcc.target/arm/pr42575.c