From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id 38EF13857C7A; Thu, 28 Jan 2021 23:21:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38EF13857C7A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: William Schmidt To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: More bug fixes X-Act-Checkin: gcc X-Git-Author: Bill Schmidt X-Git-Refname: refs/users/wschmidt/heads/builtins4 X-Git-Oldrev: 013fb6e9e7d3c14e2e91523f1c7e07a5f392f6ad X-Git-Newrev: fa6a1a08419013e7c541ecd3102480e6c49f2a4e Message-Id: <20210128232159.38EF13857C7A@sourceware.org> Date: Thu, 28 Jan 2021 23:21:59 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2021 23:21:59 -0000 https://gcc.gnu.org/g:fa6a1a08419013e7c541ecd3102480e6c49f2a4e commit fa6a1a08419013e7c541ecd3102480e6c49f2a4e Author: Bill Schmidt Date: Thu Jan 28 17:21:38 2021 -0600 rs6000: More bug fixes 2021-01-28 Bill Schmidt gcc/ * config/rs6000/altivec.h: Add deprecated interfaces. * config/rs6000/rs6000-builtin-new.def (__builtin_altivec_vgnb): Fix prototype. * config/rs6000/rs6000-overload.def: Miscellaneous fixes. gcc/testsuite/ * gcc.target/powerpc/p9-vparity.c: Revert earlier changes. Diff: --- gcc/config/rs6000/altivec.h | 22 ++++++++++++------ gcc/config/rs6000/rs6000-builtin-new.def | 2 +- gcc/config/rs6000/rs6000-overload.def | 24 ++++++++++++++++++-- gcc/testsuite/gcc.target/powerpc/p9-vparity.c | 32 +++++++++++++-------------- 4 files changed, 54 insertions(+), 26 deletions(-) diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index 312e5657623..c68e854f30f 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -57,6 +57,21 @@ #include "rs6000-vecdefines.h" +/* Deprecated interfaces. */ +#define vec_vsld vec_sld +#define vec_vsrad vec_srad +#define vec_vsrd vec_srd + +#ifdef _ARCH_PWR9 +#define __builtin_vec_vadub __builtin_vec_vadu +#define __builtin_vec_vaduh __builtin_vec_vadu +#define __builtin_vec_vaduw __builtin_vec_vadu +#define __builtin_vec_vprtybw __builtin_vec_vprtyb +#define __builtin_vec_vprtybd __builtin_vec_vprtyb +#define __builtin_vec_vprtybq __builtin_vec_vprtyb +#define vec_vrlnm vec_rlnm +#endif + /* Synonyms. */ /* Functions that are resolved by the backend to one of the typed builtins. */ @@ -264,11 +279,4 @@ __altivec_scalar_pred(vec_any_nle, to #define vec_step to __builtin_vec_step. */ #define vec_step(x) __builtin_vec_step (* (__typeof__ (x) *) 0) -/* Deprecated interfaces. */ -#ifdef _ARCH_PWR9 -#define __builtin_vec_vadub __builtin_vec_vadu -#define __builtin_vec_vaduh __builtin_vec_vadu -#define __builtin_vec_vaduw __builtin_vec_vadu -#endif - #endif /* _ALTIVEC_H */ diff --git a/gcc/config/rs6000/rs6000-builtin-new.def b/gcc/config/rs6000/rs6000-builtin-new.def index 417fd2a35dd..84654e872e0 100644 --- a/gcc/config/rs6000/rs6000-builtin-new.def +++ b/gcc/config/rs6000/rs6000-builtin-new.def @@ -3183,7 +3183,7 @@ const signed int __builtin_altivec_vextractmw (vui); VEXTRACTMW vec_extract_v4si {} - const unsigned long long __builtin_altivec_vgnb (vuq, const int <2,7>); + const unsigned long long __builtin_altivec_vgnb (vull, const int <2,7>); VGNB vgnb {} const vuc __builtin_altivec_vinsgubvlx (unsigned int, vuc, unsigned int); diff --git a/gcc/config/rs6000/rs6000-overload.def b/gcc/config/rs6000/rs6000-overload.def index 344c78b6a83..a2651e59c9f 100644 --- a/gcc/config/rs6000/rs6000-overload.def +++ b/gcc/config/rs6000/rs6000-overload.def @@ -3071,7 +3071,7 @@ vull __builtin_vec_rl (vull, vull); VRLD VRLD_VULL -[VEC_RLMI, vec_rlmi, __builtin_vec_rlmi] +[VEC_RLMI, vec_rlmi, __builtin_vec_rlmi, _ARCH_PWR9] vui __builtin_vec_rlmi (vui, vui, vui); VRLWMI vull __builtin_vec_rlmi (vull, vull, vull); @@ -3079,7 +3079,7 @@ ; We SKIP vec_rlnm so that altivec.h can define it as the three-operand ; form we expose to the users. -[VEC_RLNM, SKIP, __builtin_vec_rlnm] +[VEC_RLNM, SKIP, __builtin_vec_rlnm, _ARCH_PWR9] vui __builtin_vec_rlnm (vui, vui); VRLWNM vull __builtin_vec_rlnm (vull, vull); @@ -4320,6 +4320,26 @@ vd __builtin_vec_insert_exp (vull, vull); VIEDP VIEDP_VULL +; It is truly unfortunate that vec_vprtyb has an incompatible set of +; interfaces with vec_parity_lsbb. So we can't even deprecate this. +[VEC_VPRTYB, vec_vprtyb, __builtin_vec_vprtyb, _ARCH_PWR9] + vsi __builtin_vec_vprtyb (vsi); + VPRTYBW VPRTYB_VSI + vui __builtin_vec_vprtyb (vui); + VPRTYBW VPRTYB_VUI + vsll __builtin_vec_vprtyb (vsll); + VPRTYBD VPRTYB_VSLL + vull __builtin_vec_vprtyb (vull); + VPRTYBD VPRTYB_VULL + vsq __builtin_vec_vprtyb (vsq); + VPRTYBQ VPRTYB_VSQ + vuq __builtin_vec_vprtyb (vuq); + VPRTYBQ VPRTYB_VUQ + signed __int128 __builtin_vec_vprtyb (signed __int128); + VPRTYBQ VPRTYB_SQ + unsigned __int128 __builtin_vec_vprtyb (unsigned __int128); + VPRTYBQ VPRTYB_UQ + [VEC_VSCEEQ, scalar_cmp_exp_eq, __builtin_vec_scalar_cmp_exp_eq, _ARCH_PWR9] signed int __builtin_vec_scalar_cmp_exp_eq (double, double); VSCEDPEQ diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vparity.c b/gcc/testsuite/gcc.target/powerpc/p9-vparity.c index 8897a5b6b7f..f4aba1567cd 100644 --- a/gcc/testsuite/gcc.target/powerpc/p9-vparity.c +++ b/gcc/testsuite/gcc.target/powerpc/p9-vparity.c @@ -9,97 +9,97 @@ vector int parity_v4si_1s (vector int a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } vector int parity_v4si_2s (vector int a) { - return vec_parity_lsbb (a); + return vec_vprtybw (a); } vector unsigned int parity_v4si_1u (vector unsigned int a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } vector unsigned int parity_v4si_2u (vector unsigned int a) { - return vec_parity_lsbb (a); + return vec_vprtybw (a); } vector long long parity_v2di_1s (vector long long a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } vector long long parity_v2di_2s (vector long long a) { - return vec_parity_lsbb (a); + return vec_vprtybd (a); } vector unsigned long long parity_v2di_1u (vector unsigned long long a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } vector unsigned long long parity_v2di_2u (vector unsigned long long a) { - return vec_parity_lsbb (a); + return vec_vprtybd (a); } vector __int128_t parity_v1ti_1s (vector __int128_t a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } vector __int128_t parity_v1ti_2s (vector __int128_t a) { - return vec_parity_lsbb (a); + return vec_vprtybq (a); } __int128_t parity_ti_3s (__int128_t a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } __int128_t parity_ti_4s (__int128_t a) { - return vec_parity_lsbb (a); + return vec_vprtybq (a); } vector __uint128_t parity_v1ti_1u (vector __uint128_t a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } vector __uint128_t parity_v1ti_2u (vector __uint128_t a) { - return vec_parity_lsbb (a); + return vec_vprtybq (a); } __uint128_t parity_ti_3u (__uint128_t a) { - return vec_parity_lsbb (a); + return vec_vprtyb (a); } __uint128_t parity_ti_4u (__uint128_t a) { - return vec_parity_lsbb (a); + return vec_vprtybq (a); } /* { dg-final { scan-assembler "vprtybd" } } */