Hi all,

Motivated by a recent LLVM patch I saw, we can use SVE for 64-bit vector 
integer MUL (plain Advanced SIMD doesn't support it).
Since the Advanced SIMD regs are just the low 128-bit part of the SVE regs it 
all works transparently.
It's a reasonably straightforward implementation of the mulv2di3 optab that 
wires it up through the mulvnx2di3 expander and
subregs the results back to the Advanced SIMD modes.

There's more such tricks possible with other operations (and we could do 64-bit 
multiply-add merged operations too) but for now
this self-contained patch improves the mul case as without it for the testcases 
in the patch we'd have scalarised the arguments,
moved them to GP regs, performed two GP MULs and moved them back to SIMD regs.
Advertising a mulv2di3 optab from the backend should also allow for more 
flexibile vectorisation opportunities.

Bootstrapped and tested on aarch64-none-linux-gnu.
Pushing to trunk.
Thanks,
Kyrill

gcc/ChangeLog:

        * config/aarch64/aarch64-simd.md (mulv2di3): New expander.

gcc/testsuite/ChangeLog:

        * gcc.target/aarch64/sve-neon-modes_1.c: New test.
        * gcc.target/aarch64/sve-neon-modes_2.c: New test.

Attachment: mulv2di.patch
Description: mulv2di.patch

Reply via email to