arm: Auto-vectorization for MVE: add __fp16 support to VCMP
authorChristophe Lyon <christophe.lyon@linaro.org>
Mon, 17 May 2021 12:31:58 +0000 (12:31 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Mon, 17 May 2021 12:31:58 +0000 (12:31 +0000)
commit7606865198b241b4c944f66761d6506b02ead951
treeee96349b7fccdd8f7bf8800fa1990f4c411cb325
parenta6eacbf1055520e968d1a25f6d30d6ff4b66272d
arm: Auto-vectorization for MVE: add __fp16 support to VCMP

This patch adds __fp16 support to the previous patch that added vcmp
support with MVE. For this we update existing expanders to use VDQWH
iterator, and add a new expander vcond<VH_cvtto><mode>.  In the
process we need to create suitable iterators, and update v_cmp_result
as needed.

2021-05-17  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* config/arm/iterators.md (V16): New iterator.
(VH_cvtto): New iterator.
(v_cmp_result): Added V4HF and V8HF support.
* config/arm/vec-common.md (vec_cmp<mode><v_cmp_result>): Use VDQWH.
(vcond<mode><mode>): Likewise.
(vcond_mask_<mode><v_cmp_result>): Likewise.
(vcond<VH_cvtto><mode>): New expander.

gcc/testsuite/
* gcc.target/arm/simd/mve-compare-3.c: New test with GCC vectors.
* gcc.target/arm/simd/mve-vcmp-f16.c: New test for
auto-vectorization.
* gcc.target/arm/armv8_2-fp16-arith-1.c: Adjust since we now
vectorize float16_t vectors.
gcc/config/arm/iterators.md
gcc/config/arm/vec-common.md
gcc/testsuite/gcc.target/arm/armv8_2-fp16-arith-1.c
gcc/testsuite/gcc.target/arm/simd/mve-compare-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/simd/mve-vcmp-f16.c [new file with mode: 0644]