Skip to content
Snippets Groups Projects
Commit 169341f0 authored by Kewen Lin's avatar Kewen Lin Committed by Kewen Lin
Browse files

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.
parent b929083d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment