]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Reimplement RSHRN intrinsic patterns with standard RTL codes
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 26 Apr 2023 14:10:18 +0000 (15:10 +0100)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 26 Apr 2023 14:10:18 +0000 (15:10 +0100)
commit80afac3121778e509e1847be90a1999236cff03a
treef68eb8add978190c840e4c503b7bfe233020467b
parentbd0791e899ea542deb6b3821b0a1d435d9754d5c
aarch64: Reimplement RSHRN intrinsic patterns with standard RTL codes

This patch reimplements the backend patterns for the rshrn intrinsics using standard RTL codes rather than UNSPECS.
We already represent shrn as truncate of a shift. rshrn can be represented as truncate (src + (1 << (shft - 1)) >> shft),
similar to how LLVM treats it.

I have a follow-up patch to do the same for the rshrn2 pattern, which will allow us to remove the UNSPEC_RSHRN entirely.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

* config/aarch64/aarch64-simd.md (aarch64_rshrn<mode>_insn_le): Reimplement
with standard RTL codes instead of an UNSPEC.
(aarch64_rshrn<mode>_insn_be): Likewise.
(aarch64_rshrn<mode>): Adjust for the above.
* config/aarch64/predicates.md (aarch64_simd_rshrn_imm_vec): Define.
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/predicates.md