Re: [PATCH, rs6000] Remove non-ABI builtin support for vec_insert4b, vec_extract4b

2018-02-16 Thread Segher Boessenkool
Hi!

> This is the second patch that removes the non-ABI vec_insert4b and
> vec_extract4b builtin support.  It also removes the two existing test
> files for the non-ABI builtin instances.  A runnable test file for the
> ABI specified builtins was added by the first patch.

Looks good too; okay for trunk.  See changelog comments though.

> The patch should also be ported to GCC 7 so we are in compliance with
> the ABI.

Also okay for 7 (just like the previous patch) after simmering on trunk
for a bit.

Thanks,


Segher


> 2018-02-13  Carl Love  
> 
> * config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b.

* config/rs6000/altvec.h (vec_vextract4b, vec_vinsert): Delete.

> * config/rs6000/rs6000-builtin.def: Remove macro expansion for
>   VEXTRACT4B, VINSERT4B, VINSERT4B_DI and VEXTRACT4B.
> * config/rs6000/rs6000.c: Remove case statements for
>   P9V_BUILTIN_VEXTRACT4B, P9V_BUILTIN_VEC_VEXTRACT4B,
>   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:
> * doc/extend.texi: Remove vec_vextract4b, non ABI definitions for
>   vec_insert4b.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-02-13  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.

[ Whitespace is totally jumbled in the changelog, I guess that is your
mail program. ]


Segher


[PATCH, rs6000] Remove non-ABI builtin support for vec_insert4b, vec_extract4b

2018-02-14 Thread Carl Love
GCC maintainers:

This is the second patch that removes the non-ABI vec_insert4b and
vec_extract4b builtin support.  It also removes the two existing test
files for the non-ABI builtin instances.  A runnable test file for the
ABI specified builtins was added by the first patch.

This patch has been tested on:

  powerpc64le-unknown-linux-gnu (Power 8 LE)
  powerpc64le-unknown-linux-gnu (Power 9 LE)

with no regressions.

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

The patch should also be ported to GCC 7 so we are in compliance with
the ABI.

   Carl Love
---

gcc/ChangeLog:

2018-02-13  Carl Love  

* config/rs6000/altivec.h: Remove vec_vextract4b and vec_vinsert4b.
* config/rs6000/rs6000-builtin.def: Remove macro expansion for
VEXTRACT4B, VINSERT4B, VINSERT4B_DI and VEXTRACT4B.
* config/rs6000/rs6000.c: Remove case statements for
P9V_BUILTIN_VEXTRACT4B, P9V_BUILTIN_VEC_VEXTRACT4B,
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:
* doc/extend.texi: Remove vec_vextract4b, non ABI definitions for
vec_insert4b.

gcc/testsuite/ChangeLog:

2018-02-13  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  |  5 --
 gcc/config/rs6000/rs6000-c.c  | 25 ---
 gcc/config/rs6000/rs6000.c|  5 --
 gcc/config/rs6000/vsx.md  | 87 ---
 gcc/doc/extend.texi   | 11 +--
 gcc/testsuite/gcc.target/powerpc/p9-vinsert4b-1.c | 39 --
 gcc/testsuite/gcc.target/powerpc/p9-vinsert4b-2.c | 30 
 8 files changed, 1 insertion(+), 203 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 3bce2ae39..1e495e69c 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -433,8 +433,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 420d12e29..16fb18d53 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -2226,9 +2226,6 @@ BU_P9V_AV_2 (VEXTUWLX, "vextuwlx",CONST,  
vextuwlx)
 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)
 
@@ -2292,13 +2289,11 @@ BU_P9V_OVERLOAD_2 (LXVL,"lxvl")
 BU_P9V_OVERLOAD_2 (XL_LEN_R,   "xl_len_r")
 BU_P9V_OVERLOAD_2 (VEXTULX,"vextulx")
 BU_P9V_OVERLOAD_2 (VEXTURX,"vexturx")
-BU_P9V_OVERLOAD_2 (VEXTRACT4B, "vextract4b")
 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 (XST_LEN_R,  "xst_len_r")
-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 56e66db98..24675b12e 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -5429,10 +5429,6 @@ const struct altivec_builtin_types 
altivec_overloaded_builtins[] = {
   { P9V_BUILTIN_VEC_VCTZLSBB, P9V_BUILTIN_VCTZLSBB_V4SI,
 RS6000_BTI_INTSI, RS6000_BTI_V4SI, 0, 0 },
 
-  { P9V_BUILTIN_VEC_VEXTRACT4B, P9V_BUILTIN_VEXTRACT4B,
-RS6000_BTI_INTDI, RS6000_BTI_V16QI, RS6000_BTI_UINTSI, 0 },
-  { P9V_BUILTIN_VEC_VEXTRACT4B, P9V_BUILTIN_VEXTRACT4B,
-RS6000_BTI_INTDI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_UINTSI, 0 },
   { P9V_BUILTIN_VEC_EXTRACT4B, P9V_BUILTIN_EXTRACT4B,
 RS6000_BTI_unsigned_V2DI,