From 90a158075a6b4e26c2e1204c71aa7f49548c5bd7 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Thu, 24 Oct 2019 20:22:33 +0200 Subject: [PATCH] rs6000: Implement [u]avg3_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): Rename to... (uavg3_ceil): ... This. (altivec_vavgs): Rename to... (avg3_ceil): ... This. * config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH, VAVGUW, VAVGSW): Adjust. From-SVN: r277421 --- gcc/ChangeLog | 9 +++++++++ gcc/config/rs6000/altivec.md | 4 ++-- gcc/config/rs6000/rs6000-builtin.def | 12 ++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fb00aa65b79..64942512edb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2019-10-24 Segher Boessenkool + + * config/rs6000/altivec.md (altivec_vavgu): Rename to... + (uavg3_ceil): ... This. + (altivec_vavgs): Rename to... + (avg3_ceil): ... This. + * config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH, + VAVGUW, VAVGSW): Adjust. + 2019-10-24 Nathan Sidwell * dumpfile.c (dump_begin): Reorder decls to use RAII. diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index dc34528a4d5..daa91a49425 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -560,7 +560,7 @@ [(set_attr "type" "vecsimple")]) ;; -(define_insn "altivec_vavgu" +(define_insn "uavg3_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 %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vavgs" +(define_insn "avg3_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")] diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index 4d4f3b3e746..0feee7cafca 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -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) -- 2.30.2