rs6000: Implement [u]avg<mode>3_ceil
authorSegher Boessenkool <segher@kernel.crashing.org>
Thu, 24 Oct 2019 18:22:33 +0000 (20:22 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Thu, 24 Oct 2019 18:22:33 +0000 (20:22 +0200)
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

gcc/ChangeLog
gcc/config/rs6000/altivec.md
gcc/config/rs6000/rs6000-builtin.def

index fb00aa65b794c1dcc7df7810939c4d392c1ee740..64942512edb7394aa4bba027928405a0b7791ef5 100644 (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.
index dc34528a4d545fb725bf8223d4ad56dd7de239fb..daa91a4942569712fc567d67f11d3ebd0f31ce48 100644 (file)
   [(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")]
   "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")]
index 4d4f3b3e74628e81dad9ebfde26efa095d57bc71..0feee7cafca7219cb8b149d938380ec2b3c2b99e 100644 (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)