arm: Auto-vectorization for MVE: vmin/vmax
authorDennis Zhang <dennis.zh@live.com>
Thu, 22 Oct 2020 00:27:31 +0000 (01:27 +0100)
committerDennis Zhang <dennis.zh@live.com>
Thu, 22 Oct 2020 00:27:31 +0000 (01:27 +0100)
commit76835dca95ab9f3f106a0db1e6152ad0740b38b3
tree2256c95a661d1cda77d3fc324411095f5d4bb46b
parent966fdb2e12c0347aa3f9efaf5f4e1cd8237fa024
arm: Auto-vectorization for MVE: vmin/vmax

This patch enables MVE vmin/vmax instructions for auto-vectorization.
MVE target is included in expander smin<mode>3, umin<mode>3, smax<mode>3
and umax<mode>3 for vectorization. Related insns for vmin/vmax in mve.md
are modified to use smin, umin, smax and umax expressions instead of
unspec to support the expanders.

gcc/ChangeLog:

2020-10-22  Dennis Zhang  <dennis.zhang@arm.com>

* config/arm/mve.md (mve_vmaxq_<supf><mode>): Replace with ...
(mve_vmaxq_s<mode>, mve_vmaxq_u<mode>): ... these new insns to
use smax/umax instead of VMAXQ.
(mve_vminq_<supf><mode>): Replace with ...
(mve_vminq_s<mode>, mve_vminq_u<mode>): ... these new insns to
use smin/umin instead of VMINQ.
(mve_vmaxnmq_f<mode>): Use smax instead of VMAXNMQ_F.
(mve_vminnmq_f<mode>): Use smin instead of VMINNMQ_F.
* config/arm/vec-common.md (smin<mode>3): Use the new mode macros
ARM_HAVE_<MODE>_ARITH.
(umin<mode>3, smax<mode>3, umax<mode>3): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/arm/simd/mve-vminmax_1.c: New test.
gcc/ChangeLog
gcc/config/arm/mve.md
gcc/config/arm/vec-common.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/simd/mve-vminmax_1.c [new file with mode: 0644]