rs6000: Implement [u]avg<mode>3_ceil

We already had those in fact, just under other names.  Use the standard
names so that the vectorizer can use it.


	* config/rs6000/altivec.md (altivec_vavgu<VI_char>): Rename to...
	(uavg<mode>3_ceil): ... This.
	(altivec_vavgs<VI_char>): Rename to...
	(avg<mode>3_ceil): ... This.
	* config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH,
	VAVGUW, VAVGSW): Adjust.

From-SVN: r277421
This commit is contained in:
Segher Boessenkool 2019-10-24 20:22:33 +02:00 committed by Segher Boessenkool
parent 1c95aee0a3
commit 90a158075a
3 changed files with 17 additions and 8 deletions

View File

@ -1,3 +1,12 @@
2019-10-24 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/altivec.md (altivec_vavgu<VI_char>): Rename to...
(uavg<mode>3_ceil): ... This.
(altivec_vavgs<VI_char>): Rename to...
(avg<mode>3_ceil): ... This.
* config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH,
VAVGUW, VAVGSW): Adjust.
2019-10-24 Nathan Sidwell <nathan@acm.org>
* dumpfile.c (dump_begin): Reorder decls to use RAII.

View File

@ -560,7 +560,7 @@
[(set_attr "type" "vecsimple")])
;;
(define_insn "altivec_vavgu<VI_char>"
(define_insn "uavg<mode>3_ceil"
[(set (match_operand:VI 0 "register_operand" "=v")
(unspec:VI [(match_operand:VI 1 "register_operand" "v")
(match_operand:VI 2 "register_operand" "v")]
@ -569,7 +569,7 @@
"vavgu<VI_char> %0,%1,%2"
[(set_attr "type" "vecsimple")])
(define_insn "altivec_vavgs<VI_char>"
(define_insn "avg<mode>3_ceil"
[(set (match_operand:VI 0 "register_operand" "=v")
(unspec:VI [(match_operand:VI 1 "register_operand" "v")
(match_operand:VI 2 "register_operand" "v")]

View File

@ -1002,12 +1002,12 @@ BU_ALTIVEC_2 (VADDUWS, "vadduws", CONST, altivec_vadduws)
BU_ALTIVEC_2 (VADDSWS, "vaddsws", CONST, altivec_vaddsws)
BU_ALTIVEC_2 (VAND, "vand", CONST, andv4si3)
BU_ALTIVEC_2 (VANDC, "vandc", CONST, andcv4si3)
BU_ALTIVEC_2 (VAVGUB, "vavgub", CONST, altivec_vavgub)
BU_ALTIVEC_2 (VAVGSB, "vavgsb", CONST, altivec_vavgsb)
BU_ALTIVEC_2 (VAVGUH, "vavguh", CONST, altivec_vavguh)
BU_ALTIVEC_2 (VAVGSH, "vavgsh", CONST, altivec_vavgsh)
BU_ALTIVEC_2 (VAVGUW, "vavguw", CONST, altivec_vavguw)
BU_ALTIVEC_2 (VAVGSW, "vavgsw", CONST, altivec_vavgsw)
BU_ALTIVEC_2 (VAVGUB, "vavgub", CONST, uavgv16qi3_ceil)
BU_ALTIVEC_2 (VAVGSB, "vavgsb", CONST, avgv16qi3_ceil)
BU_ALTIVEC_2 (VAVGUH, "vavguh", CONST, uavgv8hi3_ceil)
BU_ALTIVEC_2 (VAVGSH, "vavgsh", CONST, avgv8hi3_ceil)
BU_ALTIVEC_2 (VAVGUW, "vavguw", CONST, uavgv4si3_ceil)
BU_ALTIVEC_2 (VAVGSW, "vavgsw", CONST, avgv4si3_ceil)
BU_ALTIVEC_2 (VCFUX, "vcfux", CONST, altivec_vcfux)
BU_ALTIVEC_2 (VCFSX, "vcfsx", CONST, altivec_vcfsx)
BU_ALTIVEC_2 (VCMPBFP, "vcmpbfp", CONST, altivec_vcmpbfp)