This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v3, rs6000] gcc mainline, add builtin support for vec_doublee, vec_doubleo, vec_doublel builtins
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: "Carl E. Love" <cel at us dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Thu, 1 Jun 2017 17:42:01 -0500
- Subject: Re: [PATCH v3, rs6000] gcc mainline, add builtin support for vec_doublee, vec_doubleo, vec_doublel builtins
- Authentication-results: sourceware.org; auth=none
- References: <1496354145.4252.23.camel@us.ibm.com>
Hi Carl,
On Thu, Jun 01, 2017 at 02:55:45PM -0700, Carl E. Love wrote:
> Add vec_doublee, vec_doubleo, vec_doublel, vec_doubleh builtin-ins
>
> gcc/ChangeLog:
>
> 2017-06-01 Carl Love <cel@us.ibm.com>
>
> * config/rs6000/rs6000-c: Add support for built-in functions
> vector double vec_doublee (vector signed int);
> vector double vec_doublee (vector unsigned int);
> vector double vec_doublee (vector float);
> vector double vec_doubleh (vector signed int);
> vector double vec_doubleh (vector unsigned int);
> vector double vec_doubleh (vector float);
> vector double vec_doublel (vector signed int);
> vector double vec_doublel (vector unsigned int);
> vector double vec_doublel (vector float);
> vector double vec_doubleo (vector signed int);
> vector double vec_doubleo (vector unsigned int);
> vector double vec_doubleo (vector float);.
> * config/rs6000/rs6000-builtin.def: Add definitions for DOUBLEE,
> DOUBLEO, DOUBLEH, DOUBLEL, UNS_DOUBLEO, UNS_DOUBLEE, UNS_DOUBLEH,
> UNS_DOUBLEL.
> * config/rs6000/altivec.md: Add code generator for doublee<mode>2,
> unsdoubleev4si2, doubleo<mode>2, unsdoubleov4si2, doubleh<mode>2,
> unsdoublehv4si2, doublel<mode>2, unsdoublelv4si2, add mode attribute
> VS_sxwsp.
> * config/rs6000/altivec.h: Add define for vec_doublee, vec_doubleo,
> vec_doublel, vec_doubleh.
> * doc/extend.texi: Update the built-in documentation file for the
> new built-in functions.
>
> 2017-06-01 Carl Love <cel@us.ibm.com>
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/powerpc/builtins-3-runnable.c: New file of runnable tests
> for the new built-ins.
>
> Signed-off-by: Carl Love <carll@us.ibm.com>
We don't do signoffs in GCC, fwiw.
> +(define_expand "doublee<mode>2"
> + [(set (match_operand:V2DF 0 "register_operand" "=v")
> + (match_operand:VSX_W 1 "register_operand" "v"))]
> + "TARGET_VSX"
> +{
> + machine_mode op_mode = GET_MODE (operands[1]);
You indent with three spaces here, instead of two.
> +
> + if (VECTOR_ELT_ORDER_BIG)
> + {
Here you do two, okay.
> + /* Big endian word numbering for words in operand is 0 1 2 3.
> + Input words 0 and 2 are where they need to be. */
> + emit_insn (gen_vsx_xvcv<VS_sxwsp>dp (operands[0], operands[1]));
> + }
> + else
> + {
> + /* Little endian word numbering for operand is 3 2 1 0.
But here you do three again.
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c
> @@ -0,0 +1,83 @@
> +/* { dg-do run { target { powerpc*-*-linux* } } } */
> +/* { dg-require-effective-target vsx_hw } */
> +/* { dg-options "-O2 -mvsx -mcpu=power8" } */
This will then also need something like
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
Okay for trunk with that addition, and the final whitespace gotchas fixed.
Thanks,
Segher