]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Use standard name uabd for absdu insns
authorKewen Lin <linkw@linux.ibm.com>
Wed, 31 Jul 2024 02:20:51 +0000 (21:20 -0500)
committerKewen Lin <linkw@gcc.gnu.org>
Wed, 31 Jul 2024 02:20:51 +0000 (21:20 -0500)
commit169341f0893a009736f9715db969909880d0e876
tree078cc61a8f7dbac5bf9208788ea6e03fb9c4b8bb
parentb929083dd83ab50f26e10bbaa5097d5f6fb3c908
rs6000: Use standard name uabd for absdu insns

r14-1832 adds recognition pattern, ifn and optab for ABD
(ABsolute Difference), we have some vector absolute
difference unsigned instructions since ISA 3.0, as the
associated test cases shown, they are not exploited well
as we don't define it (them) with a standard name.  So this
patch is to rename it with standard name first.  And it
merges both define_expand and define_insn as a separated
define_expand isn't needed.  Besides, it adjusts the RTL
pattern by using generic umax and umin rather than
UNSPEC_VADU, it's more meaningful and can catch umin/umax
opportunity.

gcc/ChangeLog:

* config/rs6000/altivec.md (p9_vadu<mode>3): Rename to ...
(uabd<mode>3): ... this.  Update RTL pattern with umin and umax rather
than UNSPEC_VADU.
(vadu<mode>3): Remove.
(UNSPEC_VADU): Remove.
(usadv16qi): Replace gen_p9_vaduv16qi3 with gen_uabdv16qi3.
(usadv8hi): Replace gen_p9_vaduv8hi3 with gen_uabdv8hi3.
* config/rs6000/rs6000-builtins.def (__builtin_altivec_vadub): Replace
expander with uabdv16qi3.
(__builtin_altivec_vaduh): Adjust expander with uabdv8hi3.
(__builtin_altivec_vaduw): Adjust expander with uabdv4si3.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/abd-vectorize-1.c: New test.
* gcc.target/powerpc/abd-vectorize-2.c: New test.
gcc/config/rs6000/altivec.md
gcc/config/rs6000/rs6000-builtins.def
gcc/testsuite/gcc.target/powerpc/abd-vectorize-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/abd-vectorize-2.c [new file with mode: 0644]