On Tue, 2020-06-30 at 12:57 -0500, will schmidt via Gcc-patches wrote:
> Hi,
> 
>   Add support for the vmsumudm instruction and tie it into the
> vec_msum
>   built-in to support the variants of that built-in using vector
>  _int128 parameters.
> 
>   vector _uint128_t vec_msum (vector unsigned long long,
>                               vector unsigned long long,
>                               vector _uint128_t);
>   vector _int128_t vec_msum (vector signed long long,
>                              vector signed long long,
>                              vector _int128_t);
> 
> [v2]
>   Corrected the define_insn and test requirements to be limited to
> P9.
>   Improve description to clarify the vmsum does
>   a widening multiply and horizontal addition.
> 
> Fresh regtests currently running on assorted powerpc targets.
> 
> OK for trunk?
> 
> Thanks,
> -Will
> 
> 
> [gcc]
> 
> 2020-06-18  Will Schmidt  <will_schm...@vnet.ibm.com>
> 
>         * config/rs6000/altivec.h (vec_vmsumudm): New define.
>         * config/rs6000/altivec.md (UNSPEC_VMSUMUDM): New unspec.
>         (altivec_vmsumudm): New define_insn.
>         * config/rs6000/rs6000-builtin.def (altivec_vmsumudm): New
>         BU_ALTIVEC_3 entry. (vmsumudm): New BU_ALTIVEC_OVERLOAD_3
>         entry.
>         * config/rs6000/rs6000-call.c (altivec_overloaded_builtins):
>         Add entries for ALTIVEC_BUILTIN_VMSUMUDM variants of
> vec_msum.
> 
> [testsuite]
> 
> 2020-06-18  Will Schmidt  <will_schm...@vnet.ibm.com>
> 
>         * gcc.target/powerpc/builtins-msum-runnable.c: New test.
>         * gcc.target/powerpc/vsx-builtin-msum.c: New test.
> 
> 
<snip>

> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c
> b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c
> new file mode 100644
> index 000000000000..1974864de00c
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c
> @@ -0,0 +1,25 @@
> +/* Verify that overloaded built-ins for vec_msum with __int128
> +   inputs generate the proper code.  */
> +
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_p9vector_ok } */
> +/* { dg-options "-mdejagnu-cpu=power9  -O3" } */

Per my latest regtest, this fails on a BE -m32 due to "__int128" is not
suported.  I'll be adding some form of require-target int128 to clear
that up.

thanks
-Will



> +
> +#include <altivec.h>
> +
> +vector signed __int128
> +test_msum_si (vector signed long long vsll_1, vector signed long
> long vsll_2,
> +        vector signed __int128 vsi128)
> +{
> +  return vec_msum (vsll_1, vsll_2, vsi128);
> +}
> +
> +vector unsigned __int128
> +test_msum_ui (vector unsigned long long vull_1, vector unsigned long
> long vull_2,
> +        vector unsigned __int128 vui128)
> +{
> +  return vec_msum (vull_1, vull_2, vui128);
> +}
> +
> +/* { dg_final { scan_assembler_times "vmsumudm" 2 } } */
> +
> 

Reply via email to