AArch64: Adjust costing of by element MUL to be the same as SAME3 MUL.
authorTamar Christina <tamar.christina@arm.com>
Wed, 10 Jun 2020 10:55:46 +0000 (11:55 +0100)
committerTamar Christina <tamar.christina@arm.com>
Wed, 10 Jun 2020 10:55:46 +0000 (11:55 +0100)
commitdf81764ba1a276d9b48f408bd2dd1e71e09e7863
treede51bc17f2318c38720ba8ffcdfa54dce2692cbc
parentb05d5563f4be13b4a0d0951375a82adf483973c0
AArch64: Adjust costing of by element MUL to be the same as SAME3 MUL.

The cost model is currently treating multiplication by element as being more
expensive than 3 same multiplication.  This means that if the value is on the
SIMD side we add an unneeded DUP.  If the value is on the genreg side we use the
more expensive DUP instead of fmov.

This patch corrects the costs such that the two multiplies are costed the same
which allows us to generate

        fmul    v3.4s, v3.4s, v0.s[0]

instead of

        dup     v0.4s, v0.s[0]
        fmul    v3.4s, v3.4s, v0.4s

gcc/ChangeLog:

* config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Adjust costs for mul.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/asimd-mull-elem.c: New test.
gcc/config/aarch64/aarch64.c
gcc/testsuite/gcc.target/aarch64/asimd-mull-elem.c [new file with mode: 0644]