aarch64: A couple of mul_laneq tweaks
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 11 May 2021 11:17:33 +0000 (12:17 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 11 May 2021 11:17:33 +0000 (12:17 +0100)
commit28de75d27685b2735612d264bb96f39001f4d836
tree6dc7aafb1c477e2ebde086d389e39cebd456f577
parent2301a394607b88f8996efe864350c5f841000f76
aarch64: A couple of mul_laneq tweaks

This patch removes the duplication between the mul_laneq<mode>3
and the older mul-lane patterns.  The older patterns were previously
divided into two based on whether the indexed operand had the same mode
as the other operands or whether it had the opposite length from the
other operands (64-bit vs. 128-bit).  However, it seemed easier to
divide them instead based on whether the indexed operand was 64-bit or
128-bit, since that maps directly to the arm_neon.h “q” conventions.

Also, it looks like the older patterns were missing cases for
V8HF<->V4HF combinations, which meant that vmul_laneq_f16 and
vmulq_lane_f16 didn't produce single instructions.

There was a typo in the V2SF entry for VCONQ, but in practice
no patterns were using that entry until now.

The test passes for both endiannesses, but endianness does change
the mapping between regexps and functions.

gcc/
* config/aarch64/iterators.md (VMUL_CHANGE_NLANES): Delete.
(VMULD): New iterator.
(VCOND): Handle V4HF and V8HF.
(VCONQ): Fix entry for V2SF.
* config/aarch64/aarch64-simd.md (mul_lane<mode>3): Use VMULD
instead of VMUL.  Use a 64-bit vector mode for the indexed operand.
(*aarch64_mul3_elt_<vswap_width_name><mode>): Merge with...
(mul_laneq<mode>3): ...this define_insn.  Use VMUL instead of VDQSF.
Use a 128-bit vector mode for the indexed operand.  Use stype for
the scheduling type.

gcc/testsuite/
* gcc.target/aarch64/fmul_lane_1.c: New test.
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/iterators.md
gcc/testsuite/gcc.target/aarch64/fmul_lane_1.c [new file with mode: 0644]