[PATCH][ARM] PR 49526: Add support for smmul,smmla,smmls instructions

Kyrill Tkachov kyrylo.tkachov@arm.com
Fri Nov 6 17:05:00 GMT 2015


Hi all,

This patch introduces support for the smmul, smmla and smmls instructions that appear in armv6 architecture levels
and higher. To quote the SMMUL description from the ARMARM:
"Signed Most Significant Word Multiply multiplies two signed 32-bit values, extracts the most significant 32 bits of
the result, and writes those bits to the destination register."

The smmla and smmls are the multiply-accumulate and multiply-subtract extensions of that multiply.
There also exists an smmulr variant that rounds the result rather than truncating it.
However, when I tried adding patterns for those forms I got an LRA ICE that I was not able to figure out.
I'll try to find a testcase for that, but in the meantime there's no reason to not have patterns for the
non-rounding variants.

Bootstrapped and tested on arm-none-linux-gnueabihf.
I've seen this trigger in quite a few places in SPEC2006 where it always made the code better.

Ok for trunk?

Thanks,
Kyrill

2015-11-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/49526
     * config/arm/arm.md (*mulsidi3si_v6): New pattern.
     (*mulsidi3siaddsi_v6): Likewise.
     (*mulsidi3sisubsi_v6): Likewise.
     * config/arm/predicates.md (subreg_highpart_operator):
     New predicate.

2015-11-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     PR target/49526
     * gcc.target/arm/pr49526_1.c: New test.
     * gcc.target/arm/pr49526_2.c: Likewise.
     * gcc.target/arm/pr49526_3.c: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-smmul.patch
Type: text/x-patch
Size: 4305 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151106/f61fe274/attachment.bin>


More information about the Gcc-patches mailing list