Re: [PATCH, rs6000] GCC 7 backport to remove non-ABI vec_vinsert4b and vec_vextract4b support

2018-03-01 Thread Segher Boessenkool
Hi Carl,

On Thu, Mar 01, 2018 at 11:07:21AM -0800, Carl Love wrote:
> The following patch is a partial backport of mainline commit 257748 to
> remove the vec_vextract4b and vec_vinsert4b support.  Note in GCC 7,
> vec_vextract4b is still used so only the external definitions,
> documentation and testcases are removed for vec_vextract4b.  All of the
> vec_vinsert4b support is removed.

> This patch has been tested on GCC 7:
> 
>   powerpc64le-unknown-linux-gnu (Power 8 LE)
>   powerpc64-unknown-linux-gnu (Power 8 BE)
> 
> with no regressions.

It's a p9 patch, in the future please test such on a p9 as well (or at
least with -mcpu=power9).

>   * config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b.

Mention those removed things on the left:
* config/rs6000/altivec.h (vec_vextract4b, vec_vinsert4b): Delete.

>   * config/rs6000/vsx.md:  Remove define_expand vinsert4b, define_insn 
> *vinsert4b_internal,

Only one space after :, and this line is too long.

Patch looks fine, thanks!  Okay for 7.


Segher


[PATCH, rs6000] GCC 7 backport to remove non-ABI vec_vinsert4b and vec_vextract4b support

2018-03-01 Thread Carl Love
GCC maintainers:

The following patch is a partial backport of mainline commit 257748 to
remove the vec_vextract4b and vec_vinsert4b support.  Note in GCC 7,
vec_vextract4b is still used so only the external definitions,
documentation and testcases are removed for vec_vextract4b.  All of the
vec_vinsert4b support is removed.

This patch has been tested on GCC 7:

  powerpc64le-unknown-linux-gnu (Power 8 LE)
  powerpc64-unknown-linux-gnu (Power 8 BE)

with no regressions.

Let me know if the patch looks OK or not. Thanks.

   Carl Love
-

gcc/ChangeLog
2018-02-28  Carl Love  

* config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b.
* config/rs6000/rs6000-builtin.def: Remove macro expansion for
VINSERT4B_DI and VINSERT4B.
* config/rs6000/rs6000.c: Remove case statements for
P9V_BUILTIN_VINSERT4B, P9V_BUILTIN_VINSERT4B_DI,
and P9V_BUILTIN_VEC_VINSERT4B.
* config/rs6000/rs6000-c.c (altivec_expand_builtin): Remove entries for
P9V_BUILTIN_VEC_VEXTRACT4B and P9V_BUILTIN_VEC_VINSERT4B.
* config/rs6000/vsx.md:  Remove define_expand vinsert4b, define_insn 
*vinsert4b_internal,
define_insn "*vinsert4b_di_internal.
* doc/extend.texi: Remove vec_vextract4b, non ABI definitions for
vec_insert4b.

gcc/testsuite/ChangeLog
2018-02-28  Carl Love  

* gcc.target/powerpc/p9-vinsert4b-1.c: Remove test file for non-ABI
tests.
* gcc.target/powerpc/p9-vinsert4b-2.c: Remove test file for non-ABI
tests.
---
 gcc/config/rs6000/altivec.h   |  2 -
 gcc/config/rs6000/rs6000-builtin.def  |  3 --
 gcc/config/rs6000/rs6000-c.c  | 21 -
 gcc/config/rs6000/rs6000.c|  5 +--
 gcc/config/rs6000/vsx.md  | 52 +--
 gcc/doc/extend.texi   | 12 +-
 gcc/testsuite/gcc.target/powerpc/p9-vinsert4b-1.c | 39 -
 gcc/testsuite/gcc.target/powerpc/p9-vinsert4b-2.c | 30 -
 8 files changed, 3 insertions(+), 161 deletions(-)
 delete mode 100644 gcc/testsuite/gcc.target/powerpc/p9-vinsert4b-1.c
 delete mode 100644 gcc/testsuite/gcc.target/powerpc/p9-vinsert4b-2.c

diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index 3011a87..e04c3a5 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -398,8 +398,6 @@
 #define vec_vctzd __builtin_vec_vctzd
 #define vec_vctzh __builtin_vec_vctzh
 #define vec_vctzw __builtin_vec_vctzw
-#define vec_vextract4b __builtin_vec_vextract4b
-#define vec_vinsert4b __builtin_vec_vinsert4b
 #define vec_extract4b __builtin_vec_extract4b
 #define vec_insert4b __builtin_vec_insert4b
 #define vec_vprtyb __builtin_vec_vprtyb
diff --git a/gcc/config/rs6000/rs6000-builtin.def 
b/gcc/config/rs6000/rs6000-builtin.def
index 46ae21a..00e8e60 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -2034,8 +2034,6 @@ BU_P9V_AV_2 (VEXTUWRX, "vextuwrx",CONST,  
vextuwrx)
 
 /* Insert/extract 4 byte word into a vector.  */
 BU_P9V_VSX_2 (VEXTRACT4B,   "vextract4b",  CONST,  vextract4b)
-BU_P9V_VSX_3 (VINSERT4B,"vinsert4b",   CONST,  vinsert4b)
-BU_P9V_VSX_3 (VINSERT4B_DI, "vinsert4b_di",CONST,  vinsert4b_di)
 BU_P9V_VSX_3 (INSERT4B,"insert4b", CONST,  insert4b)
 BU_P9V_VSX_2 (EXTRACT4B,   "extract4b",CONST,  extract4b)
 
@@ -2090,7 +2088,6 @@ BU_P9V_OVERLOAD_2 (EXTRACT4B,  "extract4b")
 
 /* ISA 3.0 Vector scalar overloaded 3 argument functions */
 BU_P9V_OVERLOAD_3 (STXVL,  "stxvl")
-BU_P9V_OVERLOAD_3 (VINSERT4B,  "vinsert4b")
 BU_P9V_OVERLOAD_3 (INSERT4B,"insert4b")
 
 /* Overloaded CMPNE support was implemented prior to Power 9,
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index c3134fc..c6fd524 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -5109,27 +5109,6 @@ const struct altivec_builtin_types 
altivec_overloaded_builtins[] = {
   { P9V_BUILTIN_VEC_INSERT4B, P9V_BUILTIN_INSERT4B,
 RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI,
 RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI },
-  { P9V_BUILTIN_VEC_VINSERT4B, P9V_BUILTIN_VINSERT4B,
-RS6000_BTI_V16QI, RS6000_BTI_V4SI,
-RS6000_BTI_V16QI, RS6000_BTI_UINTSI },
-  { P9V_BUILTIN_VEC_VINSERT4B, P9V_BUILTIN_VINSERT4B,
-RS6000_BTI_V16QI, RS6000_BTI_unsigned_V4SI,
-RS6000_BTI_V16QI, RS6000_BTI_UINTSI },
-  { P9V_BUILTIN_VEC_VINSERT4B, P9V_BUILTIN_VINSERT4B,
-RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI,
-RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTSI },
-  { P9V_BUILTIN_VEC_VINSERT4B, P9V_BUILTIN_VINSERT4B_DI,
-RS6000_BTI_V16QI, RS6000_BTI_INTDI,
-RS6000_BTI_V16QI, RS6000_BTI_UINTDI },
-  { P9V_BUILTIN_VEC_VINSERT4B,